[PATCH] D134206: Fix -fuse-ld to be linker flag in feature detection check
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 21:02:30 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb052eead95e0: Fix -fuse-ld to be linker flag in feature detection check (authored by GleasonK, committed by mehdi_amini).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134206/new/
https://reviews.llvm.org/D134206
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -302,15 +302,12 @@
endif()
if( LLVM_USE_LINKER )
- set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fuse-ld=${LLVM_USE_LINKER}")
+ append("-fuse-ld=${LLVM_USE_LINKER}"
+ CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
check_cxx_source_compiles("int main() { return 0; }" CXX_SUPPORTS_CUSTOM_LINKER)
if ( NOT CXX_SUPPORTS_CUSTOM_LINKER )
message(FATAL_ERROR "Host compiler does not support '-fuse-ld=${LLVM_USE_LINKER}'")
endif()
- set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
- append("-fuse-ld=${LLVM_USE_LINKER}"
- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
endif()
if( LLVM_ENABLE_PIC )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134206.461787.patch
Type: text/x-patch
Size: 966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/44458bb2/attachment.bin>
More information about the llvm-commits
mailing list