diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-01-15 22:02:12 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-01-15 22:02:12 +0000 |
commit | 9cb102567ed215e79b0ff08ee8a5d5042285ad73 (patch) | |
tree | 08fd567c2b5dd693b115b542423d68151976a1a1 /llvm/utils/gn/build/toolchain/BUILD.gn | |
parent | 5f435274a48b6ff0500cd28566fde5b10500fc60 (diff) |
gn build: Add a stage2 host toolchain and make the hwasan runtime buildable on x86_64 Linux.
Differential Revision: https://reviews.llvm.org/D56711
Diffstat (limited to 'llvm/utils/gn/build/toolchain/BUILD.gn')
-rw-r--r-- | llvm/utils/gn/build/toolchain/BUILD.gn | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn index 31140ec081e..97c64ffdf2d 100644 --- a/llvm/utils/gn/build/toolchain/BUILD.gn +++ b/llvm/utils/gn/build/toolchain/BUILD.gn @@ -150,8 +150,10 @@ unix_toolchain("unix") { } } -if (android_ndk_path != "") { - unix_toolchain("stage2_android_aarch64") { +template("stage2_unix_toolchain") { + unix_toolchain(target_name) { + forward_variables_from(invoker, "*") + cc = "bin/clang" cxx = "bin/clang++" ld = cxx @@ -162,7 +164,19 @@ if (android_ndk_path != "") { "//:lld($host_toolchain)", "//:llvm-ar($host_toolchain)", ] + } +} + +stage2_unix_toolchain("stage2_unix") { + toolchain_args = { + current_os = host_os + current_cpu = host_cpu + use_lld = host_os != "mac" + } +} +if (android_ndk_path != "") { + stage2_unix_toolchain("stage2_android_aarch64") { toolchain_args = { current_os = "android" current_cpu = "arm64" |