https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b379743ccb0580d56e05a…
commit b379743ccb0580d56e05a5dbd48f44ff3a791c8f
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Fri Apr 9 10:32:12 2021 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Fri Apr 9 10:32:12 2021 +0200
[CMAKE] Use find_program to get the location of LD when building with clang
---
toolchain-clang.cmake | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/toolchain-clang.cmake b/toolchain-clang.cmake
index 2facc441683..e181bf0baf4 100644
--- a/toolchain-clang.cmake
+++ b/toolchain-clang.cmake
@@ -55,11 +55,8 @@ set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C
Libraries")
set(CMAKE_CXX_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C++
Libraries")
-if (DEFINED CMAKE_SYSROOT)
- set(LD_EXECUTABLE ${CMAKE_SYSROOT}/bin/${GCC_TOOLCHAIN_PREFIX}ld)
-else()
- set(LD_EXECUTABLE ${GCC_TOOLCHAIN_PREFIX}ld)
-endif()
+find_program (LD_EXECUTABLE ${GCC_TOOLCHAIN_PREFIX}ld)
+message(STATUS "Using linker ${LD_EXECUTABLE}")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nostdlib
-Wl,--enable-auto-image-base,--disable-auto-import -fuse-ld=${LD_EXECUTABLE}")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-nostdlib
-Wl,--enable-auto-image-base,--disable-auto-import -fuse-ld=${LD_EXECUTABLE}")