-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Don't add rpath to swift with statically linking #10381
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 please test |
Build failed |
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.
Thanks for picking this up, Keith! Can you add a test to test/Driver/linker.swift as well?
@@ -1283,10 +1284,10 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job, | |||
Arguments.push_back(context.Args.MakeArgString(LibProfile)); | |||
} | |||
|
|||
// FIXME: We probably shouldn't be adding an rpath here unless we know ahead | |||
// of time the standard library won't be copied. |
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.
Please preserve this FIXME in the new code as well—it's referencing the rest of SR-1967.
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.
Done, also moved this up into the else
above
This updates the rpath linking logic to only add the rpath that points to the swift dylibs in the case that the libraries are not statically linked into the binary.
Yep I'll look at adding that test! |
(sorry about the tests, the first push here was bogus) |
@swift-ci please test |
I've just pushed a test for this. I would love some feedback on how I'm using // SWIFT_STATIC-DAG-NOT: -rpath Instead I'm using the |
This test validates the arguments passed to the linker when statically linking the swift standard library. Currently in order to ensure that no -rpath is passed, we're using FileCheck's -implicit-check-not flag, and strictly validating the order of the arguments. The order doesn't really matter here but is required for that flag to validate that no -rpath is passed.
@swift-ci please test |
Build failed |
Looks like these failures are because I force pushed, it's still building the new sha. |
@swift-ci please test |
(it seems to still be running) |
@swift-ci please smoke test OS X Platform |
Thanks! |
This updates the rpath linking logic to only add the rpath that points
to the swift dylibs in the case that the libraries are not statically
linked into the binary.
This fix is marginally relevant to https://bugs.swift.org/browse/SR-1967, but does not solve the core problem here.