| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium 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/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/toolchain/ccache.gni") | 7 import("//build/toolchain/ccache.gni") |
| 8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 is_tsan = false | 418 is_tsan = false |
| 419 is_ubsan = false | 419 is_ubsan = false |
| 420 is_ubsan_vptr = false | 420 is_ubsan_vptr = false |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 forward_variables_from(invoker, [ "deps" ]) | 424 forward_variables_from(invoker, [ "deps" ]) |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 declare_args() { |
| 429 clang_dir = "//third_party/llvm-build/Release+Asserts" |
| 430 } |
| 431 |
| 428 # This is a shorthand for gcc_toolchain instances based on the | 432 # This is a shorthand for gcc_toolchain instances based on the |
| 429 # Chromium-built version of Clang. Only the toolchain_cpu and | 433 # Chromium-built version of Clang. Only the toolchain_cpu and |
| 430 # toolchain_os variables need to be specified by the invoker, and | 434 # toolchain_os variables need to be specified by the invoker, and |
| 431 # optionally toolprefix if it's a cross-compile case. Note that for | 435 # optionally toolprefix if it's a cross-compile case. Note that for |
| 432 # a cross-compile case this toolchain requires a config to pass the | 436 # a cross-compile case this toolchain requires a config to pass the |
| 433 # appropriate -target option, or else it will actually just be doing | 437 # appropriate -target option, or else it will actually just be doing |
| 434 # a native compile. The invoker can optionally override use_gold too. | 438 # a native compile. The invoker can optionally override use_gold too. |
| 435 template("clang_toolchain") { | 439 template("clang_toolchain") { |
| 436 assert(defined(invoker.toolchain_cpu), | 440 assert(defined(invoker.toolchain_cpu), |
| 437 "clang_toolchain() must specify a \"toolchain_cpu\"") | 441 "clang_toolchain() must specify a \"toolchain_cpu\"") |
| 438 assert(defined(invoker.toolchain_os), | 442 assert(defined(invoker.toolchain_os), |
| 439 "clang_toolchain() must specify a \"toolchain_os\"") | 443 "clang_toolchain() must specify a \"toolchain_os\"") |
| 440 if (defined(invoker.toolprefix)) { | 444 if (defined(invoker.toolprefix)) { |
| 441 toolprefix = invoker.toolprefix | 445 toolprefix = invoker.toolprefix |
| 442 } else { | 446 } else { |
| 443 toolprefix = "" | 447 toolprefix = "" |
| 444 } | 448 } |
| 445 | 449 |
| 446 gcc_toolchain(target_name) { | 450 gcc_toolchain(target_name) { |
| 447 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 451 prefix = rebase_path(clang_dir + "/bin", root_build_dir) |
| 448 root_build_dir) | |
| 449 cc = "$prefix/clang" | 452 cc = "$prefix/clang" |
| 450 cxx = "$prefix/clang++" | 453 cxx = "$prefix/clang++" |
| 451 ld = cxx | 454 ld = cxx |
| 452 is_clang = true | 455 is_clang = true |
| 453 | 456 |
| 454 readelf = "${toolprefix}readelf" | 457 readelf = "${toolprefix}readelf" |
| 455 ar = "${toolprefix}ar" | 458 ar = "${toolprefix}ar" |
| 456 nm = "${toolprefix}nm" | 459 nm = "${toolprefix}nm" |
| 457 | 460 |
| 458 forward_variables_from(invoker, | 461 forward_variables_from(invoker, |
| 459 [ | 462 [ |
| 460 "toolchain_cpu", | 463 "toolchain_cpu", |
| 461 "toolchain_os", | 464 "toolchain_os", |
| 462 "use_gold", | 465 "use_gold", |
| 463 ]) | 466 ]) |
| 464 } | 467 } |
| 465 } | 468 } |
| OLD | NEW |