diff --git a/test-patches/cmakelists-unixtoolchains-lld.patch b/test-patches/cmakelists-unixtoolchains-lld.patch new file mode 100644 index 0000000..1e6ec75 --- /dev/null +++ b/test-patches/cmakelists-unixtoolchains-lld.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2eeaf61e374..640e492cc15 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -897,7 +897,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND NOT CMAKE_HOST_SYSTEM_NAME STREQ + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(SWIFT_USE_LINKER_default "") + else() +- set(SWIFT_USE_LINKER_default "gold") ++ set(SWIFT_USE_LINKER_default "lld") + endif() + set(SWIFT_USE_LINKER ${SWIFT_USE_LINKER_default} CACHE STRING + "Build Swift with a non-default linker") +diff --git a/lib/Driver/UnixToolChains.cpp b/lib/Driver/UnixToolChains.cpp +index 61498c144a2..f9f540ec144 100644 +--- a/lib/Driver/UnixToolChains.cpp ++++ b/lib/Driver/UnixToolChains.cpp +@@ -125,14 +125,14 @@ std::string toolchains::GenericUnix::getDefaultLinker() const { + // section on these targets, it also generates COPY relocations for + // final executables, as such, unless specified, we default to gold + // linker. +- return "gold"; ++ return "lld"; + case llvm::Triple::x86: + case llvm::Triple::x86_64: + case llvm::Triple::ppc64: + case llvm::Triple::ppc64le: + case llvm::Triple::systemz: + // BFD linker has issues wrt relocations against protected symbols. +- return "gold"; ++ return "lld"; + default: + // Otherwise, use the default BFD linker. + return "";