-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[ModuleInterface] Save -public-autolink-library
module option
#74277
[ModuleInterface] Save -public-autolink-library
module option
#74277
Conversation
Serialize the `-public-autolink-library <name>` option to the moduleinterface file because it can affect the LINK_LIBRARY entries in a swiftmodule file. Without saving the option, the library won't be linked when a module compiled from the moduleinterface is used. This change marks the `-public-autolink-library` option as a module interface option and reads it when building a swiftmodule by module loader.
@swift-ci smoke test |
@swift-ci build toolchain |
Should we be concerned about the macOS toolchain failure? |
The macOS failure is just a networking problem, and the toolchain build itself is fine 👍 |
That failure should be intermittent then |
@swift-ci build toolchain macos |
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.
We already use -autolink-force-load
in .swiftinterface
files to indicate that the module corresponds to a library which must be auto-linked by clients. Combined with -module-link-name <name>
to set link library name.
Why is this new mechanism required?
@artemcm This For example, we have a dependency relationship:
In this case, we use https://github.com/apple/swift-corelibs-foundation/blob/ca3669eb9ac282c649e71824d9357dbe140c8251/Sources/Foundation/CMakeLists.txt#L201-L206
At least, swiftmodules with and without |
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.
Makes sense. Thank you for the explanation.
Thank you for your review! |
It's fixed in the main branch and cherry-picked to the 6.0 branch. See swiftlang/swift#74277
It's fixed in the main branch and cherry-picked to the 6.0 branch. See swiftlang/swift#74277
Serialize the
-public-autolink-library <name>
option to the moduleinterface file because it can affect the LINK_LIBRARY entries in a swiftmodule file. Without saving the option being saved, specified libraries won't be linked when a module compiled from the moduleinterface is used.This change marks the
-public-autolink-library
option as a module interface option and reads it when building a swiftmodule by module loader.Close swiftwasm#5580