Skip to content

Commit e54d507

Browse files
committed
Specify "-rtlib=compiler-rt" on Linux as required for some of Swift's numeric conversion symbols.
Resolves rdar://104134160
1 parent 3e33739 commit e54d507

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ extension GenericUnixToolchain {
291291
}
292292
}
293293

294+
// Use compiler-rt for Swift's numeric conversion symbols
295+
commandLine.appendFlag("-rtlib=compiler-rt")
296+
294297
// Run clang++ in verbose mode if "-v" is set
295298
try commandLine.appendLast(.v, from: &parsedOptions)
296299

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ final class SwiftDriverTests: XCTestCase {
19931993
XCTAssertTrue(commandContainsTemporaryPath(cmd, "bar.o"))
19941994
XCTAssertTrue(commandContainsTemporaryResponsePath(cmd, "Test.autolink"))
19951995
XCTAssertEqual(linkJob.outputs[0].file, try VirtualPath(path: "libTest.so"))
1996+
XCTAssertTrue(cmd.contains(.flag("-rtlib=compiler-rt")))
19961997

19971998
XCTAssertFalse(cmd.contains(.flag("-dylib")))
19981999
XCTAssertFalse(cmd.contains(.flag("-static")))

0 commit comments

Comments
 (0)