-
Notifications
You must be signed in to change notification settings - Fork 1.4k
linkerSettings appears to work differently on macOS than linux #6257
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
Comments
That build seems to be using |
Alright, should we simply document this somewhere or is a change needed? It is convenient to be able to pass Swift compiler flags like this that affect linking, but it can't be done for this one build config of XCode. |
I wonder if we ultimately need a way to differentiate? For now, I'd suggest just checking |
Unsure what you mean, have a way to pass different flags if it's the XCode build config of SPM?
Oh, went one better and only pass it for the linux target now, that pull was merged. |
I think it would be on the axis of whether the linker driver is clang or swiftc, maybe something like |
Interesting, that might work. |
Description
I was just trying to pass
-no-toolchain-stdlib-rpath
to the build when installing sourcekit-lsp in swiftlang/sourcekit-lsp#715 and Alex ran a full toolchain build to make sure it worked well. Strangely, it passed on linux and Windows builds sourcekit-lsp using CMake, not SPM, so it only failed on macOS, because it appears to incorrectly pass this Swift linker flag to clang:I'm not sure why it does this on macOS only, as the SPM source clearly shows the linker command-line running through the Swift compiler.
Expected behavior
No differences in linkerSettings behavior on different platforms
Actual behavior
The given example works on linux, but not macOS.
Steps to reproduce
Add a linkerSettings with a Swift flag like
-no-toolchain-stdlib-rpath
and build on macOS.Swift Package Manager version/commit hash
1750a26
Swift & OS version (output of
swift --version && uname -a
)Taken from the linked macOS CI run as I don't build on macOS:
Swift compiler commit - 642386290e84e9eeeed8ba70f07d5c3628be728a
The text was updated successfully, but these errors were encountered: