Clean up some GN toolchain args, especially NaCl.
Uses forward_variables_from for the gcc_toolchain and nacl_toolchain templates when applicable. Add the ability to clear the sanitizer flags and use this for nacl. Review URL: https://codereview.chromium.org/1338803004 Cr-Original-Commit-Position: refs/heads/master@{#348522} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f5d97233985fac498ada3def2c2b3f4e8bbaafd9
This commit is contained in:
Родитель
2a3d4ed349
Коммит
d0ebcc4bcf
|
@ -22,7 +22,8 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
|||
# - toolchain_os (What "current_os" should be set to when invoking a
|
||||
# build using this toolchain.)
|
||||
#
|
||||
# Optional parameters:
|
||||
# Optional parameters that control the tools:
|
||||
#
|
||||
# - libs_section_prefix
|
||||
# - libs_section_postfix
|
||||
# The contents of these strings, if specified, will be placed around
|
||||
|
@ -45,12 +46,6 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
|||
# for an executable, rather than using no extension; targets will
|
||||
# still be able to override the extension using the output_extension
|
||||
# variable.
|
||||
# - is_clang
|
||||
# Whether to use clang instead of gcc.
|
||||
# - is_component_build
|
||||
# Whether to forcibly enable or disable component builds for this
|
||||
# toolchain; if not specified, the toolchain will inherit the
|
||||
# default setting.
|
||||
# - rebuild_define
|
||||
# The contents of this string, if specified, will be passed as a #define
|
||||
# to the toolchain. It can be used to force recompiles whenever a
|
||||
|
@ -63,6 +58,18 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
|||
# Location of the strip executable. When specified, strip will be run on
|
||||
# all shared libraries and executables as they are built. The pre-stripped
|
||||
# artifacts will be put in lib.stripped/ and exe.stripped/.
|
||||
#
|
||||
# Optional build argument contols.
|
||||
#
|
||||
# - clear_sanitizers
|
||||
# When set to true, is_asan, is_msan, etc.will all be set to false. Often
|
||||
# secondary toolchains do not want to run with sanitizers.
|
||||
# - is_clang
|
||||
# Whether to use clang instead of gcc.
|
||||
# - is_component_build
|
||||
# Whether to forcibly enable or disable component builds for this
|
||||
# toolchain; if not specified, the toolchain will inherit the
|
||||
# default setting.
|
||||
template("gcc_toolchain") {
|
||||
toolchain(target_name) {
|
||||
assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
|
||||
|
@ -309,16 +316,22 @@ template("gcc_toolchain") {
|
|||
target_os = target_os
|
||||
target_cpu = target_cpu
|
||||
|
||||
if (defined(invoker.is_clang)) {
|
||||
is_clang = invoker.is_clang
|
||||
}
|
||||
if (defined(invoker.is_component_build)) {
|
||||
is_component_build = invoker.is_component_build
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"is_clang",
|
||||
"is_component_build",
|
||||
])
|
||||
|
||||
if (defined(invoker.clear_sanitizers) && invoker.clear_sanitizers) {
|
||||
is_asan = false
|
||||
is_cfi = false
|
||||
is_lsan = false
|
||||
is_msan = false
|
||||
is_syzyasan = false
|
||||
is_tsan = false
|
||||
}
|
||||
}
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps = invoker.deps
|
||||
}
|
||||
forward_variables_from(invoker, [ "deps" ])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,36 +22,32 @@ template("nacl_toolchain") {
|
|||
assert(defined(invoker.ld), "nacl_toolchain() must specify a \"ld\" value")
|
||||
assert(defined(invoker.toolchain_cpu),
|
||||
"nacl_toolchain() must specify a \"toolchain_cpu\"")
|
||||
|
||||
toolchain_os = "nacl"
|
||||
if (defined(invoker.is_clang)) {
|
||||
is_clang = invoker.is_clang
|
||||
}
|
||||
if (defined(invoker.executable_extension)) {
|
||||
executable_extension = invoker.executable_extension
|
||||
} else {
|
||||
executable_extension = ".nexe"
|
||||
}
|
||||
toolchain_cpu = invoker.toolchain_cpu
|
||||
|
||||
cc = invoker.cc
|
||||
cxx = invoker.cxx
|
||||
ar = invoker.ar
|
||||
ld = invoker.ld
|
||||
if (defined(invoker.postlink)) {
|
||||
postlink = invoker.postlink
|
||||
}
|
||||
if (defined(invoker.link_outputs)) {
|
||||
link_outputs = invoker.link_outputs
|
||||
}
|
||||
|
||||
# We do not wish to suport shared builds with the NaCl toolchains.
|
||||
is_component_build = false
|
||||
|
||||
gcc_toolchain(target_name) {
|
||||
rebuild_define = "NACL_TC_REV=" + invoker.toolchain_revision
|
||||
if (defined(invoker.deps)) {
|
||||
deps = invoker.deps
|
||||
toolchain_os = "nacl"
|
||||
|
||||
if (defined(invoker.executable_extension)) {
|
||||
executable_extension = invoker.executable_extension
|
||||
} else {
|
||||
executable_extension = ".nexe"
|
||||
}
|
||||
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"ar",
|
||||
"cc",
|
||||
"cxx",
|
||||
"deps",
|
||||
"is_clang",
|
||||
"ld",
|
||||
"link_outputs",
|
||||
"postlink",
|
||||
"toolchain_cpu",
|
||||
])
|
||||
|
||||
# We do not suport component builds or sanitizers with the NaCl toolchains.
|
||||
is_component_build = false
|
||||
clear_sanitizers = true
|
||||
|
||||
rebuild_define = "NACL_TC_REV=" + invoker.toolchain_revision
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче