Skip to content

Commit c24a39b

Browse files
[gn] Mac support for check-asan target
Differential Revision: https://reviews.llvm.org/D152591
1 parent 5e32765 commit c24a39b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

llvm/utils/gn/secondary/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ group("default") {
2222
"//libcxxabi",
2323
]
2424
}
25-
if (current_os == "linux" || current_os == "win") {
25+
if (current_os == "linux" || current_os == "win" || current_os=="mac") {
2626
deps += [ "//compiler-rt/test/asan" ]
2727
}
2828
if (current_os == "linux" || current_os == "android") {

llvm/utils/gn/secondary/compiler-rt/target.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ if (clang_enable_per_target_runtime_dir) {
3232
}
3333
} else if (current_os == "ios" || current_os == "mac") {
3434
crt_current_out_dir = "$clang_resource_dir/lib/darwin"
35+
crt_current_target_suffix = "-$crt_current_target_arch"
3536
} else if (current_os == "baremetal") {
3637
crt_current_out_dir = "$clang_resource_dir/lib/baremetal"
3738
crt_current_target_suffix = "-$crt_current_target_arch"

llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ write_cmake_config("lit_site_cfg") {
1717
"ASAN_TEST_BITS=64",
1818
"ASAN_TEST_APPLE_PLATFORM=",
1919
"ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG=",
20-
"ASAN_TEST_DYNAMIC=0",
2120
"ASAN_TEST_TARGET_ARCH=$crt_current_target_arch",
2221
"COMPILER_RT_ARM_THUMB=",
2322
"COMPILER_RT_BINARY_DIR=" + rebase_path("$root_gen_dir/compiler-rt"),
2423
"LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
2524
]
25+
if (host_os == "mac") {
26+
values += [ "ASAN_TEST_DYNAMIC=1" ]
27+
} else {
28+
values += [ "ASAN_TEST_DYNAMIC=0" ]
29+
}
2630
}
2731

2832
if (current_toolchain != host_toolchain) {
@@ -34,18 +38,23 @@ if (current_toolchain != host_toolchain) {
3438
"//compiler-rt/lib/asan:ignorelist($host_toolchain)",
3539
"//compiler-rt/lib/profile",
3640
"//compiler-rt/test:lit_common_configured",
41+
"//llvm/tools/llvm-nm($host_toolchain)",
42+
"//llvm/tools/llvm-objdump($host_toolchain)",
3743
"//llvm/tools/llvm-readobj($host_toolchain)",
44+
"//llvm/tools/llvm-size($host_toolchain)",
3845
"//llvm/tools/llvm-symbolizer($host_toolchain)",
46+
"//llvm/tools/sancov($host_toolchain)",
3947
"//llvm/utils/FileCheck($host_toolchain)",
4048
"//llvm/utils/count($host_toolchain)",
4149
"//llvm/utils/llvm-lit($host_toolchain)",
4250
"//llvm/utils/not($host_toolchain)",
51+
"//llvm/utils/split-file($host_toolchain)",
4352
]
4453
}
4554
}
4655

4756
supported_toolchains = []
48-
if (host_os == "linux") {
57+
if (host_os == "linux" || host_os == "mac") {
4958
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
5059
} else if (host_os == "win") {
5160
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x64" ]

0 commit comments

Comments
 (0)