Chromium Code Reviews| Index: build/config/chromecast/BUILD.gn |
| diff --git a/build/config/chromecast/BUILD.gn b/build/config/chromecast/BUILD.gn |
| index f1cbfe61946fb68e18ab195dc1e3e9aae4012ad7..1e4906135b44530e2317126ce0f16503515a5c33 100644 |
| --- a/build/config/chromecast/BUILD.gn |
| +++ b/build/config/chromecast/BUILD.gn |
| @@ -34,9 +34,9 @@ config("ldconfig") { |
| ] |
| } |
| -config("executable_config") { |
| - configs = [ ":ldconfig" ] |
| - |
| +# Whole archiving libgcc.a and libstdc++ is needed if dynamic share libs are |
| +# used, see b/25566835. |
| +config("executable_whole_archive_config") { |
| if (current_cpu == "arm") { |
| ldflags = [ |
| # Export stdlibc++ and libgcc symbols to force shlibs to refer to these |
| @@ -45,18 +45,24 @@ config("executable_config") { |
| "-lm", # stdlibc++ requires math.h |
| - # In case we redefined stdlibc++ symbols (e.g. tc_malloc) |
| + # In case we redefined stdlibc++ symbols (e.g. tc_malloc). |
| "-Wl,--allow-multiple-definition", |
| + # Adding all symbols from libgcc and libstdc++. |
| "-Wl,--whole-archive", |
| "-l:libstdc++.a", |
| "-l:libgcc.a", |
| "-Wl,--no-whole-archive", |
| ] |
| + } |
| +} |
| - # 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. |
| +config("executable_config") { |
| + configs = [ ":ldconfig" ] |
| + |
| + if (current_cpu == "arm") { |
|
slan
2016/08/30 22:22:53
Why just "arm" here? What is this conditional tryi
bcf
2016/08/30 22:36:43
This is only a problem on our Chromecast devices b
slan
2016/08/30 22:46:51
Thanks - that's a good point. However, this wouldn
|
| + # Statically link libstdc++ and libgcc to avoid having a dynamic dependency |
| + # on them. |
| configs += [ ":static_config" ] |
| } |
| } |