diff --git a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift index 518c6e959..8175ec2db 100644 --- a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift +++ b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift @@ -88,17 +88,6 @@ extension GenericUnixToolchain { #else commandLine.appendFlag("-fuse-ld=\(linker)") #endif - // Starting with lld 13, Swift stopped working with the lld - // --gc-sections implementation for ELF, unless -z nostart-stop-gc is - // also passed to lld: - // - // https://reviews.llvm.org/D96914 - if linker == "lld" || linker.hasSuffix("ld.lld") { - commandLine.appendFlag(.Xlinker) - commandLine.appendFlag("-z") - commandLine.appendFlag(.Xlinker) - commandLine.appendFlag("nostart-stop-gc") - } } // Configure the toolchain. diff --git a/Tests/SwiftDriverTests/SwiftDriverTests.swift b/Tests/SwiftDriverTests/SwiftDriverTests.swift index f8e8a070b..f71d8690f 100644 --- a/Tests/SwiftDriverTests/SwiftDriverTests.swift +++ b/Tests/SwiftDriverTests/SwiftDriverTests.swift @@ -2216,8 +2216,7 @@ final class SwiftDriverTests: XCTestCase { let plannedJobs = try driver.planBuild().removingAutolinkExtractJobs() let lastJob = plannedJobs.last! XCTAssertTrue(lastJob.tool.name.contains("clang")) - XCTAssertTrue(lastJob.commandLine.contains(subsequence: [.flag("-fuse-ld=lld"), - .flag("-Xlinker"), .flag("-z"), .flag("-Xlinker"), .flag("nostart-stop-gc")])) + XCTAssertTrue(lastJob.commandLine.contains(subsequence: [.flag("-fuse-ld=lld")])) } do {