diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 17:40:28 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 17:40:28 +0000 |
commit | 3a68cd8f6002931507bfcace5fd8c87565584bf7 (patch) | |
tree | fdc152762a8ee440b7cd2e6914c846c9ff6a60cd | |
parent | d46d2081bb725bb74f393c1f44c051eb739e6bb4 (diff) | |
download | chromium_src-3a68cd8f6002931507bfcace5fd8c87565584bf7.zip chromium_src-3a68cd8f6002931507bfcace5fd8c87565584bf7.tar.gz chromium_src-3a68cd8f6002931507bfcace5fd8c87565584bf7.tar.bz2 |
Reduce the size of a release test_shell from 18mb to 12mb.
- Strip all symbols. We previously had many exported symbols.
- GC sections. -fdata/function-sections make sure each piece of code/data has it's own section, since GC works on an entire section. I will follow up on the V8 build with the same.
- Remove the ident pragmas. For example, we previously had a string like:
GCC: (GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu1)
Repeated in the .comment section (one for each object?). This data is just metadata.
Review URL: http://codereview.chromium.org/18586
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8636 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/SConscript.main | 7 |
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': |