[PATCH] D126699: [CMake] Skip linker check if the LLVM_LINKER_SKIP_TEST is set
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 6 01:05:16 PDT 2022
phosek added inline comments.
================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:308
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fuse-ld=${LLVM_USE_LINKER}")
+ check_cxx_source_compiles("int main() { return 0; }" CXX_SUPPORTS_CUSTOM_LINKER)
+ if ( NOT CXX_SUPPORTS_CUSTOM_LINKER )
----------------
I think the underlying issue is that the source we're trying to compile here implicitly includes standard libraries. I think it'd be better to use a simpler one in combination with `-nostdlib` (ideally we would check if `-nostdlib` is supported first) which should avoid the issue altogether and is more correct.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126699/new/
https://reviews.llvm.org/D126699
More information about the llvm-commits
mailing list