Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (#450)

* x86: Ensure _efi64 suffixed symbols are not exported

* x86: Ensure we do not export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* x86: Ensure we don't export ffi_call_win64, ffi_closure_win64, or ffi_go_closure_win64

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* closures: Silence a semantic warning

libffi/src/closures.c:175:23: This function declaration is not a prototype

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch64: Ensure we don't export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* arm: Ensure we don't export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch64, arm, x86: Add architecture preprocessor checks to support easier fat builds (eg: iOS)

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* x86: Silence some static analysis warnings

libffi/src/x86/ffi64.c:286:21: The left operand of '!=' is a garbage value due to array index out of bounds
libffi/src/x86/ffi64.c:297:22: The left operand of '!=' is a garbage value due to array index out of bounds

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch: Use FFI_HIDDEN rather than .hidden

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* ffi.h: Don't advertise ffi_java_rvalue_to_raw, ffi_prep_java_raw_closure, and ffi_prep_java_raw_closure_loc when FFI_NATIVE_RAW_API is 0

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia
2019-02-19 07:11:28 -05:00
committed by Anthony Green
parent 3ec522bc1c
commit 05a1796419
11 changed files with 44 additions and 22 deletions
+5 -2
View File
@@ -28,6 +28,7 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#ifdef __arm__
#include <fficonfig.h>
#include <ffi.h>
#include <ffi_common.h>
@@ -210,7 +211,7 @@ ffi_prep_args_VFP (ffi_cif *cif, int flags, void *rvalue,
}
/* Perform machine dependent cif processing */
ffi_status
ffi_status FFI_HIDDEN
ffi_prep_cif_machdep (ffi_cif *cif)
{
int flags = 0, cabi = cif->abi;
@@ -301,7 +302,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
}
/* Perform machine dependent cif processing for variadic calls */
ffi_status
ffi_status FFI_HIDDEN
ffi_prep_cif_machdep_var (ffi_cif * cif,
unsigned int nfixedargs, unsigned int ntotalargs)
{
@@ -817,3 +818,5 @@ layout_vfp_args (ffi_cif * cif)
break;
}
}
#endif /* __arm__ */
+2
View File
@@ -25,6 +25,7 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
#ifdef __arm__
#define LIBFFI_ASM
#include <fficonfig.h>
#include <ffi.h>
@@ -377,6 +378,7 @@ ARM_FUNC_START(ffi_arm_trampoline)
ARM_FUNC_END(ffi_arm_trampoline)
#endif /* FFI_EXEC_TRAMPOLINE_TABLE */
#endif /* __arm__ */
#if defined __ELF__ && defined __linux__
.section .note.GNU-stack,"",%progbits