Skip to content

[6.0] modulewrap: Disable ObjC interop by default on non-Darwin platforms #73778

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

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented May 21, 2024

Explanation: Fixes crash regression on modulewrap with WebAssembly target by disabling ObjC interop by default on non-Darwin platforms as swift-frontend does. The crash was introduced by #73371
Scope: Only affects non-Darwin platforms
Risk: Low; just applies the same ObjC interop availability rule to modulewrap as swift-frtonend does
Testing: CI testing
Reviewer: @MaxDesiatov
Original PR: #73440

0a5653d started to call
`IGM.finalize()`, which leads the Clang instance to emit ObjC metadata
sections when the ObjC interop is enabled. Emitting ObjC metadata
sections is not well supported on non-Darwin platforms and causes
crashes for WebAssembly and COFF object formats[^1].

modulewrap tool did not configure the ObjC interop option, so it always
enabled the ObjC interop. This patch aligns the default ObjC interop
value with other tools by disabling it on non-Darwin platforms.

[^1]: https://github.com/apple/llvm-project/blob/stable/20230725/clang/lib/CodeGen/CGObjCMac.cpp#L5068-L5074
@kateinoigakukun kateinoigakukun added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels May 21, 2024
@kateinoigakukun
Copy link
Member Author

@swift-ci test

@kateinoigakukun
Copy link
Member Author

@swift-ci test WebAssembly

@kateinoigakukun
Copy link
Member Author

@hborla For branch manager approval 🙏

@kateinoigakukun kateinoigakukun requested review from bnbarham and removed request for bnbarham May 29, 2024 02:17
@kateinoigakukun
Copy link
Member Author

Thanks @bnbarham!

@kateinoigakukun kateinoigakukun merged commit 8cb8686 into swiftlang:release/6.0 May 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants