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

Unified Diff: build/SConscript.main

Issue 18846: More updates to build optimization settings. (Closed)
Patch Set: 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 15865ce97d4e51be17eb32ea5596095a8fb712d5..6d5970e859c7f0b8641661c7956a26415a9d8402 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -511,6 +511,11 @@ linux_env.Append(
# Build an "official" build (DCHECKs completely compiled out, etc).
if ARGUMENTS.get('OFFICIAL') == '1':
linux_env.Append(CPPDEFINES=['OFFICIAL_BUILD'])
+ # Make sure units of code and data go in their own section, and then GC them
+ # in the linker to remove unreferenced data and code. Currently gold doesn't
+ # support --gc-sections, so you'll have to build with the original GNU ld.
+ linux_env.Append(CCFLAGS_OPTIMIZED=['-ffunction-sections', '-fdata-sections'])
+ linux_env.Append(LINKFLAGS_OPTIMIZED=['-Wl,--gc-sections'])
# Build with support for gcov when COVERAGE=1.
if ARGUMENTS.get('COVERAGE') == '1':
@@ -523,12 +528,8 @@ 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':
« 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