Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down