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

Unified Diff: build/toolchain/cros/BUILD.gn

Issue 2188633004: Add a way for CrOS toolchains to set custom flags for the nacl bootstrap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge in changes to toolchain_args Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/toolchain/cros_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/cros/BUILD.gn
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn
index 56a408bfd35e1d790b8ac14b736eac7fb43849bf..bf139dc12da8192f02bd1e7c83e18c3a77f795a5 100644
--- a/build/toolchain/cros/BUILD.gn
+++ b/build/toolchain/cros/BUILD.gn
@@ -7,58 +7,65 @@ import("//build/config/sysroot.gni")
import("//build/toolchain/gcc_toolchain.gni")
import("//build/toolchain/cros_toolchain.gni")
-template("cros_target_toolchain") {
- gcc_toolchain(target_name) {
- assert(defined(invoker.toolchain_args))
-
- # These are args for the template.
- ar = cros_target_ar
- cc = cros_target_cc
- cxx = cros_target_cxx
- ld = cxx
- if (cros_target_ld != "") {
- ld = cros_target_ld
- }
- if (cros_target_nm != "") {
- nm = cros_target_nm
- }
- if (cros_target_readelf != "") {
- readelf = cros_target_readelf
- }
- extra_cflags = cros_target_extra_cflags
- extra_cppflags = cros_target_extra_cppflags
- extra_cxxflags = cros_target_extra_cxxflags
- extra_ldflags = cros_target_extra_ldflags
-
- toolchain_args = {
- forward_variables_from(invoker.toolchain_args, "*")
-
- cc_wrapper = ""
-
- # This will override the default computation for is_clang in the
- # secondary toolchain with the value of is_clang in the current toolchain
- # (the current toolchain will always be the default toolchain here).
- is_clang = is_clang
- current_cpu = target_cpu
- current_os = "chromeos"
- use_debug_fission = use_debug_fission
- use_sysroot = use_sysroot
- }
+# This is the normal toolchain for most targets.
+gcc_toolchain("target") {
+ ar = cros_target_ar
+ cc = cros_target_cc
+ cxx = cros_target_cxx
+ ld = cxx
+ if (cros_target_ld != "") {
+ ld = cros_target_ld
}
-}
+ if (cros_target_nm != "") {
+ nm = cros_target_nm
+ }
+ if (cros_target_readelf != "") {
+ readelf = cros_target_readelf
+ }
+ extra_cflags = cros_target_extra_cflags
+ extra_cppflags = cros_target_extra_cppflags
+ extra_cxxflags = cros_target_extra_cxxflags
+ extra_ldflags = cros_target_extra_ldflags
-# This is the normal toolchain for most targets.
-cros_target_toolchain("target") {
toolchain_args = {
+ cc_wrapper = ""
+ current_cpu = target_cpu
+ current_os = "chromeos"
+ is_clang = is_clang
+ use_debug_fission = use_debug_fission
+ use_gold = use_gold
+ use_sysroot = use_sysroot
}
}
# This is a special toolchain needed just for the nacl_bootstrap target in
# //native_client/src/trusted/service_runtime/linux. It is identical
# to ":target" except that it forces use_debug_fission, use_gold, and
-# use_sysroot off.
-cros_target_toolchain("nacl_bootstrap") {
+# use_sysroot off, and allows the user to set different sets of extra flags.
+gcc_toolchain("nacl_bootstrap") {
+ ar = cros_target_ar
+ cc = cros_target_cc
+ cxx = cros_target_cxx
+ ld = cxx
+ if (cros_target_ld != "") {
+ ld = cros_target_ld
+ }
+ if (cros_target_nm != "") {
+ nm = cros_target_nm
+ }
+ if (cros_target_readelf != "") {
+ readelf = cros_target_readelf
+ }
+ extra_cflags = cros_nacl_bootstrap_extra_cflags
+ extra_cppflags = cros_nacl_bootstrap_extra_cppflags
+ extra_cxxflags = cros_nacl_bootstrap_extra_cxxflags
+ extra_ldflags = cros_nacl_bootstrap_extra_ldflags
+
toolchain_args = {
+ cc_wrapper = ""
+ current_cpu = target_cpu
+ current_os = "chromeos"
+ is_clang = is_clang
use_debug_fission = false
use_gold = false
use_sysroot = false
« no previous file with comments | « no previous file | build/toolchain/cros_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698