| Index: build/toolchain/gcc_toolchain.gni
|
| diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
|
| index f2045e1806a53eacaaed2d4073bf619743fe7dea..77e93c586365fbbcab5b50fbc5dd9b03427d9647 100644
|
| --- a/build/toolchain/gcc_toolchain.gni
|
| +++ b/build/toolchain/gcc_toolchain.gni
|
| @@ -49,6 +49,15 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
| # default setting.
|
| # - is_nacl_glibc
|
| # Whether NaCl code is built using Glibc instead of Newlib.
|
| +# - use_ccache
|
| +# Override the global use_ccache setting, useful to opt-out of ccache in
|
| +# a particular toolchain by setting use_ccache = false in it.
|
| +# - use_goma
|
| +# Override the global use_goma setting, useful to opt-out of goma in a
|
| +# particular toolchain by setting use_gome = false in it.
|
| +# - use_gold
|
| +# Override the global use_gold setting, useful if the particular
|
| +# toolchain has a custom link step that is not actually using Gold.
|
| template("gcc_toolchain") {
|
| toolchain(target_name) {
|
| assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
|
| @@ -159,7 +168,7 @@ template("gcc_toolchain") {
|
| tool("asm") {
|
| # For GCC we can just use the C compiler to compile assembly.
|
| depfile = "{{output}}.d"
|
| - command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
| + command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
|
| depsformat = "gcc"
|
| description = "ASM {{output}}"
|
| outputs = [
|
| @@ -273,9 +282,50 @@ template("gcc_toolchain") {
|
| "is_clang",
|
| "is_component_build",
|
| "is_nacl_glibc",
|
| + "use_gold",
|
| + "symbol_level",
|
| ])
|
| }
|
|
|
| forward_variables_from(invoker, [ "deps" ])
|
| }
|
| }
|
| +
|
| +# This is a shorthand for gcc_toolchain instances based on the
|
| +# Chromium-built version of Clang. Only the toolchain_cpu and
|
| +# toolchain_os variables need to be specified by the invoker, and
|
| +# optionally toolprefix if it's a cross-compile case. Note that for
|
| +# a cross-compile case this toolchain requires a config to pass the
|
| +# appropriate -target option, or else it will actually just be doing
|
| +# a native compile. The invoker can optionally override use_gold too.
|
| +template("clang_toolchain") {
|
| + assert(defined(invoker.toolchain_cpu),
|
| + "clang_toolchain() must specify a \"toolchain_cpu\"")
|
| + assert(defined(invoker.toolchain_os),
|
| + "clang_toolchain() must specify a \"toolchain_os\"")
|
| + if (defined(invoker.toolprefix)) {
|
| + toolprefix = invoker.toolprefix
|
| + } else {
|
| + toolprefix = ""
|
| + }
|
| +
|
| + gcc_toolchain(target_name) {
|
| + prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
|
| + root_build_dir)
|
| + cc = "$prefix/clang"
|
| + cxx = "$prefix/clang++"
|
| + ld = cxx
|
| + is_clang = true
|
| +
|
| + readelf = "${toolprefix}readelf"
|
| + ar = "${toolprefix}ar"
|
| + nm = "${toolprefix}nm"
|
| +
|
| + forward_variables_from(invoker,
|
| + [
|
| + "toolchain_cpu",
|
| + "toolchain_os",
|
| + "use_gold",
|
| + ])
|
| + }
|
| +}
|
|
|