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

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

Issue 1450453002: GN: Refactor PNaCl toolchain definitions to use a template (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: build/toolchain/nacl/BUILD.gn
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn
index 23f1027fbb4acc8290661bd946291987b2fb3a6a..a159118c0a028a42cdfa41f416cfeaf3890bc3b5 100644
--- a/build/toolchain/nacl/BUILD.gn
+++ b/build/toolchain/nacl/BUILD.gn
@@ -22,23 +22,39 @@ revisions = exec_script("//native_client/build/get_toolchain_revision.py",
"trim list lines")
nacl_x86_glibc_rev = revisions[0]
nacl_arm_glibc_rev = revisions[1]
-pnacl_newlib_rev = revisions[2]
-nacl_toolchain("newlib_pnacl") {
- toolchain_package = "pnacl_newlib"
- toolchain_revision = pnacl_newlib_rev
- toolchain_cpu = "pnacl"
- toolprefix =
- rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/pnacl-",
- root_build_dir)
+# TODO(mcgrathr): Uncomment this when
+# https://code.google.com/p/chromium/issues/detail?id=555724 is fixed.
+#pnacl_newlib_rev = revisions[2]
- executable_extension = ".pexe"
+template("pnacl_toolchain") {
+ assert(defined(invoker.strip), "Must define strip")
+ assert(defined(invoker.executable_extension),
+ "Must define executable_extension")
+
+ # TODO(mcgrathr): See above.
+ pnacl_newlib_rev = revisions[2]
+
+ nacl_toolchain(target_name) {
+ toolchain_package = "pnacl_newlib"
+ toolchain_revision = pnacl_newlib_rev
+ toolchain_cpu = "pnacl"
+ toolprefix =
+ rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/pnacl-",
+ root_build_dir)
+
+ is_clang = true
+ cc = toolprefix + "clang"
+ cxx = toolprefix + "clang++"
+ ar = toolprefix + "ar"
+ ld = cxx
+ strip = toolprefix + invoker.strip
+ executable_extension = invoker.executable_extension
+ }
+}
- is_clang = true
- cc = toolprefix + "clang"
- cxx = toolprefix + "clang++"
- ar = toolprefix + "ar"
- ld = cxx
+pnacl_toolchain("newlib_pnacl") {
+ executable_extension = ".pexe"
# The pnacl-finalize tool turns a .pexe.debug file into a .pexe file.
# It's very similar in purpose to the traditional "strip" utility: it
@@ -47,23 +63,13 @@ nacl_toolchain("newlib_pnacl") {
# you ever actually want to use other than pnacl-finalize, so just
# make pnacl-finalize the strip tool rather than adding an additional
# step like "postlink" to run pnacl-finalize.
- strip = toolprefix + "finalize"
+ strip = "finalize"
}
-nacl_toolchain("newlib_pnacl_nonsfi") {
- toolchain_package = "pnacl_newlib"
- toolchain_revision = pnacl_newlib_rev
- toolchain_cpu = "pnacl"
- toolprefix =
- rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/pnacl-",
- root_build_dir)
-
- is_clang = true
- cc = toolprefix + "clang"
- cxx = toolprefix + "clang++"
- ar = toolprefix + "ar"
- ld = cxx
+pnacl_toolchain("newlib_pnacl_nonsfi") {
executable_extension = ""
+
+ strip = "strip"
}
template("nacl_glibc_toolchain") {
@@ -114,6 +120,9 @@ template("nacl_clang_toolchain") {
toolchain_cpu = target_name
assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple")
+ # TODO(mcgrathr): See above.
+ pnacl_newlib_rev = revisions[2]
+
toolchain_package = "pnacl_newlib"
toolchain_revision = pnacl_newlib_rev
toolprefix = rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/" +
@@ -133,6 +142,9 @@ template("nacl_irt_toolchain") {
toolchain_cpu = target_name
assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple")
+ # TODO(mcgrathr): See above.
+ pnacl_newlib_rev = revisions[2]
+
toolchain_package = "pnacl_newlib"
toolchain_revision = pnacl_newlib_rev
toolprefix = rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/" +
« 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