summaryrefslogtreecommitdiffstats
path: root/build/SConscript.main
diff options
context:
space:
mode:
Diffstat (limited to 'build/SConscript.main')
-rw-r--r--build/SConscript.main7
1 files changed, 7 insertions, 0 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index 35ee04e..15865ce 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -452,6 +452,9 @@ linux_env.Append(
'$LIBEVENT_DIR/libevent.scons',
],
CCFLAGS = ['-m32', '-pthread', '-march=i686', '-fno-exceptions'],
+ # GCC will generate ident directives with the GCC version. Accumulate
+ # these all up and you end up with ~80K repeated in a .comment section.
+ CCFLAGS_OPTIMIZED = ['-fno-ident'],
CXXFLAGS = ['-Wall', '-Werror', '-march=i686'] + excluded_warnings,
LINKFLAGS = ['-m32', '-pthread'],
)
@@ -520,8 +523,12 @@ if ARGUMENTS.get('PROFILE') == '1':
linux_env.Append(LINKFLAGS=['-pg'])
# Build with symbols (useful for opt builds, for example) when SYMBOLS=1.
+# Otherwise if we're building release, strip all symbols from our output.
if ARGUMENTS.get('SYMBOLS') == '1':
linux_env.Append(CCFLAGS=['-g'])
+else:
+ linux_env.Append(CCFLAGS_OPTIMIZED=['-ffunction-sections', '-fdata-sections'])
+ linux_env.Append(LINKFLAGS_OPTIMIZED=['-Wl,--gc-sections', '-s'])
# Build shared libraries (useful for fast links) when SHARED=1.
if ARGUMENTS.get('SHARED') == '1':