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

Unified Diff: build/common.gypi

Issue 1476923004: [Chromecast] Include all stdlibc++/libgcc symbols in cast_shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Disable executable options on Android. Created 5 years 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 | build/config/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index e498d3eb467aeb94a8a835357a32be77ddc4f7f1..40dbe5227342228fc07ce7678940eb2c4d0a088e 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -4148,7 +4148,7 @@
'-g',
],
'ldflags': [
- # We want to statically link libstdc++/libgcc_s.
+ # We want to statically link libstdc++/libgcc.
'-static-libstdc++',
'-static-libgcc',
],
@@ -4160,6 +4160,34 @@
'-march=armv7-a',
'-mtune=cortex-a8',
],
+ 'target_conditions': [
+ [ '_type=="executable" and OS!="android"', {
bcf 2015/12/09 00:34:55 Android uses its own libstdc++ so we don't need th
+ # Statically link whole libstdc++ and libgcc in
+ # executables to ensure only one copy at runtime.
+ 'ldflags': [
+ # Note executables also get -static-stdlibc++/libgcc.
+ # Despite including libstdc++/libgcc archives, we
+ # still need to specify static linking for them in
+ # order to prevent the executable from having a
+ # dynamic dependency on them.
+
+ # Export stdlibc++ and libgcc symbols to force shlibs
+ # to refer to these symbols from the executable.
+ '-Wl,--export-dynamic',
+
+ '-lm', # stdlibc++ requires math.h
+
+ # In case we redefined stdlibc++ symbols
+ # (e.g. tc_malloc)
+ '-Wl,--allow-multiple-definition',
+
+ '-Wl,--whole-archive',
+ '-l:libstdc++.a',
+ '-l:libgcc.a',
+ '-Wl,--no-whole-archive',
+ ],
+ }]
+ ],
}],
],
}],
« no previous file with comments | « no previous file | build/config/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698