diff options
author | Niclas Zeising <zeising+github@daemonic.se> | 2020-08-07 21:05:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 15:05:23 -0400 |
commit | 8276f812a99b10d1f2c387dbd6ef2ca4f597c733 (patch) | |
tree | 9a70f46d8bbbe39e6a32d80542b4fe9c2f28f68f /src/mips | |
parent | 392afbaf60663e530bd740da0b5a39ee9f4ba052 (diff) | |
download | libffi-8276f812a99b10d1f2c387dbd6ef2ca4f597c733.tar.gz |
Upstream local FreeBSD patches (#567)
* Add support for FreeBSD mips
Add support for FreeBSD mips, this has been a local patch in the FreeBSD
ports tree for quite some time.
Originally submitted by sson, and committed by sbruno AT FreeBSD DOT org
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191909 for
background details.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* Add support for FreeBSD powerpcspe
Add support for powerpcspe on FreeBSD
This has been in the FreeBSD ports tree for some time.
Originally submitted by jhibbits AT FreeBSD DOT org.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* Fix abort() on FreeBSD arm related to __clear_cache()
This patch has been in the FreeBSD ports tree for a number of years.
Original commit by koobs AT FreeBSD DOT org
Original commit message:
> devel/libffi: Fix abort() on ARM related to __clear_cache()
>
> The current FreeBSD/ARM __clear_cache() implementation does nothing #if
> __i386__ || __x86_64__ #else abort();
>
> cognet@ advises this is an issue for anything !Apple that is using the
> libcompiler_rt provided by Clang on ARM, and requires upstreaming.
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=149167 for some
background details.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
Diffstat (limited to 'src/mips')
-rw-r--r-- | src/mips/ffi.c | 6 | ||||
-rw-r--r-- | src/mips/ffitarget.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mips/ffi.c b/src/mips/ffi.c index 057b046..979ca49 100644 --- a/src/mips/ffi.c +++ b/src/mips/ffi.c @@ -39,7 +39,9 @@ #endif #ifndef USE__BUILTIN___CLEAR_CACHE -# if defined(__OpenBSD__) +# if defined(__FreeBSD__) +# include <machine/sysarch.h> +# elif defined(__OpenBSD__) # include <mips64/sysarch.h> # else # include <sys/cachectl.h> @@ -777,11 +779,13 @@ ffi_prep_closure_loc (ffi_closure *closure, closure->fun = fun; closure->user_data = user_data; +#if !defined(__FreeBSD__) #ifdef USE__BUILTIN___CLEAR_CACHE __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); #else cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); #endif +#endif /* ! __FreeBSD__ */ return FFI_OK; } diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h index fffdb97..fdd5ca9 100644 --- a/src/mips/ffitarget.h +++ b/src/mips/ffitarget.h @@ -41,7 +41,7 @@ #define _MIPS_SIM_ABI32 1 #define _MIPS_SIM_NABI32 2 #define _MIPS_SIM_ABI64 3 -#elif !defined(__OpenBSD__) +#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) # include <sgidefs.h> #endif |