Skip to content

[embedded] Link in @_used declarations from other modules in SILLinker #80185

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
Mar 22, 2025

Conversation

kubamracek
Copy link
Contributor

This is a fix for #77812. In the Embedded Swift linkage model, the client/application module only links in what is actively used from other modules. There are situations where this is undesirable, and so this PR now explicitly links in all @_used functions and global variables from imported modules.

rdar://141239267

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test Windows platform

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

Windows build fails with

FAILED: tools/swift/lib/SILOptimizer/CMakeFiles/swiftSILOptimizer.dir/UtilityPasses/Link.cpp.obj 
...
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\include\swift/Runtime/RuntimeFunctions.def(2133): error C2872: 'Concurrency': ambiguous symbol
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\\include\ppltasks.h(95): note: could be 'Concurrency'
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\include\swift/SIL/RuntimeEffect.h(92): note: or       'const swift::RuntimeEffect RuntimeConstants::Concurrency'
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\include\swift/Runtime/RuntimeFunctions.def(2133): error C2882: 'Concurrency': illegal use of namespace identifier in expression
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\include\swift/Runtime/RuntimeFunctions.def(2308): error C2872: 'Concurrency': ambiguous symbol
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\\include\ppltasks.h(95): note: could be 'Concurrency'
C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\swift\include\swift/SIL/RuntimeEffect.h(92): note: or       'const swift::RuntimeEffect RuntimeConstants::Concurrency'

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@kubamracek kubamracek requested a review from rjmccall as a code owner March 21, 2025 20:29
@kubamracek
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek enabled auto-merge March 22, 2025 04:58
@MaxDesiatov
Copy link
Contributor

@swift-ci test macos

@kubamracek kubamracek merged commit 033f667 into swiftlang:main Mar 22, 2025
4 of 5 checks passed
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.

4 participants