r322977 - [cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping

Don Hinton via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 10:31:12 PST 2018


Author: dhinton
Date: Fri Jan 19 10:31:12 2018
New Revision: 322977

URL: http://llvm.org/viewvc/llvm-project?rev=322977&view=rev
Log:
[cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrapping

Summary:
When setting CMAKE_ASM_COMPILER=clang, we also need to set
CMAKE_ASM_COMPILER_ID=Clang.

This is needed because cmake won't set CMAKE_ASM_COMPILER_ID if
CMAKE_ASM_COMPILER is already set.

Without CMAKE_ASM_COMPILER_ID, cmake can't set
CMAKE_ASM_COMPILER_OPTIONS_TARGET either, which means
CMAKE_ASM_COMPILER_TARGET is ignored, causing cross compiling to fail,
i.e., `--target=${CMAKE_ASM_COMPILER_TARGET}` isn't passed.

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

Modified:
    cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=322977&r1=322976&r2=322977&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Fri Jan 19 10:31:12 2018
@@ -624,7 +624,8 @@ if (CLANG_ENABLE_BOOTSTRAP)
   set(COMPILER_OPTIONS
     -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${CXX_COMPILER}
     -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
-    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER})
+    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
+    -DCMAKE_ASM_COMPILER_ID=Clang)
 
   if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)
     add_dependencies(clang-bootstrap-deps llvm-profdata)




More information about the cfe-commits mailing list