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..0f172f456b8f166b2a2063beca1d9af8e3bfb127 100644 |
| --- a/build/config/chromecast/BUILD.gn |
| +++ b/build/config/chromecast/BUILD.gn |
| @@ -34,10 +34,10 @@ config("ldconfig") { |
| ] |
| } |
| -config("executable_config") { |
| - configs = [ ":ldconfig" ] |
| - |
| - if (current_cpu == "arm") { |
| +# Whole archiving libgcc.a and libstdc++ is needed if dynamic share libs are |
|
scottmg
2016/09/02 20:40:55
"share" -> "shared"
antz1
2016/09/02 21:22:53
Done.
|
| +# used, see b/25566835. |
| +config("executable_whole_archive_config") { |
| + if (current_cpu == "arm" && !is_android) { |
|
scottmg
2016/09/02 20:40:55
Isn't there an is_chromecast, if that's what's mea
antz1
2016/09/02 21:22:53
is_chromecast is set for our android builds, which
|
| ldflags = [ |
| # Export stdlibc++ and libgcc symbols to force shlibs to refer to these |
| # symbols from the executable. |
| @@ -45,25 +45,33 @@ 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", |
| ] |
| + } |
| +} |
| + |
| +# Statically linking against libstdc++/libgcc should happen for arm chromecast |
| +# devices, and is not needed for Android builds. |
| +config("executable_config") { |
| + configs = [ ":ldconfig" ] |
| - # 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. |
| + if (current_cpu == "arm" && !is_android) { |
|
bcf
2016/09/02 20:35:12
Define variable for this at top.
scottmg
2016/09/02 20:40:55
And here?
|
| + # Statically link libstdc++ and libgcc to avoid having a dynamic dependency |
| + # on them. |
| configs += [ ":static_config" ] |
| } |
| } |
| config("shared_library_config") { |
| configs = [ ":ldconfig" ] |
| - if (current_cpu == "arm") { |
| + if (current_cpu == "arm" && !is_android) { |
| configs += [ ":static_config" ] |
| } |
| } |