Chromium Code Reviews| Index: build/common.gypi |
| diff --git a/build/common.gypi b/build/common.gypi |
| index e498d3eb467aeb94a8a835357a32be77ddc4f7f1..40e5a521b370227da83bbb1a688d7ac16721f6c0 100644 |
| --- a/build/common.gypi |
| +++ b/build/common.gypi |
| @@ -4149,6 +4149,9 @@ |
| ], |
| 'ldflags': [ |
| # We want to statically link libstdc++/libgcc_s. |
| + # Export the libstdc++ symbols so multiple copies merge |
| + # at runtime. |
| + '-Wl,--export-dynamic', |
|
slan
2015/12/01 19:29:32
If we go this route, this needs to be echoed in GN
bcf
2015/12/01 19:52:30
Done.
|
| '-static-libstdc++', |
| '-static-libgcc', |
| ], |
| @@ -4160,6 +4163,24 @@ |
| '-march=armv7-a', |
| '-mtune=cortex-a8', |
| ], |
| + 'target_conditions': [ |
| + [ '_type=="executable"', { |
| + # Statically link whole libstdc++ and libgcc in |
| + # executables to ensure only one copy at runtime. |
| + 'ldflags': [ |
| + '-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', |
| + ], |
| + }] |
| + ], |
| }], |
| ], |
| }], |