OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/chromecast_build.gni") | 5 import("//build/config/chromecast_build.gni") |
6 | 6 |
7 assert(is_chromecast) | 7 assert(is_chromecast) |
8 | 8 |
9 config("static_config") { | 9 config("static_config") { |
10 ldflags = [ | 10 if (!is_clang) { |
11 # Don't allow visible symbols from libraries that contain | 11 ldflags = [ |
12 # assembly code with symbols that aren't hidden properly. | 12 # Don't allow visible symbols from libraries that contain |
13 # http://b/26390825 | 13 # assembly code with symbols that aren't hidden properly. |
14 "-Wl,--exclude-libs=libffmpeg.a", | 14 # http://b/26390825 |
15 ] | 15 "-Wl,--exclude-libs=libffmpeg.a", |
16 ] | |
gfhuang
2017/04/11 17:54:27
is this safe to remove?
wzhong
2017/04/11 17:57:41
No. Still needed for GCC build.
| |
16 | 17 |
17 if (!is_android) { | 18 if (!is_android) { |
18 ldflags += [ | 19 ldflags += [ |
19 # We want to statically link libstdc++/libgcc on Linux. | 20 # We want to statically link libstdc++/libgcc on Linux. |
20 # (On Android, libstdc++ and libgcc aren't used.) | 21 # (On Android, libstdc++ and libgcc aren't used.) |
21 "-static-libstdc++", | 22 "-static-libstdc++", |
22 "-static-libgcc", | 23 "-static-libgcc", |
wzhong
2017/04/11 17:57:41
What is the implication in practice?
Does clang t
bcf
2017/04/11 18:17:07
Yes, clang will take the flags.
In practice this
| |
23 ] | 24 ] |
25 } | |
24 } | 26 } |
25 } | 27 } |
26 | 28 |
27 config("ldconfig") { | 29 config("ldconfig") { |
28 visibility = [ ":*" ] | 30 visibility = [ ":*" ] |
29 | 31 |
30 # Chromecast executables depend on several shared libraries in | 32 # Chromecast executables depend on several shared libraries in |
31 # /oem_cast_shlib, $ORIGIN, and $ORIGIN/lib. Add these rpaths to each binary. | 33 # /oem_cast_shlib, $ORIGIN, and $ORIGIN/lib. Add these rpaths to each binary. |
32 # This is explicitly disabled in Chrome for security reasons (see comments in | 34 # This is explicitly disabled in Chrome for security reasons (see comments in |
33 # //build/config/gcc/BUILD.gn), but necessary on Chromecast so that OEM's may | 35 # //build/config/gcc/BUILD.gn), but necessary on Chromecast so that OEM's may |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 70 |
69 # Despite including libstdc++/libgcc archives, we still need to specify | 71 # Despite including libstdc++/libgcc archives, we still need to specify |
70 # static linking for them in order to prevent the executable from having a | 72 # static linking for them in order to prevent the executable from having a |
71 # dynamic dependency on them. | 73 # dynamic dependency on them. |
72 configs += [ ":static_config" ] | 74 configs += [ ":static_config" ] |
73 } | 75 } |
74 } | 76 } |
75 | 77 |
76 config("shared_library_config") { | 78 config("shared_library_config") { |
77 configs = [ ":ldconfig" ] | 79 configs = [ ":ldconfig" ] |
78 if (!is_clang && current_cpu == "arm") { | 80 if (current_cpu == "arm") { |
79 configs += [ ":static_config" ] | 81 configs += [ ":static_config" ] |
80 } | 82 } |
81 } | 83 } |
OLD | NEW |