Merge pull request #443 from jeremyhu/master Update FFI_HIDDEN() to use .private_extern on Apple platforms and use the macro where appropriate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/configure.ac b/configure.ac
index aec2f55..27676b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,7 +292,11 @@ AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
AH_BOTTOM([
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
#ifdef LIBFFI_ASM
+#ifdef __APPLE__
+#define FFI_HIDDEN(name) .private_extern name
+#else
#define FFI_HIDDEN(name) .hidden name
+#endif
#else
#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
#endif
diff --git a/src/arm/sysv.S b/src/arm/sysv.S
index a40e327..7bda640 100644
--- a/src/arm/sysv.S
+++ b/src/arm/sysv.S
@@ -85,7 +85,6 @@
#define ARM_FUNC_START(name) \
.globl CNAME(name); \
- .private_extern CNAME(name); \
FFI_HIDDEN(CNAME(name)); \
ARM_FUNC_START_LOCAL(name)
diff --git a/src/x86/sysv.S b/src/x86/sysv.S
index 49fd80c..3e462c1 100644
--- a/src/x86/sysv.S
+++ b/src/x86/sysv.S
@@ -794,7 +794,7 @@ ENDF(C(ffi_closure_raw_THISCALL))
# define COMDAT(X) \
.section __TEXT,__text,coalesced,pure_instructions; \
.weak_definition X; \
- .private_extern X
+ FFI_HIDDEN(X)
#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
# define COMDAT(X) \
.section .text.X,"axG",@progbits,X,comdat; \