Index: cmake/modules/CrossCompile.cmake =================================================================== --- cmake/modules/CrossCompile.cmake +++ cmake/modules/CrossCompile.cmake @@ -44,11 +44,14 @@ if (buildtype) set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}") endif() + if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING) + 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