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

Side by Side Diff: build/toolchain/cros/BUILD.gn

Issue 2003193002: Add cros_{target,host,v8_snapshot}_{nm,readelf} vars to GN build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix snapshot typos Created 4 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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/toolchain/gcc_toolchain.gni") 5 import("//build/toolchain/gcc_toolchain.gni")
6 6
7 # CrOS builds must cross-compile on a Linux host for the actual CrOS 7 # CrOS builds must cross-compile on a Linux host for the actual CrOS
8 # device target. There are many different CrOS devices so the build 8 # device target. There are many different CrOS devices so the build
9 # system provides configuration variables that permit a CrOS build to 9 # system provides configuration variables that permit a CrOS build to
10 # control the cross-compilation tool chain. However, requiring such 10 # control the cross-compilation tool chain. However, requiring such
(...skipping 22 matching lines...) Expand all
33 # cros_target_cxx = "x86_64-cros-linux-gnu-g++ -B/g/.cros_cache/chrome-sdk/tarba lls/auron_paine+7657.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/x86_64-cros-li nux-gnu/binutils-bin/2.25.51-gold" 33 # cros_target_cxx = "x86_64-cros-linux-gnu-g++ -B/g/.cros_cache/chrome-sdk/tarba lls/auron_paine+7657.0.0+target_toolchain/usr/x86_64-pc-linux-gnu/x86_64-cros-li nux-gnu/binutils-bin/2.25.51-gold"
34 # cros_target_ar = "x86_64-cros-linux-gnu-gcc-ar" 34 # cros_target_ar = "x86_64-cros-linux-gnu-gcc-ar"
35 # target_cpu = "x64" 35 # target_cpu = "x64"
36 36
37 declare_args() { 37 declare_args() {
38 # These must be specified for a board-specific build. 38 # These must be specified for a board-specific build.
39 cros_target_ar = "ar" 39 cros_target_ar = "ar"
40 cros_target_cc = "gcc" 40 cros_target_cc = "gcc"
41 cros_target_cxx = "g++" 41 cros_target_cxx = "g++"
42 cros_target_ld = "" 42 cros_target_ld = ""
43 cros_target_nm = ""
44 cros_target_readelf = ""
43 45
44 # These can be optionally set. 46 # These can be optionally set. The "_cppflags" will be applied to *both*
47 # C and C++ files; use "_cxxflags" for C++-only flags.
45 cros_target_extra_cflags = "" 48 cros_target_extra_cflags = ""
46 cros_target_extra_cppflags = "" 49 cros_target_extra_cppflags = ""
47 cros_target_extra_cxxflags = "" 50 cros_target_extra_cxxflags = ""
48 cros_target_extra_ldflags = "" 51 cros_target_extra_ldflags = ""
49 52
50 # is_clang is used instead of cros_target_is_clang 53 # is_clang is used instead of cros_target_is_clang
51 54
52 cros_host_ar = "ar" 55 cros_host_ar = "ar"
53 cros_host_cc = "gcc" 56 cros_host_cc = "gcc"
54 cros_host_cxx = "g++" 57 cros_host_cxx = "g++"
55 cros_host_ld = "" 58 cros_host_ld = ""
59 cros_host_nm = ""
60 cros_host_readelf = ""
56 cros_host_extra_cflags = "" 61 cros_host_extra_cflags = ""
57 cros_host_extra_cppflags = "" 62 cros_host_extra_cppflags = ""
58 cros_host_extra_cxxflags = "" 63 cros_host_extra_cxxflags = ""
59 cros_host_extra_ldflags = "" 64 cros_host_extra_ldflags = ""
60 cros_host_is_clang = false 65 cros_host_is_clang = false
61 66
62 cros_v8_snapshot_ar = "ar" 67 cros_v8_snapshot_ar = "ar"
63 cros_v8_snapshot_cc = "gcc" 68 cros_v8_snapshot_cc = "gcc"
64 cros_v8_snapshot_cxx = "g++" 69 cros_v8_snapshot_cxx = "g++"
65 cros_v8_snapshot_ld = "" 70 cros_v8_snapshot_ld = ""
71 cros_v8_snapshot_nm = ""
72 cros_v8_snapshot_readelf = ""
66 cros_v8_snapshot_extra_cflags = "" 73 cros_v8_snapshot_extra_cflags = ""
67 cros_v8_snapshot_extra_cppflags = "" 74 cros_v8_snapshot_extra_cppflags = ""
68 cros_v8_snapshot_extra_cxxflags = "" 75 cros_v8_snapshot_extra_cxxflags = ""
69 cros_v8_snapshot_extra_ldflags = "" 76 cros_v8_snapshot_extra_ldflags = ""
70 cros_v8_snapshot_is_clang = false 77 cros_v8_snapshot_is_clang = false
71 } 78 }
72 79
73 # TODO(dpranke): Delete this after we get rid of the reference to 80 # TODO(dpranke): Delete this after we get rid of the reference to
74 # build/toolchain/cros:clang_target in BUILDCONFIG.gn 81 # build/toolchain/cros:clang_target in BUILDCONFIG.gn
75 clang_toolchain("clang_target") { 82 clang_toolchain("clang_target") {
76 toolchain_cpu = target_cpu 83 toolchain_cpu = target_cpu
77 toolchain_os = "linux" 84 toolchain_os = "linux"
78 } 85 }
79 86
80 gcc_toolchain("target") { 87 gcc_toolchain("target") {
81 # These are args for the template. 88 # These are args for the template.
82 ar = cros_target_ar 89 ar = cros_target_ar
83 cc = cros_target_cc 90 cc = cros_target_cc
84 cxx = cros_target_cxx 91 cxx = cros_target_cxx
85 ld = cxx 92 ld = cxx
86 if (cros_target_ld != "") { 93 if (cros_target_ld != "") {
87 ld = cros_target_ld 94 ld = cros_target_ld
88 } 95 }
96 if (cros_target_nm != "") {
97 nm = cros_target_nm
98 }
99 if (cros_target_readelf != "") {
100 readelf = cros_target_readelf
101 }
89 extra_cflags = cros_target_extra_cflags 102 extra_cflags = cros_target_extra_cflags
90 extra_cppflags = cros_target_extra_cppflags 103 extra_cppflags = cros_target_extra_cppflags
91 extra_cxxflags = cros_target_extra_cxxflags 104 extra_cxxflags = cros_target_extra_cxxflags
92 extra_ldflags = cros_target_extra_ldflags 105 extra_ldflags = cros_target_extra_ldflags
93 106
94 # These are passed through as toolchain_args. 107 # These are passed through as toolchain_args.
95 cc_wrapper = "" 108 cc_wrapper = ""
96 is_clang = is_clang 109 is_clang = is_clang
97 toolchain_cpu = target_cpu 110 toolchain_cpu = target_cpu
98 toolchain_os = "linux" 111 toolchain_os = "linux"
99 } 112 }
100 113
101 gcc_toolchain("host") { 114 gcc_toolchain("host") {
102 # These are args for the template. 115 # These are args for the template.
103 ar = cros_host_ar 116 ar = cros_host_ar
104 cc = cros_host_cc 117 cc = cros_host_cc
105 cxx = cros_host_cxx 118 cxx = cros_host_cxx
106 ld = cxx 119 ld = cxx
107 if (cros_host_ld != "") { 120 if (cros_host_ld != "") {
108 ld = cros_host_ld 121 ld = cros_host_ld
109 } 122 }
123 if (cros_host_nm != "") {
124 nm = cros_host_nm
125 }
126 if (cros_host_readelf != "") {
127 readelf = cros_host_readelf
128 }
110 extra_cflags = cros_host_extra_cflags 129 extra_cflags = cros_host_extra_cflags
111 extra_cppflags = cros_host_extra_cppflags 130 extra_cppflags = cros_host_extra_cppflags
112 extra_cxxflags = cros_host_extra_cxxflags 131 extra_cxxflags = cros_host_extra_cxxflags
113 extra_ldflags = cros_host_extra_ldflags 132 extra_ldflags = cros_host_extra_ldflags
114 133
115 # These are passed through as toolchain_args. 134 # These are passed through as toolchain_args.
116 cc_wrapper = "" 135 cc_wrapper = ""
117 is_clang = cros_host_is_clang 136 is_clang = cros_host_is_clang
118 toolchain_cpu = host_cpu 137 toolchain_cpu = host_cpu
119 toolchain_os = "linux" 138 toolchain_os = "linux"
120 use_sysroot = false 139 use_sysroot = false
121 } 140 }
122 141
123 gcc_toolchain("v8_snapshot") { 142 gcc_toolchain("v8_snapshot") {
124 # These are args for the template. 143 # These are args for the template.
125 ar = cros_v8_snapshot_ar 144 ar = cros_v8_snapshot_ar
126 cc = cros_v8_snapshot_cc 145 cc = cros_v8_snapshot_cc
127 cxx = cros_v8_snapshot_cxx 146 cxx = cros_v8_snapshot_cxx
128 ld = cxx 147 ld = cxx
129 if (cros_v8_snapshot_ld != "") { 148 if (cros_v8_snapshot_ld != "") {
130 ld = cros_v8_snapshot_ld 149 ld = cros_v8_snapshot_ld
131 } 150 }
151 if (cros_v8_snapshot_nm != "") {
152 nm = cros_v8_snapshot_nm
153 }
154 if (cros_v8_snapshot_readelf != "") {
155 readelf = cros_v8_snapshot_readelf
156 }
132 extra_cflags = cros_v8_snapshot_extra_cflags 157 extra_cflags = cros_v8_snapshot_extra_cflags
133 extra_cppflags = cros_v8_snapshot_extra_cppflags 158 extra_cppflags = cros_v8_snapshot_extra_cppflags
134 extra_cxxflags = cros_v8_snapshot_extra_cxxflags 159 extra_cxxflags = cros_v8_snapshot_extra_cxxflags
135 extra_ldflags = cros_v8_snapshot_extra_ldflags 160 extra_ldflags = cros_v8_snapshot_extra_ldflags
136 161
137 # These are passed through as toolchain_args. 162 # These are passed through as toolchain_args.
138 cc_wrapper = "" 163 cc_wrapper = ""
139 is_clang = cros_v8_snapshot_is_clang 164 is_clang = cros_v8_snapshot_is_clang
140 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") { 165 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") {
141 toolchain_cpu = "x86" 166 toolchain_cpu = "x86"
142 } else { 167 } else {
143 toolchain_cpu = "x64" 168 toolchain_cpu = "x64"
144 } 169 }
145 toolchain_os = "linux" 170 toolchain_os = "linux"
146 use_sysroot = false 171 use_sysroot = false
147 } 172 }
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