-
Notifications
You must be signed in to change notification settings - Fork 97
Begin adding support for using swiftc as a linker driver #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci test |
args += ["-compatibility_version", compatibilityVersion] | ||
switch scope.evaluate(BuiltinMacros.LINKER_DRIVER) { | ||
case .clang: | ||
args += ["-compatibility_version", compatibilityVersion] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to prefer the driver option at all vs just using Xlinker? Does -compatibility_version
at the clang level actually do anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have any behavior I know of but I'd prefer to use driver options whenever possible for maximum compatibility
3729cde
to
4506efc
Compare
@swift-ci test Linux |
4506efc
to
9022e09
Compare
@swift-ci test |
9022e09
to
8aa2101
Compare
@swift-ci test |
8aa2101
to
7354e45
Compare
@swift-ci test |
7354e45
to
f48504d
Compare
@swift-ci test |
f48504d
to
647b134
Compare
@swift-ci test linux |
647b134
to
14f6908
Compare
@swift-ci test linux |
14f6908
to
64337e3
Compare
@swift-ci test linux |
64337e3
to
eed2eb1
Compare
@swift-ci test linux |
@swift-ci test macOS |
@swift-ci test windows |
eed2eb1
to
3a36033
Compare
@swift-ci test |
@swift-ci test Windows |
3a36033
to
c1ed45a
Compare
@swift-ci test |
c1ed45a
to
54ef5be
Compare
@swift-ci test Windows |
1 similar comment
@swift-ci test Windows |
@swift-ci test Windows |
@swift-ci test |
54ef5be
to
6473758
Compare
@swift-ci test Windows |
6473758
to
71c9bc5
Compare
@swift-ci test Windows |
71c9bc5
to
8c23c59
Compare
@swift-ci test Windows |
8c23c59
to
52923db
Compare
@swift-ci test |
This is controlled via the LINKER_DRIVER setting
52923db
to
47e61e8
Compare
@swift-ci test |
@@ -234,7 +234,13 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec | |||
public static let identifier = "com.apple.pbx.linkers.ld" | |||
|
|||
public override func computeExecutablePath(_ cbc: CommandBuildContext) -> String { | |||
return cbc.producer.hostOperatingSystem.imageFormat.executableName(basename: "clang") | |||
// TODO: We should also provide an "auto" option which chooses based on the source files in the target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do remember there being some subtle differences between linker drivers for C sources as well, so "auto" could result in surprises.
This is controlled via the LINKER_DRIVER setting
This is enough to at least link a basic CLI tool on macOS. It needs some more work and tests still