From 8b59bbc18babd7e5ed4a032259d367f01bcc8743 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Thu, 8 May 2014 18:35:17 -0700 Subject: [PATCH] Export ldexp aliases on Windows skip END and add .drectve export in assembly versions uncomment __strong_reference definition from cdefs-compat.h use weak references in place of strong references on Mac add DLLEXPORT to all strong references Fixes Julia issue #6777 --- amd64/s_scalbn.S | 6 +++++- amd64/s_scalbnf.S | 8 +++++--- amd64/s_scalbnl.S | 10 ++++++---- include/cdefs-compat.h | 8 ++++++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/amd64/s_scalbn.S b/amd64/s_scalbn.S index 6b01af5..4a0f33b 100644 --- a/amd64/s_scalbn.S +++ b/amd64/s_scalbn.S @@ -41,10 +41,14 @@ ENTRY(scalbn) fstpl -8(%rsp) movsd -8(%rsp),%xmm0 ret +#ifndef _WIN64 END(scalbn) - .globl CNAME(ldexp) +#else +.globl CNAME(ldexp); .section .drectve; .ascii " -export:ldexp" +#endif .set CNAME(ldexp),CNAME(scalbn) + /* Enable stack protection */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/amd64/s_scalbnf.S b/amd64/s_scalbnf.S index fdbc272..8c606f0 100644 --- a/amd64/s_scalbnf.S +++ b/amd64/s_scalbnf.S @@ -41,12 +41,14 @@ ENTRY(scalbnf) fstps -8(%rsp) movss -8(%rsp),%xmm0 ret +#ifndef _WIN64 END(scalbnf) - .globl CNAME(ldexpf) -.set CNAME(ldexpf),CNAME(scalbnf) +#else +.globl CNAME(ldexpf); .section .drectve; .ascii " -export:ldexpf" +#endif +.set CNAME(ldexpf),CNAME(scalbnf) - /* Enable stack protection */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/amd64/s_scalbnl.S b/amd64/s_scalbnl.S index 7b85d9b..f5751dd 100644 --- a/amd64/s_scalbnl.S +++ b/amd64/s_scalbnl.S @@ -26,12 +26,14 @@ ENTRY(scalbnl) fstpt (%rcx) #endif ret +#ifndef _WIN64 END(scalbnl) +.globl CNAME(ldexpl) +#else +.globl CNAME(ldexpl); .section .drectve; .ascii " -export:ldexpl" +#endif +.set CNAME(ldexpl),CNAME(scalbnl) -.globl CNAME(ldexpl) -.set CNAME(ldexpl),CNAME(scalbnl) - - /* Enable stack protection */ #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff --git a/include/cdefs-compat.h b/include/cdefs-compat.h index 73697bd..173bc91 100644 --- a/include/cdefs-compat.h +++ b/include/cdefs-compat.h @@ -22,8 +22,12 @@ #ifdef __GNUC__ #ifndef __strong_reference -#define __strong_reference(sym,aliassym) - //extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); +#ifdef __APPLE__ +#define __strong_reference(sym,aliassym) __weak_reference(sym,aliassym) +#else +#define __strong_reference(sym,aliassym) \ + DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))); +#endif /* __APPLE__ */ #endif /* __strong_reference */ #ifndef __weak_reference