Skip to content

Conversation

@kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented May 4, 2024

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

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.

This fixes https://ci.swift.org/job/oss-swift-pr-test-crosscompile-wasm-ubuntu-20_04/566/

Footnotes

  1. https://github.com/apple/llvm-project/blob/stable/20230725/clang/lib/CodeGen/CGObjCMac.cpp#L5068-L5074

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
Copy link
Member Author

@swift-ci test

@kateinoigakukun
Copy link
Member Author

@swift-ci test WebAssembly

@kateinoigakukun kateinoigakukun marked this pull request as ready for review May 4, 2024 21:27
@MaxDesiatov MaxDesiatov requested review from al45tair and etcwilde May 5, 2024 10:43
@kateinoigakukun
Copy link
Member Author

Merging to get the CI status back to green for now.

@kateinoigakukun kateinoigakukun merged commit 6618b22 into swiftlang:main May 6, 2024
@kateinoigakukun kateinoigakukun deleted the yt/objc-interop-modulewrap branch May 21, 2024 03:35
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