24 Commits (e882423e5af80e86826c13e791401e322292afab)

Author SHA1 Message Date
Hugo Melder e882423e5a
PowerPC {32, 64}-bit Block Trampolines (#272)
* Implement PowerPC block trampoline

* Adjust pagesize on ppc64

* Skip UnexpectedException test for PowerPC

* Move PAGE_SIZE to asmconstants.h

* Use PAGE_SIZE and PAGE_SHIFT macros for PowerPC

* Add ppc64el and powerpc qemu-crossbuild targets

* Add NO_SAFE_CACHING definition and guards

* Do not export objc_method_cache_version on ppc32

---------

Co-authored-by: David Chisnall <davidchisnall@users.noreply.github.com>
2 years ago
Hugo Melder ab23f14fd7
Initial Windows on ARM (AArch64) Support (#249)
* 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>
2 years ago
Niels Grewe 0e84e318e7
Use (anonymous) mmap() when available.
Should fix #147 (SELinux related segfault)
6 years ago
Frederik Seiffert d16faeded9 Fixed warning in imp_implementationWithBlock.
This was caused by switching the method signature to use "id" for the block parameter.
7 years ago
Frederik Seiffert a2463192d0 Use `id` as type for block runtime functions.
Fixes #103.
7 years ago
Frederik Seiffert f4b381febb Replace valloc() with posix_memalign().
valloc() no longer exists in some toolchains like Android arm64.
7 years ago
David Chisnall 1bc7ac26f8 Improve block-to-IMP code on Windows.
This version will work with Windows Store apps.

Patch by Dustin Howett!
8 years ago
David Chisnall 934cd13a7a Initial pass at Windows support.
All tests now pass with the new ABI on x86-64, with the new ABI.  Some
of the code is ugly and other platforms are probably broken.
8 years ago
David Chisnall 4ab78aa49a Check for Thumb-2 more explicitly. 10 years ago
David Chisnall c8848614b5 Now that we’re not marking the block trampoline functions as functions, the start and end symbols will appear as normal data pointers with no Thumb mangling, so remove the code that unmangles them. 10 years ago
David Chisnall 9e51aabc98 Fix block trampolines to work when mixed with Thumb-2 code. 10 years ago
David Chisnall ef458104dd Remove some debugging code. 10 years ago
David Chisnall 1933167046 Copy (retain) blocks when they are used as IMPs. 10 years ago
David Chisnall e8604511a6 Fix block metadata address calculation. 10 years ago
David Chisnall 77df8d3d92 Remove debugging line. 10 years ago
David Chisnall 7eeffe9d09 Rewrite the block-to-imp code so that:
- We reuse the memory allocated for blocks
- We no longer have the same physical page mapped write and execute
10 years ago
ivucica 4742f71d29 Added #define __has_builtin into block_to_imp.c. 12 years ago
theraven dc241dc1bf Make sure that we flush the instruction cache when creating a new IMP at run
time.
12 years ago
theraven 6394126bfe Some cleanups in block to IMP conversion.
On FreeBSD (and other platforms that choose to implement the , allocate the
memory via the anonymous shared memory mechanism, removing the need for the
temporary file.  On other POSIX platforms, correctly use mkstemp().
12 years ago
theraven 8baefbe5c8 Expose asprintf() with glibc. 13 years ago
thebeing f845df37c1 Add objc/blocks_private.h header to expose some internals of the blocks runtime
that are accessed by libdispatch. Also rename the relevant structs to be
compatible with the BlocksRuntime from compiler-rt.
14 years ago
thebeing e8645c8ceb Small QNX compatibility tweak. 14 years ago
theraven f9f2e4e313 Added a function for getting the type encoding for a block returned by imp_implementationFromBlock(). 14 years ago
theraven 43ee8b9819 Add initial support for imp_implementationWithBlock() and friends. Currently
only works on x86 and x86-64 and doesn't work with sret functions.
14 years ago