Skip to content

[wasm] Emit libTesting.a objects with single-threaded LLVM codegen unit #82123

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

kateinoigakukun
Copy link
Member

Since 5f2b002, swift-testing is being compiled with WMO, which removes some of inter-object references in object files by DCE. The inter-object reference removal revealed a long-standing issue that the runtime metadata sections of objects in an archive are not always included in the final binary if symbols from those objects are not referenced anywhere. To force including all metadata sections in the final binary, we have to emit everything in a single object file when building the archive.
This issue happens only for Wasm SDK, which ships swift-testing as a static archive.

This fixes swiftwasm/JavaScriptKit#367

Since 5f2b002, swift-testing is being
compiled with WMO, which removes some of inter-object references in
object files by DCE. The inter-object reference removal revealed a
long-standing issue that the runtime metadata sections of objects in an
archive are not always included in the final binary if symbols from
those objects are not referenced anywhere. To force including all
metadata sections in the final binary, we have to emit everything in a
single object file when building the archive.
This issue happens only for Wasm SDK, which ships swift-testing as a
static archive.
@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

@kateinoigakukun kateinoigakukun marked this pull request as ready for review June 10, 2025 21:25
@kateinoigakukun kateinoigakukun merged commit 2549627 into swiftlang:main Jun 10, 2025
3 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/fix-swt-crash-wmo branch June 10, 2025 21:26
kateinoigakukun added a commit to swiftwasm/JavaScriptKit that referenced this pull request Jun 16, 2025
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.

make unittest fails after swift-DEVELOPMENT-SNAPSHOT-2025-05-23-a
2 participants