[PATCH] D39734: [cmake] Pass LLVM_USE_LINKER flag down to the CrossCompiler if set.

Don Hinton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 07:49:47 PST 2017


hintonda created this revision.
Herald added a subscriber: mgorny.

Pass LLVM_USE_LINKER flag down to the CrossCompiler if set.

Noticed this when passing:

  -DLLVM_OPTIMIZED_TABLEGEN=ON
  -DLLVM_USE_LINKER=gold

but this should be safe in all cases.


https://reviews.llvm.org/D39734

Files:
  cmake/modules/CrossCompile.cmake


Index: cmake/modules/CrossCompile.cmake
===================================================================
--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -41,11 +41,14 @@
     if (buildtype)
       set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
     endif()
+    if (LLVM_USE_LINKER)
+      set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
+    endif()
 	if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
 	  # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
 	  set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
 	endif()
-    execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags}
+    execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags} ${linker_flag}
         -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39734.121906.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171107/a53b270b/attachment.bin>


More information about the llvm-commits mailing list