[llvm] c24a39b - [gn] Mac support for check-asan target

Leonard Grey via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 06:59:28 PDT 2023


Author: Leonard Grey
Date: 2023-06-12T09:58:29-04:00
New Revision: c24a39b726e9116eec124654cb24937e3bfb57c7

URL: https://github.com/llvm/llvm-project/commit/c24a39b726e9116eec124654cb24937e3bfb57c7
DIFF: https://github.com/llvm/llvm-project/commit/c24a39b726e9116eec124654cb24937e3bfb57c7.diff

LOG: [gn] Mac support for check-asan target

Differential Revision: https://reviews.llvm.org/D152591

Added: 
    

Modified: 
    llvm/utils/gn/secondary/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/target.gni
    llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/BUILD.gn b/llvm/utils/gn/secondary/BUILD.gn
index 53dbeb16f81f2..261780c3cf79a 100644
--- a/llvm/utils/gn/secondary/BUILD.gn
+++ b/llvm/utils/gn/secondary/BUILD.gn
@@ -22,7 +22,7 @@ group("default") {
       "//libcxxabi",
     ]
   }
-  if (current_os == "linux" || current_os == "win") {
+  if (current_os == "linux" || current_os == "win" || current_os=="mac") {
     deps += [ "//compiler-rt/test/asan" ]
   }
   if (current_os == "linux" || current_os == "android") {

diff  --git a/llvm/utils/gn/secondary/compiler-rt/target.gni b/llvm/utils/gn/secondary/compiler-rt/target.gni
index bd8048499c0ae..cb4cf5d0e3e0e 100644
--- a/llvm/utils/gn/secondary/compiler-rt/target.gni
+++ b/llvm/utils/gn/secondary/compiler-rt/target.gni
@@ -32,6 +32,7 @@ if (clang_enable_per_target_runtime_dir) {
   }
 } else if (current_os == "ios" || current_os == "mac") {
   crt_current_out_dir = "$clang_resource_dir/lib/darwin"
+  crt_current_target_suffix = "-$crt_current_target_arch"
 } else if (current_os == "baremetal") {
   crt_current_out_dir = "$clang_resource_dir/lib/baremetal"
   crt_current_target_suffix = "-$crt_current_target_arch"

diff  --git a/llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn
index 453ee8d5e05e9..e13f92682e7fb 100644
--- a/llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/test/asan/BUILD.gn
@@ -17,12 +17,16 @@ write_cmake_config("lit_site_cfg") {
     "ASAN_TEST_BITS=64",
     "ASAN_TEST_APPLE_PLATFORM=",
     "ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG=",
-    "ASAN_TEST_DYNAMIC=0",
     "ASAN_TEST_TARGET_ARCH=$crt_current_target_arch",
     "COMPILER_RT_ARM_THUMB=",
     "COMPILER_RT_BINARY_DIR=" + rebase_path("$root_gen_dir/compiler-rt"),
     "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
   ]
+  if (host_os == "mac") {
+    values += [ "ASAN_TEST_DYNAMIC=1" ]
+  } else {
+    values += [ "ASAN_TEST_DYNAMIC=0" ]
+  }
 }
 
 if (current_toolchain != host_toolchain) {
@@ -34,18 +38,23 @@ if (current_toolchain != host_toolchain) {
       "//compiler-rt/lib/asan:ignorelist($host_toolchain)",
       "//compiler-rt/lib/profile",
       "//compiler-rt/test:lit_common_configured",
+      "//llvm/tools/llvm-nm($host_toolchain)",
+      "//llvm/tools/llvm-objdump($host_toolchain)",
       "//llvm/tools/llvm-readobj($host_toolchain)",
+      "//llvm/tools/llvm-size($host_toolchain)",
       "//llvm/tools/llvm-symbolizer($host_toolchain)",
+      "//llvm/tools/sancov($host_toolchain)",
       "//llvm/utils/FileCheck($host_toolchain)",
       "//llvm/utils/count($host_toolchain)",
       "//llvm/utils/llvm-lit($host_toolchain)",
       "//llvm/utils/not($host_toolchain)",
+      "//llvm/utils/split-file($host_toolchain)",
     ]
   }
 }
 
 supported_toolchains = []
-if (host_os == "linux") {
+if (host_os == "linux" || host_os == "mac") {
   supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
 } else if (host_os == "win") {
   supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x64" ]


        


More information about the llvm-commits mailing list