Skip to content

[Frontend] Add -public-autolink-library option #3353

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

Closed
wants to merge 1 commit into from

Conversation

MaxDesiatov
Copy link

@MaxDesiatov MaxDesiatov commented Aug 8, 2021

Cherry-pick of swiftlang#35936.

This should fix issues with Foundation builds on the swiftwasm branch.

Foundation imports CoreFoundation with @_implementationOnly,
so CoreFoundation's modulemap won't be read, and the dependent libraries
of CoreFoundation will not be automatically linked when using static
linking.

For example, CoreFoundation depends on libicui18n and it's modulemap has
`link "icui18n"` statement. If Foundation imports CoreFoundation with
@_implementationOnly as a private dependency, the toolchain doesn't have
CoreFoundation's modulemap and Foundation's swiftmodule  doesn't import
CoreFoundation. So the swiftc can't know that libicui18n is required.

This new option will add LINK_LIBRARY entry in swiftmodule to
specify dependent libraries (in the example case, Foundation's
swiftmodule should have LINK_LIBRARY entry of libicui18n)
@MaxDesiatov MaxDesiatov marked this pull request as ready for review August 8, 2021 18:36
@MaxDesiatov MaxDesiatov requested a review from a team August 8, 2021 19:57
@MaxDesiatov
Copy link
Author

@kateinoigakukun are you seeing this same failure with XCTest on macOS locally? I'm not able to reproduce it on my x86 hardware, and the build fails much earlier with a different error on M1

@MaxDesiatov MaxDesiatov closed this Sep 2, 2021
@MaxDesiatov MaxDesiatov deleted the maxd/autolink-fix branch September 2, 2021 06:31
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.

2 participants