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

Unified Diff: src/trusted/service_runtime/linux/BUILD.gn

Issue 2085683004: Update the nacl_bootstrap GN code to work in ChromeOS chroot builds. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: fix variable declaration Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/linux/BUILD.gn
diff --git a/src/trusted/service_runtime/linux/BUILD.gn b/src/trusted/service_runtime/linux/BUILD.gn
index 37cc61fa1059ed8af6cc12fc2c86235f8eed72cd..ce2923be8d8313527028d442c62ccca664774dd2 100644
--- a/src/trusted/service_runtime/linux/BUILD.gn
+++ b/src/trusted/service_runtime/linux/BUILD.gn
@@ -15,8 +15,20 @@
# Gold for the link, so use_gold=true is a false statement and might
# cause other problems.
-here = get_label_info(".", "dir")
-bootstrap_toolchain = here + "/toolchain:nacl_bootstrap_" + target_cpu
+# TODO(dpranke): There needs to be a better way to determine if
+# we are using the custom CrOS toolchains, but for now we check is_clang,
+# which is the same way we check in //build/config/BUILDCONFIG.gn.
+_is_cros_target_toolchain = is_chromeos && !is_clang
+if (target_os == "chromeos") {
+ import("//build/toolchain/cros_toolchain.gni")
+}
+
+if (_is_cros_target_toolchain) {
+ bootstrap_toolchain = "//build/toolchain/cros:nacl_bootstrap"
+} else {
+ here = get_label_info(".", "dir")
+ bootstrap_toolchain = here + "/toolchain:nacl_bootstrap_" + target_cpu
+}
if (current_toolchain == bootstrap_toolchain) {
bootstrap_lib_path = "$target_out_dir/libnacl_bootstrap_lib.a"
@@ -42,7 +54,9 @@ if (current_toolchain == bootstrap_toolchain) {
linker_emulation = "elf32ltsmip"
}
- if (is_android) {
+ if (_is_cros_target_toolchain) {
+ compiler = cros_target_cxx
+ } else if (is_android) {
compiler = "g++"
} else if (current_cpu == "arm") {
compiler = "arm-linux-gnueabihf-g++"
@@ -50,11 +64,6 @@ if (current_toolchain == bootstrap_toolchain) {
compiler = "g++"
}
- if (target_os == "chromeos" && defined(cros_target_cxx) &&
- cros_target_cxx != "") {
- compiler = cros_target_cxx
- }
-
static_library("nacl_bootstrap_lib") {
# This code has very specific requirements related to its static
# linking and minimal libc use. It cannot support the normal variety
« 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