From 8b3565d50790db9683fb85ba00d51a5e1e1c58a2 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 15 Jul 2021 02:27:52 -0700 Subject: [PATCH] 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 Maintainer: Gabe Black Tested-by: kokoro --- src/SConscript | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/SConscript b/src/SConscript index c518b36097..d39fb8d89a 100644 --- a/src/SConscript +++ b/src/SConscript @@ -222,9 +222,6 @@ class SourceFile(object, metaclass=SourceMeta): 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 @@ class SourceFile(object, metaclass=SourceMeta): 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): '''