Skip to content

Commit

Permalink
Remove nostart-stop-gc with lld
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Jul 22, 2023
1 parent d01fb4c commit d5220f6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
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

0 comments on commit d5220f6

Please sign in to comment.