When we stopped using CXXFLAGS in eh_personality.s generation, we lost
the ability to propagate -m32 or -target through, so cross-compile
didn't work. These flags are now passed through correctly, so (so
'-pipe -O2' will appear as two arguments, rather than being combined as
a single value that then causes clang to abort with an unknown argument
error, which was the original motivation for this change).
This is the correct fix for #177
The way that we were doing this didn't handle multiple flags and we
actually don't want the user to override these flags because that file
needs to be compiled in a very specific way.
Fixes#177
Several of the hooks were being generated with common linkage in hooks.c
and as normal initialised symbols in sendmsg2.c. Recent clang defaults
to -fno-common, which causes the common linkage versions to become
strong symbols and then causes a linkage failure from duplicate
definitions: one zero initialised, one initialised with a real value.
This removes copy in hooks.c, retaining only the initialised version.
Fixes#171
- Don't try to detect libc++abi. It doesn't actually work, so don't
try it.
- Correctly try to link the standard library.
This should fix the build on GNU/Linux systems with libc++abi.so
installed (including our Ubuntu CI!).
libsupc++ is more aggressive about internal consistency checks than
libcxxrt, so we need to be more careful in the interop. The tests from
PR #138 now pass for me on Debian with libsupc++.
* Make sure the unwind state is synchronised between the Objective-C
and C++ exception objects.
* Reintroduce the is-pointer callback so that `__cxa_begin_catch`
adjusts the pointer correctly. Objective-C++ code uses
`__cxa_begin_catch` without the `objc_begin_catch` wrapper and the
runtime does not call the `__do_catch` method on the type info if the
type info is an exact match, so the caught object ended up being a
pointer to the object. This also meant that we needed to remove the
double dereference in the `__do_catch` methods.
* Introduce a subclass of `std::type_info` for all Objective-C types
and move the `virtual` functions there. This should simplify
supporting libc++abi.
We now, the first time we encounter a foreign exception, throw a C++
exception through a frame that has a custom personality function and
probe the layout of the __cxa_exception structure.
We then use the offsets learned from this along with the public ABI
functions for allocating the structure.
At the same time, add a test that we are correctly setting the count of
uncaught exceptions.
Fixes#146
On Itanium C++ ABI platforms, there are a lot of different variations
that have subtly different structure layouts. This commit adds a
run-time test that throws a C++ exception through a function that has
its personality function replaced with a wrapper so that we can inspect
a C++ exception in controlled conditions.
Initially, this just detects the exception type value used for C++
exceptions.
When passing -T to ask CTest to generate XML output, CTest complains
about a missing TCL file. This causes the build steps to fail. To
avoid that, make sure the ctest invocation is the last line in the
script so that its error status will be reported.
The reworked wrapping of C++ exceptions meant that we were missing a
dereference of the result of __cxa_begin_catch.
Add a test that triggers this issue. It would have occurred in the
non-ARC version if we actually did anything with the exception, but
compiling it in ARC mode makes the compiler insert retain / autorelease
around the exception object to ensure that it remains live.