1321 Commits (71e38a048fc06fea0c2015662540d46a33b5c45d)
 

Author SHA1 Message Date
David Chisnall ec5c0bcae2 More C++ exception fixes.
* 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.
6 years ago
Johannes Brakensiek d5973fb6ce Add INSTALL instruction to reflect that git submodules need to be checked out as well 6 years ago
David Chisnall 1594de76c3
Merge pull request #156 from gnustep/detect-ehabi
Initial run-time detection of C++ EH ABI variant.
6 years ago
David Chisnall 65d6b279a0 Rework C++ exception interop again.
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
6 years ago
David Chisnall 76e081dc48 Initial run-time detection of C++ EH ABI variant.
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.
6 years ago
David Chisnall ec8782e396
Merge pull request #149 from gnustep/checkARCAccessors-fix
Fix detection of ARC-incompatible memory management methods
6 years ago
David Chisnall 5a35fff19d Add test for checking whether a class supports fast ARC. 6 years ago
David Chisnall 2d87ac45a1 Fix logging macro 6 years ago
rfm 8dbee52d24 Fix fast-ARC checks.
Check for release and autorelease as well as for retain.
6 years ago
David Chisnall 78ff24516c Fix invoking missing superclass methods.
The lookup functions for the superclass paths were silently ignoring
missing methods, rather than calling the forwarding hook.

Fixes #153
6 years ago
David Chisnall fa2914b13c Don't fail on ctest writing to stderr
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.
6 years ago
David Chisnall 2d46c97544 Add a publish results step to Azure pipeline. 6 years ago
David Chisnall 691c1df6ad Bump the Linux CI version to Ubuntu 18.04 6 years ago
David Chisnall bbf748474c Bump CI FreeBSD image version. 6 years ago
Frederik Seiffert 97de29fae2 Match indentation in unwind-arm.h 6 years ago
Frederik Seiffert 849fa9c8eb Match _Unwind_Reason_Code enum between ARM and Itanium. 6 years ago
Frederik Seiffert 186847c8d0 Fix eh_win32_msvc.cc includes 6 years ago
David Chisnall 249acabbf4 Disable a test on Windows.
This is failing (and needs fixing) but it's unhelpful for CI to report
failures on Windows for PRs.
6 years ago
David Chisnall 769ac2f8b7 Fix some bad instructions in the INSTALL file. 6 years ago
Niels Grewe cbfc592713
Merge pull request #148 from gnustep/mmap-anonymous
Use (anonymous) mmap() for allocating block-based IMPs.
6 years ago
Niels Grewe 0e84e318e7
Use (anonymous) mmap() when available.
Should fix #147 (SELinux related segfault)
6 years ago
Dustin L. Howett bfc0b9afe4 Operate on the real weak ref table when erasing an entry
Fixes #144.

(cherry picked from commit 9702494b902eedf9383e9194df372a4482d7a044)
6 years ago
Dustin L. Howett 7ad75c07d6 Revert "Fix test failure."
This reverts commit 336d8a828c.

(cherry picked from commit 194d2ba8db86a03a08ef825501627d7d178e4202)
6 years ago
Niels Grewe 59815ebc10 fix test for class properties 6 years ago
Niels Grewe ecdc4ffbd4 check both for the full and the short name of the C++ ABI library, unset cache if the library is not usable 6 years ago
Niels Grewe 8e749db5ca chore: Add project() statement to prevent noise in CMake logs 6 years ago
Niels Grewe 5578072611
Write a correct .pc file for gnustep-make installs
Fixes #140
6 years ago
David Chisnall 7c79dfc4c5 Add missing files. 6 years ago
David Chisnall aa775cf835 Fix ObjC++ interop bug.
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.
6 years ago
David Chisnall 8e59872681 Require C++14 in CMake. 6 years ago
Niels Grewe 8249036318 generate a pkg-config file 6 years ago
David Chisnall 28375c9a27
Merge pull request #132 from triplef/freebsd-test-libcxxrt
Run FreeBSD CI also against libcxxrt master.
6 years ago
Frederik Seiffert ecfce73295 Run FreeBSD CI also against libcxxrt master. 6 years ago
David Chisnall 55819ce107 Move the libstdc++ code path to a separate file.
We need to #include <exception> for this to work, but this brings in the
public definition of `std::type_info` and, unfortunately, that breaks
the private definition that we need in this compilation unit.
6 years ago
David Chisnall 55a4719976 Attempt to fix libsupc++ support.
Recent versions of libstdc++ appear to have lost the clean layering
between libstdc++ and libsupc++, so use the high-level APIs and some
pointer evilness to fudge the low-level ones...
6 years ago
David Chisnall 0ad8cad910 Remove the include of <cxxabi.h>
This removes conflicting definitions on libsupc++ platforms.
6 years ago
David Chisnall 242442b3aa Rework Objective-C++ exceptions.
The new version now does not depend on the layout of the C++ exception
structure and instead finds the two offsets that it cares about.

Fixes #108
6 years ago
David Chisnall 8e26f54e3e
Merge pull request #119 from gnustep/arc-cxx
Rework ARC code as C++.

Fixes #107
6 years ago
David Chisnall 75ad9243a1 Prevent libc++ from using exceptions. 6 years ago
David Chisnall 457361354c Merge remote-tracking branch 'origin/master' into arc-cxx 6 years ago
Rupert Daniel 108d4e19c0 Updated BlockImpTest asserts. Fixes #126
assert now directly compares block self with expected class, avoiding
objc_msgSend.
6 years ago
Rupert Daniel 710b2368cc Fixed crash when using self in imp_implementationWithBlock on armv7a 6 years ago
Frederik Seiffert 7166a41999 Fixed usage of properties linked list. 6 years ago
David Chisnall b1964451e1 Fix the AArch64 small object class lookup.
This was generating a relocation that didn't do the right thing and
didn't raise linker errors.  Now it is using GOT-relative addressing.

In combination with the last two commits, this now makes all of the
objc_msgSend tests pass on AArch64.

Fixes #105
6 years ago
David Chisnall c1a3d8f470 Fix stack resetting for objc_msgSend on ARM.
If we called into C to find the IMP (e.g. for forwarding), we were then
reloading all of the arguments but failing to adjust the stack pointer
by the correct amount, leaving it around 192 bytes offset from its
correct location.  This, unsurprisingly, led to crashing and other
exciting behaviour.
6 years ago
David Chisnall 60a657fbc6 Fix CFA calculation in AArch64 objc_msgSend.
Prior to this, throwing an exception from a +initialize method would
leave the stack pointer 16 bytes offset from its correct location.
6 years ago
David Chisnall 469d616a77 [NFC] Fix comment. 6 years ago
David Chisnall 4482919e09 Fix an issue with `WeakRef`s being over-released
As an optimisation, on load of a weak reference we check if the object
has already been deallocated and, if so, decrement the weak reference
count and zero the pointer to the weak reference structure so that the
next check is faster and doesn't need to hold locks for as long.

Unfortunately, the prior implementation of this instead decremented the
weak reference count and then only zeroed the pointer if the reference
count reached zero.  This meant that loading the same __weak pointer
twice after the pointed-to object had been deallocated would decrement
the reference count twice.
6 years ago
David Chisnall 2fb1194cec Add test case for weak ref issue.
This test now fails deterministically, which should make fixing it
easier.
6 years ago
David Chisnall b7021f7488 Merge remote-tracking branch 'origin/master' into arc-cxx 7 years ago