diff options
author | Hans <h-c-mueller@users.noreply.github.com> | 2022-09-18 01:56:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 19:56:25 -0400 |
commit | ee22ecbd11f52f8de1adbb2a6561aee2125a576a (patch) | |
tree | 7db565ad12b2bc7ec66a5b20b964e377415bb67c /src/aarch64 | |
parent | 5e010474cf2e30fa053f0a1a460a752f06438cf7 (diff) | |
download | libffi-ee22ecbd11f52f8de1adbb2a6561aee2125a576a.tar.gz |
Add MSYS configuration files (#728)
* Add MSYS configuration files
MSYS behaves very similiar to Cygwin, e.g. also __CYGWIN__ is defined.
Now 'make check' passes on MSYS without extra patches.
* Fix warning extra tokens at end of #endif in closures.c
Extra tokens converted into a comment. Also nearby indentations corrected.
* Fix missing prototype warning mkostemp() on Cygwin
Cygwin requires also _GNU_SOURCE to be defined to enable mkostemp() prototype.
* Fix warning label ‘out’ defined but not used in ffi functions
Define same preprocessor conditions for goto and label visibility.
* Fix warning label ‘out’ defined but not used and related indentations.
Define same preprocessor conditions for goto and label visibility. Correct also
related indentations.
Co-authored-by: Hannes Müller <>
Diffstat (limited to 'src/aarch64')
-rw-r--r-- | src/aarch64/ffi.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c index 76d2938..83e5653 100644 --- a/src/aarch64/ffi.c +++ b/src/aarch64/ffi.c @@ -832,14 +832,14 @@ ffi_prep_closure_loc (ffi_closure *closure, start = ffi_closure_SYSV; #if FFI_EXEC_TRAMPOLINE_TABLE -#ifdef __MACH__ -#ifdef HAVE_PTRAUTH +# ifdef __MACH__ +# ifdef HAVE_PTRAUTH codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0); -#endif +# endif void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); config[0] = closure; config[1] = start; -#endif +# endif #else static const unsigned char trampoline[16] = { 0x90, 0x00, 0x00, 0x58, /* ldr x16, tramp+16 */ @@ -848,7 +848,7 @@ ffi_prep_closure_loc (ffi_closure *closure, }; char *tramp = closure->tramp; -#if defined(FFI_EXEC_STATIC_TRAMP) +# if defined(FFI_EXEC_STATIC_TRAMP) if (ffi_tramp_is_present(closure)) { /* Initialize the static trampoline's parameters. */ @@ -859,7 +859,7 @@ ffi_prep_closure_loc (ffi_closure *closure, ffi_tramp_set_parms (closure->ftramp, start, closure); goto out; } -#endif +# endif /* Initialize the dynamic trampoline. */ memcpy (tramp, trampoline, sizeof(trampoline)); @@ -869,15 +869,17 @@ ffi_prep_closure_loc (ffi_closure *closure, ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE); /* Also flush the cache for code mapping. */ -#ifdef _WIN32 +# ifdef _WIN32 // Not using dlmalloc.c for Windows ARM64 builds // so calling ffi_data_to_code_pointer() isn't necessary unsigned char *tramp_code = tramp; - #else +# else unsigned char *tramp_code = ffi_data_to_code_pointer (tramp); - #endif +# endif ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); +# if defined(FFI_EXEC_STATIC_TRAMP) out: +# endif #endif closure->cif = cif; |