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 ldflags = [ |
(...skipping 16 matching lines...) Expand all Loading... | |
27 # This is explicitly disabled in Chrome for security reasons (see comments in | 27 # This is explicitly disabled in Chrome for security reasons (see comments in |
28 # //build/config/gcc/BUILD.gn), but necessary on Chromecast so that OEM's may | 28 # //build/config/gcc/BUILD.gn), but necessary on Chromecast so that OEM's may |
29 # override the default libraries shipped in the Cast receiver package. | 29 # override the default libraries shipped in the Cast receiver package. |
30 ldflags = [ | 30 ldflags = [ |
31 "-Wl,-rpath=/oem_cast_shlib", | 31 "-Wl,-rpath=/oem_cast_shlib", |
32 "-Wl,-rpath=\$ORIGIN/lib", | 32 "-Wl,-rpath=\$ORIGIN/lib", |
33 "-Wl,-rpath=\$ORIGIN", | 33 "-Wl,-rpath=\$ORIGIN", |
34 ] | 34 ] |
35 } | 35 } |
36 | 36 |
37 # whole archiving libgcc.a and libstdc++ is needed if dynamic share libs are | |
38 # used, see b/25566835 | |
39 config("executable_whole_archive_config") { | |
40 if (current_cpu == "arm") { | |
41 ldflags = [ | |
42 # adding all symbols from libgcc and libstdc++ | |
43 "-Wl,--whole-archive", | |
44 "-l:libstdc++.a", | |
45 "-l:libgcc.a", | |
46 "-Wl,--no-whole-archive", | |
47 ] | |
48 } | |
49 } | |
50 | |
37 config("executable_config") { | 51 config("executable_config") { |
38 configs = [ ":ldconfig" ] | 52 configs = [ ":ldconfig" ] |
39 | 53 |
40 if (current_cpu == "arm") { | 54 if (current_cpu == "arm") { |
bcf
2016/08/29 21:22:51
You should be able to move this whole block to exe
antz1
2016/08/29 23:09:33
Done.
| |
41 ldflags = [ | 55 ldflags = [ |
42 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these | 56 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these |
43 # symbols from the executable. | 57 # symbols from the executable. |
44 "-Wl,--export-dynamic", | 58 "-Wl,--export-dynamic", |
45 | 59 |
46 "-lm", # stdlibc++ requires math.h | 60 "-lm", # stdlibc++ requires math.h |
47 | 61 |
48 # In case we redefined stdlibc++ symbols (e.g. tc_malloc) | 62 # In case we redefined stdlibc++ symbols (e.g. tc_malloc) |
49 "-Wl,--allow-multiple-definition", | 63 "-Wl,--allow-multiple-definition", |
50 | |
51 "-Wl,--whole-archive", | |
52 "-l:libstdc++.a", | |
53 "-l:libgcc.a", | |
54 "-Wl,--no-whole-archive", | |
55 ] | 64 ] |
56 | 65 |
57 # Despite including libstdc++/libgcc archives, we still need to specify | 66 # Despite including libstdc++/libgcc archives, we still need to specify |
58 # static linking for them in order to prevent the executable from having a | 67 # static linking for them in order to prevent the executable from having a |
59 # dynamic dependency on them. | 68 # dynamic dependency on them. |
60 configs += [ ":static_config" ] | 69 configs += [ ":static_config" ] |
61 } | 70 } |
62 } | 71 } |
63 | 72 |
64 config("shared_library_config") { | 73 config("shared_library_config") { |
65 configs = [ ":ldconfig" ] | 74 configs = [ ":ldconfig" ] |
66 if (current_cpu == "arm") { | 75 if (current_cpu == "arm") { |
67 configs += [ ":static_config" ] | 76 configs += [ ":static_config" ] |
68 } | 77 } |
69 } | 78 } |
OLD | NEW |