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 = [ |
11 # We want to statically link libstdc++/libgcc. | 11 # We want to statically link libstdc++/libgcc. |
12 "-static-libstdc++", | 12 "-static-libstdc++", |
13 "-static-libgcc", | 13 "-static-libgcc", |
14 ] | 14 ] |
15 } | 15 } |
16 | 16 |
17 config("executable_config") { | 17 config("executable_config") { |
18 ldflags = [ | 18 ldflags = [] |
slan
2015/12/10 01:25:54
No need to delcare these here, just assign them di
bcf
2015/12/10 01:46:38
Done.
| |
19 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these | 19 configs = [] |
20 # symbols from the executable. | |
21 "-Wl,--export-dynamic", | |
22 | 20 |
23 "-lm", # stdlibc++ requires math.h | 21 if (current_cpu == "arm") { |
bcf
2015/12/10 01:17:21
Is it more preferred to put the conditionals in th
| |
22 ldflags += [ | |
23 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these | |
24 # symbols from the executable. | |
25 "-Wl,--export-dynamic", | |
24 | 26 |
25 # In case we redefined stdlibc++ symbols (e.g. tc_malloc) | 27 "-lm", # stdlibc++ requires math.h |
26 "-Wl,--allow-multiple-definition", | |
27 | 28 |
28 "-Wl,--whole-archive", | 29 # In case we redefined stdlibc++ symbols (e.g. tc_malloc) |
29 "-l:libstdc++.a", | 30 "-Wl,--allow-multiple-definition", |
30 "-l:libgcc.a", | |
31 "-Wl,--no-whole-archive", | |
32 ] | |
33 | 31 |
34 # Despite including libstdc++/libgcc archives, we still need to specify | 32 "-Wl,--whole-archive", |
35 # static linking for them in order to prevent the executable from having a | 33 "-l:libstdc++.a", |
36 # dynamic dependency on them. | 34 "-l:libgcc.a", |
37 configs = [ ":static_config" ] | 35 "-Wl,--no-whole-archive", |
36 ] | |
37 | |
38 # Despite including libstdc++/libgcc archives, we still need to specify | |
39 # static linking for them in order to prevent the executable from having a | |
40 # dynamic dependency on them. | |
41 configs += [ ":static_config" ] | |
42 } | |
38 } | 43 } |
39 | 44 |
40 config("shared_library_config") { | 45 config("shared_library_config") { |
41 configs = [ ":static_config" ] | 46 if (current_cpu == "arm") { |
47 configs = [ ":static_config" ] | |
48 } | |
42 } | 49 } |
OLD | NEW |