[compiler-rt] 7fcc44b - [compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 15 09:06:44 PST 2022


Author: Alexandre Ganea
Date: 2022-01-15T12:06:38-05:00
New Revision: 7fcc44bca4b8d3326982692b30d8b6ea8a91db56

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

LOG: [compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2

See report in https://reviews.llvm.org/D116872#3245667

Added: 
    

Modified: 
    compiler-rt/lib/asan/CMakeLists.txt
    compiler-rt/lib/interception/CMakeLists.txt
    compiler-rt/lib/ubsan/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index f2d99be6db2ec..c669e2bec187a 100644
--- a/compiler-rt/lib/asan/CMakeLists.txt
+++ b/compiler-rt/lib/asan/CMakeLists.txt
@@ -91,7 +91,9 @@ set(ASAN_COMMON_DEFINITIONS ${COMPILER_RT_ASAN_SHADOW_SCALE_DEFINITION})
 append_rtti_flag(OFF ASAN_CFLAGS)
 
 # Silence warnings in system headers with MSVC.
-append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" ASAN_CFLAGS)
+if(NOT CLANG_CL)
+  append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" ASAN_CFLAGS)
+endif()
 
 # Too many existing bugs, needs cleanup.
 append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format ASAN_CFLAGS)

diff  --git a/compiler-rt/lib/interception/CMakeLists.txt b/compiler-rt/lib/interception/CMakeLists.txt
index e7885c6cac8ae..3242cf50e35f8 100644
--- a/compiler-rt/lib/interception/CMakeLists.txt
+++ b/compiler-rt/lib/interception/CMakeLists.txt
@@ -20,7 +20,9 @@ set(INTERCEPTION_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_rtti_flag(OFF INTERCEPTION_CFLAGS)
 
 # Silence warnings in system headers with MSVC.
-append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" INTERCEPTION_CFLAGS)
+if(NOT CLANG_CL)
+  append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" INTERCEPTION_CFLAGS)
+endif()
 
 add_compiler_rt_object_libraries(RTInterception
     OS ${SANITIZER_COMMON_SUPPORTED_OS}

diff  --git a/compiler-rt/lib/ubsan/CMakeLists.txt b/compiler-rt/lib/ubsan/CMakeLists.txt
index 2eea397a571ab..acf1d73846232 100644
--- a/compiler-rt/lib/ubsan/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan/CMakeLists.txt
@@ -56,7 +56,9 @@ append_rtti_flag(ON UBSAN_CXXFLAGS)
 append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
 
 # Silence warnings in system headers with MSVC.
-append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" UBSAN_CXXFLAGS)
+if(NOT CLANG_CL)
+  append_list_if(COMPILER_RT_HAS_EXTERNAL_FLAG "/experimental:external /external:W0 /external:anglebrackets" UBSAN_CXXFLAGS)
+endif()
 
 set(UBSAN_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 


        


More information about the llvm-commits mailing list