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..41f1c079638218a271fe6184f0f78fd10483fe3f |
--- /dev/null |
+++ b/build/config/chromecast/BUILD.gn |
@@ -0,0 +1,42 @@ |
+# 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. |
+ |
+import("//build/config/chromecast_build.gni") |
+ |
+assert(is_chromecast) |
+ |
+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", |
+ |
+ "-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("shared_library_config") { |
+ configs = [ ":static_config" ] |
+} |