Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/48138 )

Change subject: scons: Stop caching the first version of object files.
......................................................................

scons: Stop caching the first version of object files.

Don't cache the first version requested of object files to use for
subsequent requests. This was originally put in place to avoid an error
when object files could be built with trivially different command lines,
ie command lines which are technically different but not in a
necessarily meaningful way, or less seriously a warning when the command
lines were the same.

The warning was disabled in an earlier change, and the error was avoided
by using a different object file suffix when building unit tests.

This helps avoid bugs if the object files actually *would* turn out to
be different in a meaningful way based on the flags used, and simplifies
the build.

Change-Id: I6b90e6e36b13adb73e587bb8fc533984f764d95a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48138
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/SConscript
1 file changed, 2 insertions(+), 11 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/SConscript b/src/SConscript
index c518b36..d39fb8d 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -222,9 +222,6 @@
     of those.  A source file also specifies a set of tags which
     describing arbitrary properties of the source file.'''

-    static_objs = {}
-    shared_objs = {}
-
     def __init__(self, source, tags=None, add_tags=None, append=None):
         if tags is None:
             tags='gem5 lib'
@@ -256,22 +253,16 @@
                 base.all.append(self)

     def static(self, env):
-        key = (self.tnode, env['OBJSUFFIX'])
         if self.append:
             env = env.Clone()
             env.Append(**self.append)
-        if not key in self.static_objs:
-            self.static_objs[key] = env.StaticObject(self.tnode)
-        return self.static_objs[key]
+        return env.StaticObject(self.tnode)

     def shared(self, env):
-        key = (self.tnode, env['OBJSUFFIX'])
         if self.append:
             env = env.Clone()
             env.Append(**self.append)
-        if not key in self.shared_objs:
-            self.shared_objs[key] = env.SharedObject(self.tnode)
-        return self.shared_objs[key]
+        return env.SharedObject(self.tnode)

 def bytesToCppArray(code, symbol, data):
     '''

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48138
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6b90e6e36b13adb73e587bb8fc533984f764d95a
Gerrit-Change-Number: 48138
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Bobby Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Bobby R. Bruce <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to