[llvm] 4a76bd0 - [gn build] Allow use_asan=true on macOS

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 18:38:50 PDT 2021


Author: Nico Weber
Date: 2021-07-22T21:38:02-04:00
New Revision: 4a76bd0e31401a34b0db7e30266b8f386fd5492a

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

LOG: [gn build] Allow use_asan=true on macOS

Seems to work.

(I only tried macOS, not iOS, but need to allow both because
the iOS toolchain used to build compiler-rt asserts otherwise.)

Added: 
    

Modified: 
    llvm/utils/gn/build/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index e04a644e1d59..8df8be1ca070 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -314,8 +314,9 @@ config("compiler_defaults") {
   }
 
   if (use_asan) {
-    assert(is_clang && current_os == "linux",
-           "asan only supported on Linux/Clang")
+    assert(is_clang && (current_os == "ios" || current_os == "linux" ||
+                            current_os == "mac"),
+           "asan only supported on iOS/Clang, Linux/Clang, and macOS/Clang")
     cflags += [ "-fsanitize=address" ]
     ldflags += [ "-fsanitize=address" ]
   }


        


More information about the llvm-commits mailing list