* Conditionally include ntdll.dll
* Use text relocation instead of GOT
* Use FlushInstructionCache instead of clear_cache for arm64
* Load address in two stages (adrp, add)
* objc_msgSend.aarch64.S add comments
* Add seh directives
* Move .seh_proc into slow sloop section
* Comment out cfi directives
* Substitute raw .seh directives with macros
* Add documentation of SEH annotations
* Detect CPU Architecture with preprocessor
* Cleanup CMakeLists.txt
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
* Remove line in objc_msgSend.aarch64.S
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
* Change Test CMakeList to use ARCHITECTURE var
* Use existing clear cache macro
* Change _WIN64 to _WIN32 and reorder labels
* Remove macro and replace _WIN64 with _WIN32
* Remove argument from non-win32 macro
---------
Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
This replaces a few home-grown datastructures with third-party ones that
get a lot more testing:
- The home-grown hopscotch hash table is moved to using robin map. The
original was designed to be lock free, but we've been using it behind
a lock for ages.
- The selector list is now a std::vector.
- The types list now use std::forward_list.
This also removes a couple of code paths that haven't been used since we
started using the new ABI data structures internally and upgrading at
load time.
The new code tries to differentiate in the static type system between
registered and unregistered selectors. The check for whether a selector
is registered is fragile and depends on no selector being mapped or
allocated in memory below the total number of selectors. This check can
now disappear on most code paths.
On a single test machine (not guaranteed to be representative) the test
suite now completes around 20% faster.
This adds a dependency on a version of CMake with support for Objective-C,
removing a number of hacks to make CMake work and introduces a few
modernisations:
- Options use CMake's `option` mechanism.
- A lot of things now use generator expressions, which should improve the
things like the multi-config Ninja generator.
- We no longer depend on hacks to build in CI.
At the same time, a few other things are simplified:
- There is no longer support for building without C++ support and we depend on
a C++ standard library, not just a runtime. This makes it possible to use
more C++ features inside the runtime.
- We no longer support clang-cl on Windows and instead require clang.exe.
- Support for the Boehm GC has been removed.
Fixes building for Android arm64-v8a with NDK r25, which no longer supports this flag. Since we were passing this unconditionally we were previously inadvertently disabling NEON support if the flag wasn't set.
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
- 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!).
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.
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.
Fix type of `__cxa_allocate_exception` with recent libsupc++.
Recent versions of GNU libsupc++ provide a definition of `__cxa_allocate_exception` that has a `noexcept` qualifier. This is sensible (if allocating an exception throws an exception, then something is badly wrong) but it not what the ABI spec says. We provide our own definition of this, which must match another if provided.
This wouldn't normally be a problem, but recent libstdc++ headers appear to leak libsupc++ headers into the namespace, so we're seeing these definitions even without explicitly including any C++ ABI-related headers.
We're now using a new class and category structure and auto-upgrading the old ones. Other changes:
- The Ivar structure now points to the ivar offset variable, so we can more easily find it.
- Categories can now add properties.
macOS ships with libc++abi, which doesn't provide the hooks required
for interop, so this was causing all of the tests to fail to link in
the Travis macOS test. We're now correctly detecting that it won't
work on macOS and disabling those tests.
Some applications still include the old objc-class.h header expecting
to obtain the declarations contained in objc/message.h and
objc/runtime.h nowadays. This commit adds this header to achieve
out-of-the-box compatibility with these applications.