Chromium Code Reviews| Index: build/config/chromecast/BUILD.gn |
| diff --git a/build/config/chromecast/BUILD.gn b/build/config/chromecast/BUILD.gn |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c230b199a30130d77e4ede00b0165fa443e8eb7b |
| --- /dev/null |
| +++ b/build/config/chromecast/BUILD.gn |
| @@ -0,0 +1,40 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +assert(is_chromecast) |
|
slan
2015/12/02 15:25:24
I'm surprised you don't need to import //build/con
brettw
2015/12/02 18:43:35
externally set build args are implicitly global (t
|
| + |
| +config("static_config") { |
| + ldflags = [ |
| + # We want to statically link libstdc++/libgcc. |
| + "-static-libstdc++", |
| + "-static-libgcc", |
| + ] |
| +} |
| + |
| +config("executable_config") { |
| + ldflags = [ |
| + # Export stdlibc++ and libgcc symbols to force shlibs to refer to these |
| + # symbols from the executable. |
| + "-Wl,--export-dynamic", |
|
brettw
2015/12/02 18:43:35
I'd like to understand why this is so different th
bcf
2015/12/02 19:12:27
The main issue is we are forced to use -static-lib
|
| + |
| + "-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", |
| + ] |
| + |
| + # 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. |
| + configs = [ ":static_config" ] |
| +} |
| + |
| +config("shlib_config") { |
| + configs = [ ":static_config" ] |
| +} |