Skip to content

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
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

3 participants