Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
futurejones committed Feb 29, 2024
1 parent b52f35e commit b9e7551
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test-patches/cmakelists-unixtoolchains-lld.patch
Original file line number Diff line number Diff line change
@@ -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 "";

0 comments on commit b9e7551

Please sign in to comment.