Closed qmfrederik closed 4 months ago
Hmm -- looks like there's a problem with exception interop when using libc++ instead of libstdc++ (see https://www.msys2.org/docs/environments/). The following tests fail:
The following tests FAILED:
19 - ExceptionTest (Exit code 0xc0000409)
31 - NestedExceptions (Exit code 0xc0000409)
43 - RuntimeTest (Failed)
63 - objc_msgSend (Exit code 0xc0000409)
67 - NilException (Exit code 0xc0000409)
81 - UnexpectedException (Exit code 0xc0000409)
93 - CXXExceptions (Exit code 0xc0000409)
97 - ObjCXXEHInterop (SEGFAULT)
99 - ObjCXXEHInteropTwice (SEGFAULT)
101 - ObjCXXEHInterop_arc (SEGFAULT)
@davidchisnall ok - so it seems the __do_catch
semantics differ between libc++ and stdc++, and using dereference_thrown_object_pointer
consistently addresses this.
The only test which still fails on the msys2/clang environment (i.e. with libc++) is the unexpected exception handler. Looks like __cxa_current_exception_type()
is returning NULL
, any thoughts?
Does get us down to only one failing test, though:
The following tests FAILED:
81 - UnexpectedException (Exit code 0xc0000409)
For some reason,
CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES
was not set when compiling on MSYS, which would cause CMake to add-isystem C:/msys64/clang64/include
when compilingarc.mm
.That, in turn, resulted in build warnings like this:
This PR:
CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES
to matchCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
to avoid cmake injecting the-isystem
argumentCMAKE_LINK_LIBRARY_SUFFIX
andCMAKE_SHARED_LIBRARY_PREFIX
, to avoid trying to add linking with c++ via-lc++.lib
(the link library name on msys is libc++.dll.a)CMAKE_IMPORT_LIBRARY_SUFFIX
to generatelibobjc.dll.a
(in line with the msys naming convention)CMAKE_INSTALL_BINDIR
if not set