Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: build/SConscript.main

Issue 18586: Reduce the size of a release test_shell from 18mb to 13mb. (Closed)
Patch Set: GC sections Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/SConscript.main
diff --git a/build/SConscript.main b/build/SConscript.main
index 35ee04efc8852691fee704130ea0b3a50263c6d9..15865ce97d4e51be17eb32ea5596095a8fb712d5 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'])
Lei Zhang 2009/01/26 22:21:23 FYI, gold does not support --gc-sections.
# Build shared libraries (useful for fast links) when SHARED=1.
if ARGUMENTS.get('SHARED') == '1':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698