-
Notifications
You must be signed in to change notification settings - Fork 10.5k
swiftinterface compilation does not re-serialise static library builds #77756
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
CC @egorzhdan |
Hmm, looks like this code might need to change: swift/lib/AST/ModuleDependencies.cpp Lines 502 to 508 in 8a78496
However, the Windows CI seems to be passing now, so I wonder if there is a difference between the CI and the local build config. |
I didn't encounter this during a toolchain build, but in an internal app build. So, the Windows CI build may not trigger this particular issue. I hope that anyone other than me can reproduce with the reduced test example. |
The code doesn't need to change, it is correct. The problem is that we are building the libraries as static libraries rather than dynamic libraries, which is why they are failing to link. |
When compiling the swiftmodule from the textual swift interface, ensure that we re-serialise the static or dynamic nature of the module. This is required for proper code generation where the static and dynamic linking is material to symbolic references. This also opens the possibility of optimizations on other platforms via internalisation of the symbols. Fixes: swiftlang#77756
The issue here is that we are generating a static resilient module and distributing the swiftinterface now. When the swiftinterface was being re-serialised, we would drop the static indicator resulting in the module trying to be dynamically linked when it was static. |
When compiling the swiftmodule from the textual swift interface, ensure that we re-serialise the static or dynamic nature of the module. This is required for proper code generation where the static and dynamic linking is material to symbolic references. This also opens the possibility of optimizations on other platforms via internalisation of the symbols. Fixes: swiftlang#77756
When compiling the swiftmodule from the textual swift interface, ensure that we re-serialise the static or dynamic nature of the module. This is required for proper code generation where the static and dynamic linking is material to symbolic references. This also opens the possibility of optimizations on other platforms via internalisation of the symbols. Fixes: swiftlang#77756 (cherry picked from commit b660d20)
Description
It seems that I recently started getting link errors related to
swiftCxx.lib
andswiftCxxStdlib.lib
such as:Windows (x64/arm64):
where I presume it should probably need to load instead
libswiftCxx.lib
andlibswiftCxxStdlib.lib
which actually exist in the toolchain directory, as opposed toswiftCxx.lib
andswiftCxxStdlib.lib
which don't exist there.Locally reverting #77559 (and swiftlang/swift-installer-scripts#344) seems to make this error go away.
Reproduction
On a recent toolchain build in the main branch:
Windows
Expected behavior
Successful linking, no link errors.
Environment
With a recent main-branch toolchain build on windows.
Additional information
No response
The text was updated successfully, but these errors were encountered: