-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: internalize symbols with -static
#41431
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
IRGen: internalize symbols with -static
#41431
Conversation
CC: @DougGregor @rjmccall @jckarter @aschwaighofer As a brief recap of the model discussed on the forums a while ago:
This could actually also enable optimizations on other platforms ( At some point it may be nice to support
|
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test Linux platform |
523e155
to
d8de8fa
Compare
@swift-ci please test Linux platform |
1 similar comment
@swift-ci please test Linux platform |
This pipes the `-static` flag when building a static library into IRGen. This should have no impact on non-Windows targets as the usage of the information simply removes the `dllexport` attribute on the generated interfaces. This ensures that a library built with `-static` will not re-export its interfaces from the consumer. This is important to ensure that the consumer does not vend the API surface when it statically links a library. In conjunction with the removal of the force load symbol, this allows the generation of static libraries which may be linked against on Windows. However, a subsequent change is needed to ensure that the consumer does not mark the symbol as being imported from a foreign module (i.e. `dllimport`).
9a82a24
to
98bd2db
Compare
Please test with following PRs: @swift-ci please test |
Please test with following PRs: @swift-ci please test Linux platform |
Please test with following PRs: @swift-ci please test macOS platform |
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.
LGTM
This pipes the
-static
flag when building a static library into IRGen.This should have no impact on non-Windows targets as the usage of the
information simply removes the
dllexport
attribute on the generatedinterfaces. This ensures that a library built with
-static
will notre-export its interfaces from the consumer. This is important to ensure
that the consumer does not vend the API surface when it statically links
a library. In conjunction with the removal of the force load symbol,
this allows the generation of static libraries which may be linked
against on Windows. However, a subsequent change is needed to ensure
that the consumer does not mark the symbol as being imported from a
foreign module (i.e.
dllimport
).Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.