-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Hide async_Main
from other object files
#69113
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
[Concurrency] Hide async_Main
from other object files
#69113
Conversation
@swift-ci Please build toolchain |
e212bd5
to
0fd8f0b
Compare
Please test with following pull request: @swift-ci Please smoke test |
Thanks @kateinoigakukun 🥳 |
Test [swiftlang/swift#69113: \[Concurrency\] Hide async_Main from other object files](swiftlang/swift#69113) Merge after the above fix will be merged ### Motivation: To verify that multiple executable targets with async entrypoints can be linked within a single test executable Resolves rdar://114231968 ### Modifications: Added a new test case
We're seeing test failures here. I believe the symbol should be both private linkage and have hidden visibility. https://ci.swift.org/job/swift-PR-Linux/11278/
|
Actually, scratch that. The above link failure is on the 5.10 branch in a SwiftPM test. |
Multiple executable targets with asyc entrypoints within a single package were not able to be tested due to the following linkage failure.
The sync
main
entrypoint is usually referenced by crt, so it should be visible from the outside of the object file and linked image unit. Therefore, the syncmain
entrypoints are renamed using-entry-point-function-name
by SwiftPM to avoid conflicting with other executable targets.On the other hand, the async
async_Main
entrypoint is only referenced from the syncmain
, so it doesn't need to be visible from other object files. Therefore, we can just hide it from other object files to avoid static link-time conflicts.The
async_Main
symbol was defined ashidden
SIL visibility, buthidden
is still visible from other object files (not visible from other image unit), so this PR makes itprivate
, which corresponds tointernal
LLVM visibility.Resolves rdar://114231968