Skip to content

Commit d5220f6

Browse files
committed
Remove nostart-stop-gc with lld
Fixed by swiftlang/swift#67476
1 parent d01fb4c commit d5220f6

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,6 @@ extension GenericUnixToolchain {
8888
#else
8989
commandLine.appendFlag("-fuse-ld=\(linker)")
9090
#endif
91-
// Starting with lld 13, Swift stopped working with the lld
92-
// --gc-sections implementation for ELF, unless -z nostart-stop-gc is
93-
// also passed to lld:
94-
//
95-
// https://reviews.llvm.org/D96914
96-
if linker == "lld" || linker.hasSuffix("ld.lld") {
97-
commandLine.appendFlag(.Xlinker)
98-
commandLine.appendFlag("-z")
99-
commandLine.appendFlag(.Xlinker)
100-
commandLine.appendFlag("nostart-stop-gc")
101-
}
10291
}
10392

10493
// Configure the toolchain.

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,8 +2216,7 @@ final class SwiftDriverTests: XCTestCase {
22162216
let plannedJobs = try driver.planBuild().removingAutolinkExtractJobs()
22172217
let lastJob = plannedJobs.last!
22182218
XCTAssertTrue(lastJob.tool.name.contains("clang"))
2219-
XCTAssertTrue(lastJob.commandLine.contains(subsequence: [.flag("-fuse-ld=lld"),
2220-
.flag("-Xlinker"), .flag("-z"), .flag("-Xlinker"), .flag("nostart-stop-gc")]))
2219+
XCTAssertTrue(lastJob.commandLine.contains(subsequence: [.flag("-fuse-ld=lld")]))
22212220
}
22222221

22232222
do {

0 commit comments

Comments
 (0)