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..403a37c60028e9f9c696a3a633e559da2f40c5bb |
| --- /dev/null |
| +++ b/build/config/chromecast/BUILD.gn |
| @@ -0,0 +1,41 @@ |
| +# 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) |
| + |
| +config("static_config") { |
| + ldflags = [ |
| + # We want to statically link libstdc++/libgcc. Export the libstdc++ |
| + # symbols so multiple copies merge at runtime. |
| + "-Wl,--export-dynamic", |
|
byungchul
2015/12/01 21:22:48
Why isn't it only for executables?
|
| + "-static-libstdc++", |
| + "-static-libgcc", |
| + ] |
| +} |
| + |
| +config("whole_libstdcxx_config") { |
| + 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", |
| + ] |
| +} |
| + |
| +config("executable_config") { |
| + # Order matters, so we define a separate config for whole stdlibc++/libgcc |
| + configs = [ |
| + ":static_config", |
| + ":whole_libstdcxx_config", |
| + ] |
| +} |
| + |
| +config("shlib_config") { |
| + configs = [ ":static_config" ] |
| +} |