[compiler-rt] 8182dba - [compiler-rt][builtins] Fix CMake builtin target flag

Tobias Hieta via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 23 01:23:22 PST 2022


Author: Tobias Hieta
Date: 2022-02-23T10:23:17+01:00
New Revision: 8182dba0c2981690dda3cb8be6e4ec085bf9b2a1

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

LOG: [compiler-rt][builtins] Fix CMake builtin target flag

clang-cl doesn't support -target <target>, instead it only supports
--target=<target> so building a RUNTIME configuration for clang-cl
ended up in never building builtins. Which in turn lead to clang-cl
not being able to find the runtime libraries because we depend
on the compiler_rt.builtins.lib being in the runtime dir for the
Driver to add it as a candidate.

I don't think this should have any downsides since most the code
these days are using --target=<target> instead of the old syntax.

Reviewed By: mstorsjo

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

Added: 
    

Modified: 
    compiler-rt/cmake/Modules/BuiltinTests.cmake

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/Modules/BuiltinTests.cmake b/compiler-rt/cmake/Modules/BuiltinTests.cmake
index 904904d545a5b..7d71ca3f71efd 100644
--- a/compiler-rt/cmake/Modules/BuiltinTests.cmake
+++ b/compiler-rt/cmake/Modules/BuiltinTests.cmake
@@ -46,7 +46,7 @@ function(try_compile_only output)
 
   set(TRY_COMPILE_FLAGS "${ARG_FLAGS}")
   if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
-    list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}")
+    list(APPEND TRY_COMPILE_FLAGS "--target=${CMAKE_C_COMPILER_TARGET}")
   endif()
 
   string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}")


        


More information about the llvm-commits mailing list