Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: build/config/chromecast/BUILD.gn

Issue 2726013002: [Chromecast] Don't use static c++ libraries for clang builds (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # Don't allow visible symbols from libraries that contain 11 # Don't allow visible symbols from libraries that contain
12 # assembly code with symbols that aren't hidden properly. 12 # assembly code with symbols that aren't hidden properly.
13 # http://b/26390825 13 # http://b/26390825
14 "-Wl,--exclude-libs=libffmpeg.a", 14 "-Wl,--exclude-libs=libffmpeg.a",
bcf 2017/03/01 23:59:20 This shouldn't be necessary since we're not using
wzhong 2017/03/02 00:12:40 Not really. I believe in this case, without this,
bcf 2017/03/02 02:59:26 So you're saying we still need this? I thought th
wzhong 2017/03/02 15:53:48 Probably you're right. The caveat is the symbols
15 ] 15 ]
16 16
17 if (!is_android) { 17 if (!is_android) {
18 ldflags += [ 18 ldflags += [
19 # We want to statically link libstdc++/libgcc on Linux. 19 # We want to statically link libstdc++/libgcc on Linux.
20 # (On Android, libstdc++ and libgcc aren't used.) 20 # (On Android, libstdc++ and libgcc aren't used.)
21 "-static-libstdc++", 21 "-static-libstdc++",
22 "-static-libgcc", 22 "-static-libgcc",
23 ] 23 ]
24 } 24 }
(...skipping 17 matching lines...) Expand all
42 # libraries may still depend on them. Explicitly add the component library 42 # libraries may still depend on them. Explicitly add the component library
43 # directory to the rpath for the component build. 43 # directory to the rpath for the component build.
44 if (is_component_build) { 44 if (is_component_build) {
45 ldflags += [ "-Wl,-rpath=/system/chrome" ] 45 ldflags += [ "-Wl,-rpath=/system/chrome" ]
46 } 46 }
47 } 47 }
48 48
49 config("executable_config") { 49 config("executable_config") {
50 configs = [ ":ldconfig" ] 50 configs = [ ":ldconfig" ]
51 51
52 if (current_cpu == "arm") { 52 if (!is_clang && current_cpu == "arm") {
53 ldflags = [ 53 ldflags = [
54 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these 54 # Export stdlibc++ and libgcc symbols to force shlibs to refer to these
55 # symbols from the executable. 55 # symbols from the executable.
56 "-Wl,--export-dynamic", 56 "-Wl,--export-dynamic",
57 57
58 "-lm", # stdlibc++ requires math.h 58 "-lm", # stdlibc++ requires math.h
59 59
60 # In case we redefined stdlibc++ symbols (e.g. tc_malloc) 60 # In case we redefined stdlibc++ symbols (e.g. tc_malloc)
61 "-Wl,--allow-multiple-definition", 61 "-Wl,--allow-multiple-definition",
62 62
63 "-Wl,--whole-archive", 63 "-Wl,--whole-archive",
64 "-l:libstdc++.a", 64 "-l:libstdc++.a",
65 "-l:libgcc.a", 65 "-l:libgcc.a",
66 "-Wl,--no-whole-archive", 66 "-Wl,--no-whole-archive",
67 ] 67 ]
68 68
69 # Despite including libstdc++/libgcc archives, we still need to specify 69 # Despite including libstdc++/libgcc archives, we still need to specify
70 # static linking for them in order to prevent the executable from having a 70 # static linking for them in order to prevent the executable from having a
71 # dynamic dependency on them. 71 # dynamic dependency on them.
72 configs += [ ":static_config" ] 72 configs += [ ":static_config" ]
73 } 73 }
74 } 74 }
75 75
76 config("shared_library_config") { 76 config("shared_library_config") {
77 configs = [ ":ldconfig" ] 77 configs = [ ":ldconfig" ]
78 if (current_cpu == "arm") { 78 if (!is_clang && current_cpu == "arm") {
79 configs += [ ":static_config" ] 79 configs += [ ":static_config" ]
80 } 80 }
81 } 81 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698