mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 19:15:30 +00:00
[CMAKE] Find ld64 using xcrun
Given similar reasons from r276710, ld64 scrubs DYLD_* environment if called from the shim executable /usr/bin/ld. Add support for finding ld64 via xcrun. This is needed in order to get LIT to have the full path to the ld4 executable. Differential Revision: https://reviews.llvm.org/D22791 rdar://problem/24300926 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5d321c1c3e
commit
98a069fe1a
@ -548,8 +548,19 @@ find_program(GOLD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.gold ld.gold
|
||||
set(LLVM_BINUTILS_INCDIR "" CACHE PATH
|
||||
"PATH to binutils/include containing plugin-api.h for gold plugin.")
|
||||
|
||||
if(APPLE)
|
||||
find_program(LD64_EXECUTABLE NAMES ld DOC "The ld64 linker")
|
||||
if(CMAKE_HOST_APPLE AND APPLE)
|
||||
if(CMAKE_XCRUN)
|
||||
execute_process(COMMAND ${CMAKE_XCRUN} -find ld
|
||||
OUTPUT_VARIABLE LD64_EXECUTABLE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else()
|
||||
find_program(LD64_EXECUTABLE NAMES ld DOC "The ld64 linker")
|
||||
endif()
|
||||
|
||||
if(LD64_EXECUTABLE)
|
||||
set(LD64_EXECUTABLE ${LD64_EXECUTABLE} CACHE PATH "ld64 executable")
|
||||
message(STATUS "Found ld64 - ${LD64_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindOCaml)
|
||||
|
Loading…
x
Reference in New Issue
Block a user