QuantumSegfault wrote: > I'd appreciate if you provide more info on > > 1. Why ObjC can't use its own personality function if there is a wrapper > > 2. Why ObjC needs its own personality function in the first place > > 3. Whether or how much ObjC can share the current libcxxabi and libunwind > implementation > > > This seems to increases code size by several instructions per catch site. I'd > like to have more info on why this is really necessary, because it affects > our code size too.
1. Same as with ObjC. Overriding `_Unwind_CallPersonality` does work, but only if we aren't linking with C++ causing conflicts. 2. D needs its own personality to handle its own type hierarchy, and it's ability to chain exceptions. Other than these language specific additions, it actually supports handling/catching C++ exceptions as well for interop with C++. Symbol conflicts are the problem here. 3. Right now I've got it working entirely independently of both `libcxxabi` and `libunwind` by reimplementing the small parts I need from `libunwind`. In practice, it makes sense to rely on the small `libunwind` to define the necessary symbols (e.g. the `__cpp_exception` tag) to avoid conflicts and headache, but we definitely don't need `libcxxabi` for a pure D project. Dumb question, but why can't we just change the signature of the "personality" on Wasm? Make it take just that single exception pointer. `__gxx_wasm_personality_v0` is then defined the same as `_Unwind_CallPersonality`, forwarding to the internal implementation. Other languages can do the same, so long as they respect the implicit ABI requirements. Wouldn't that solve both problems (flexible personality, small code size)? https://github.com/llvm/llvm-project/pull/175202 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
