Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client 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/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
| 6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
| 7 import("//build/toolchain/nacl_toolchain.gni") | 7 import("//build/toolchain/nacl_toolchain.gni") |
| 8 | 8 |
| 9 # Add the toolchain revision as a preprocessor define so that sources are | 9 # Add the toolchain revision as a preprocessor define so that sources are |
| 10 # rebuilt when a toolchain is updated. | 10 # rebuilt when a toolchain is updated. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 root_build_dir) | 67 root_build_dir) |
| 68 | 68 |
| 69 cc = compiler_scriptprefix + toolprefix + "clang" + scriptsuffix | 69 cc = compiler_scriptprefix + toolprefix + "clang" + scriptsuffix |
| 70 cxx = compiler_scriptprefix + toolprefix + "clang++" + scriptsuffix | 70 cxx = compiler_scriptprefix + toolprefix + "clang++" + scriptsuffix |
| 71 ar = scriptprefix + toolprefix + "ar" + scriptsuffix | 71 ar = scriptprefix + toolprefix + "ar" + scriptsuffix |
| 72 readelf = scriptprefix + toolprefix + "readelf" + scriptsuffix | 72 readelf = scriptprefix + toolprefix + "readelf" + scriptsuffix |
| 73 nm = scriptprefix + toolprefix + "nm" + scriptsuffix | 73 nm = scriptprefix + toolprefix + "nm" + scriptsuffix |
| 74 if (defined(invoker.strip)) { | 74 if (defined(invoker.strip)) { |
| 75 strip = scriptprefix + toolprefix + invoker.strip + scriptsuffix | 75 strip = scriptprefix + toolprefix + invoker.strip + scriptsuffix |
| 76 } | 76 } |
| 77 forward_variables_from(invoker, | |
| 78 [ | |
| 79 "executable_extension", | |
| 80 "is_clang_analysis_supported", | |
| 81 ]) | |
| 77 | 82 |
| 78 # Note this is not the usual "ld = cxx" because "ld" uses are | 83 # Note this is not the usual "ld = cxx" because "ld" uses are |
| 79 # never run via goma, so this needs scriptprefix. | 84 # never run via goma, so this needs scriptprefix. |
| 80 ld = scriptprefix + toolprefix + "clang++" + scriptsuffix | 85 ld = scriptprefix + toolprefix + "clang++" + scriptsuffix |
| 81 | 86 |
| 82 executable_extension = invoker.executable_extension | |
| 83 | |
| 84 toolchain_args = { | 87 toolchain_args = { |
| 85 is_clang = true | 88 is_clang = true |
| 86 current_cpu = "pnacl" | 89 current_cpu = "pnacl" |
| 87 } | 90 } |
| 88 } | 91 } |
| 89 } | 92 } |
| 90 | 93 |
| 91 pnacl_toolchain("newlib_pnacl") { | 94 pnacl_toolchain("newlib_pnacl") { |
| 92 executable_extension = ".pexe" | 95 executable_extension = ".pexe" |
| 93 | 96 |
| 94 # The pnacl-finalize tool turns a .pexe.debug file into a .pexe file. | 97 # The pnacl-finalize tool turns a .pexe.debug file into a .pexe file. |
| 95 # It's very similar in purpose to the traditional "strip" utility: it | 98 # It's very similar in purpose to the traditional "strip" utility: it |
| 96 # turns what comes out of the linker into what you actually want to | 99 # turns what comes out of the linker into what you actually want to |
| 97 # distribute and run. PNaCl doesn't have a "strip"-like utility that | 100 # distribute and run. PNaCl doesn't have a "strip"-like utility that |
| 98 # you ever actually want to use other than pnacl-finalize, so just | 101 # you ever actually want to use other than pnacl-finalize, so just |
| 99 # make pnacl-finalize the strip tool rather than adding an additional | 102 # make pnacl-finalize the strip tool rather than adding an additional |
| 100 # step like "postlink" to run pnacl-finalize. | 103 # step like "postlink" to run pnacl-finalize. |
| 101 strip = "finalize" | 104 strip = "finalize" |
| 102 } | 105 } |
| 103 | 106 |
| 104 pnacl_toolchain("newlib_pnacl_nonsfi") { | 107 pnacl_toolchain("newlib_pnacl_nonsfi") { |
| 105 executable_extension = "" | 108 executable_extension = "" |
| 106 strip = "strip" | 109 strip = "strip" |
| 110 | |
| 111 if (use_clang_static_analyzer) { | |
|
Wez
2017/02/03 08:05:01
nit: Why is this conditional on the analyzer being
Kevin M
2017/02/03 18:46:29
It's a dead store if analysis isn't enabled, which
Wez
2017/02/03 19:27:54
Aha - thanks for clarifying. :)
| |
| 112 is_clang_analysis_supported = false | |
| 113 } | |
| 107 } | 114 } |
| 108 | 115 |
| 109 template("nacl_glibc_toolchain") { | 116 template("nacl_glibc_toolchain") { |
| 110 toolchain_cpu = target_name | 117 toolchain_cpu = target_name |
| 111 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") | 118 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
| 112 assert(defined(invoker.toolchain_package), "Must define toolchain_package") | 119 assert(defined(invoker.toolchain_package), "Must define toolchain_package") |
| 113 assert(defined(invoker.toolchain_revision), "Must define toolchain_revision") | 120 assert(defined(invoker.toolchain_revision), "Must define toolchain_revision") |
| 114 forward_variables_from(invoker, | 121 forward_variables_from(invoker, |
| 115 [ | 122 [ |
| 116 "toolchain_package", | 123 "toolchain_package", |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 toolchain_tuple = "x86_64-nacl" | 257 toolchain_tuple = "x86_64-nacl" |
| 251 } | 258 } |
| 252 | 259 |
| 253 nacl_clang_toolchains("arm") { | 260 nacl_clang_toolchains("arm") { |
| 254 toolchain_tuple = "arm-nacl" | 261 toolchain_tuple = "arm-nacl" |
| 255 } | 262 } |
| 256 | 263 |
| 257 nacl_clang_toolchains("mipsel") { | 264 nacl_clang_toolchains("mipsel") { |
| 258 toolchain_tuple = "mipsel-nacl" | 265 toolchain_tuple = "mipsel-nacl" |
| 259 } | 266 } |
| OLD | NEW |