Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/48120 )
Change subject: scons: Make all Executables strip-able, and de-special
case .fast.
......................................................................
scons: Make all Executables strip-able, and de-special case .fast.
The build for .fast was set up to produce a stripped executable, and the
unstripped executable was instead named .fast.unstripped. I think the
assumption that a stripped executable is faster than an unstripped
executable is flawed, since the parts of the binary that are removed,
debug symbols, are not loaded into memory anyway, so while the program
is executing it shouldn't be any different or take up any additional
memory. This also made .fast a special case compared to the other build
types, like .opt, .debug, etc.
Instead, this change makes .fast unstripped like all the other binaries,
and also makes it possible to request a stripped version of *any* binary
the build can produce with a .stripped suffix.
Change-Id: I2de82e0951d9f41c30594f32fba50acdd14ed69c
---
M src/SConscript
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/SConscript b/src/SConscript
index 6a630da..a9d70bf 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -576,18 +576,16 @@
env['BIN_RPATH_PREFIX'] = os.path.relpath(
env['BUILDDIR'], self.path(env).dir.abspath)
- if env['STRIP_EXES']:
- stripped = self.path(env)
- unstripped = env.File(str(stripped) + '.unstripped')
- if sys.platform == 'sunos5':
- cmd = 'cp $SOURCE $TARGET; strip $TARGET'
- else:
- cmd = 'strip $SOURCE -o $TARGET'
- env.Program(unstripped, objs)
- return env.Command(stripped, unstripped,
- MakeAction(cmd, Transform("STRIP")))
+ executable = env.Program(self.path(env), objs)[0]
+
+ if sys.platform == 'sunos5':
+ cmd = 'cp $SOURCE $TARGET; strip $TARGET'
else:
- return env.Program(self.path(env), objs)
+ cmd = 'strip $SOURCE -o $TARGET'
+ stripped = env.Command(str(executable) + '.stripped',
+ executable, MakeAction(cmd, Transform("STRIP")))[0]
+
+ return [executable, stripped]
class GTest(Executable):
'''Create a unit test based on the google test framework.'''
@@ -1351,7 +1349,7 @@
# environment 'env' with modified object suffix and optional stripped
# binary. Additional keyword arguments are appended to corresponding
# build environment vars.
-def makeEnv(env, label, objsfx, strip=False, **kwargs):
+def makeEnv(env, label, objsfx, **kwargs):
# SCons doesn't know to append a library suffix when there is a '.' in
the
# name. Use '_' instead.
libname = 'gem5_' + label
@@ -1397,7 +1395,6 @@
# Record some settings for building Executables.
new_env['EXE_SUFFIX'] = label
- new_env['STRIP_EXES'] = strip
for cls in ExecutableMeta.all:
cls.declare_all(new_env)
@@ -1476,7 +1473,7 @@
# "Fast" binary
if 'fast' in needed_envs:
- makeEnv(env, 'fast', '.fo', strip = True,
+ makeEnv(env, 'fast', '.fo',
CCFLAGS = Split(ccflags['fast']),
CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
LINKFLAGS = Split(ldflags['fast']))
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48120
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: I2de82e0951d9f41c30594f32fba50acdd14ed69c
Gerrit-Change-Number: 48120
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s