Skip to content

🍒 -static-libclosure support #9980

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
merged 2 commits into from
Feb 11, 2025

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Feb 7, 2025

Cherry pick some changes from upstream to enable -static-libclosure support. This impacts the code generation on Windows only for the BlocksRuntime.

compnerd and others added 2 commits February 7, 2025 13:02
This corrects a swapped order of the spelling of blocks in the check.
This enables the correct forward declarations which were previously
disabled.

(cherry picked from commit b798679)
When building on Windows, dealing with the BlocksRuntime is slightly
more complicated. As we are not guaranteed a formward declaration for
the blocks runtime ABI symbols, we may generate the declarations for
them. In order to properly link against the well-known types, we always
annotated them as `__declspec(dllimport)`. This would require the
dynamic linking of the blocks runtime under all conditions. However,
this is the only the only possible way to us the library. We may be
building a fully sealed (static) executable. In such a case, the well
known symbols should not be marked as `dllimport` as they are assumed to
be statically available with the static linking to the BlocksRuntime.

Introduce a new driver/cc1 option `-static-libclosure` which mirrors the
myriad of similar options (`-static-libgcc`, `-static-libstdc++`,
-static-libsan`, etc).

(cherry picked from commit 1901f4a)
@compnerd compnerd requested a review from a team as a code owner February 7, 2025 21:05
@compnerd
Copy link
Member Author

compnerd commented Feb 7, 2025

@swift-ci please test

@compnerd compnerd merged commit 757d38a into swiftlang:stable/20240723 Feb 11, 2025
3 checks passed
@compnerd compnerd deleted the static-closure-stable branch February 11, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant