Skip to content

Fix statically linked concurrency on Linux #42071

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

Merged

Conversation

etcwilde
Copy link
Member

Generating a statically-linked executable either with
-static-executable or -static-stdlib that contains concurrency needs
to link the concurrency libraries or the missing symbols will cause link
failures.

This patch adds dispatch and blocks runtime to the list of statically
linked libraries. In the case of the static stdlib, it only adds them if
the concurrency mechanisms use dispatch, otherwise it doesn't.

For the static executable, it always adds them since that doesn't appear
to be very configurable.

@etcwilde etcwilde added the concurrency Feature: umbrella label for concurrency language features label Mar 28, 2022
@etcwilde
Copy link
Member Author

@swift-ci please test

@etcwilde etcwilde requested a review from compnerd March 28, 2022 23:12
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the small change.

Generating a statically-linked executable either with
`-static-executable` or `-static-stdlib` that contains concurrency needs
to link the concurrency libraries or the missing symbols will cause link
failures.

This patch adds dispatch and blocks runtime to the list of statically
linked libraries. In the case of the static stdlib, it only adds them if
the concurrency mechanisms use dispatch, otherwise it doesn't.

For the static executable, it always adds them since that doesn't appear
to be very configurable.
@etcwilde etcwilde force-pushed the ewilde/link-dispatch-blocks-for-concurrency branch from f51b59c to 1977a68 Compare March 28, 2022 23:21
@etcwilde
Copy link
Member Author

@swift-ci please test

@etcwilde
Copy link
Member Author

etcwilde commented Mar 29, 2022

Broken by #42051

@etcwilde
Copy link
Member Author

@swift-ci please test macOS

@etcwilde
Copy link
Member Author

@swift-ci please test Windows

@etcwilde
Copy link
Member Author

#42075 has now merged, which should hopefully fix things again.

@etcwilde
Copy link
Member Author

@swift-ci please test macOS

@etcwilde etcwilde merged commit 225a5ef into swiftlang:main Mar 29, 2022
@etcwilde etcwilde deleted the ewilde/link-dispatch-blocks-for-concurrency branch March 29, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants