1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 10:05:05 -07:00

Of course, GNU ld doesn't know about .private_extern

This commit is contained in:
Frank Denis 2016-03-22 21:26:39 +01:00
parent bafc9c70e1
commit 3295752821
6 changed files with 37 additions and 21 deletions

View File

@ -529,9 +529,9 @@ __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" :
])
AC_SUBST(HAVE_CPUID_V)
HAVE_VISIBILITY_V=0
asm_hide_symbol="unsupported"
AS_IF([test "$enable_asm" != "no"],[
AC_MSG_CHECKING(if the private_extern asm directive is supported)
AC_MSG_CHECKING(if the .private_extern asm directive is supported)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
__asm__ __volatile__ (".private_extern dummy_symbol \n"
".private_extern _dummy_symbol \n"
@ -543,12 +543,28 @@ __asm__ __volatile__ (".private_extern dummy_symbol \n"
);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_VISIBILITY], [1], [the private_extern asm directive
is supported])
HAVE_VISIBILITY_V=1],
asm_hide_symbol=".private_extern"],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(if the .hidden asm directive is supported)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
__asm__ __volatile__ (".hidden dummy_symbol \n"
".hidden _dummy_symbol \n"
".globl dummy_symbol \n"
".globl _dummy_symbol \n"
"dummy_symbol: \n"
"_dummy_symbol: \n"
" nop \n"
);
]])],
[AC_MSG_RESULT(yes)
asm_hide_symbol=".hidden"],
[AC_MSG_RESULT(no)])
AS_IF([test "$asm_hide_symbol" != "unsupported"],[
AC_DEFINE_UNQUOTED([ASM_HIDE_SYMBOL], [$asm_hide_symbol], [directive to hide symbols])
])
AC_SUBST(HAVE_VISIBILITY_V)
])
AC_MSG_CHECKING(if weak symbols are supported)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[

View File

@ -7,9 +7,9 @@
#include "consts_namespace.h"
.text
.p2align 5
#ifdef HAVE_VISIBILITY
.private_extern fe51_mul
.private_extern _fe51_mul
#ifdef ASM_HIDE_SYMBOL
ASM_HIDE_SYMBOL fe51_mul
ASM_HIDE_SYMBOL _fe51_mul
#endif
.globl fe51_mul
.globl _fe51_mul

View File

@ -8,9 +8,9 @@
#include "consts_namespace.h"
.p2align 5
#ifdef HAVE_VISIBILITY
.private_extern fe51_nsquare
.private_extern _fe51_nsquare
#ifdef ASM_HIDE_SYMBOL
ASM_HIDE_SYMBOL fe51_nsquare
ASM_HIDE_SYMBOL _fe51_nsquare
#endif
.globl fe51_nsquare
.globl _fe51_nsquare

View File

@ -8,9 +8,9 @@
#include "consts_namespace.h"
.p2align 5
#ifdef HAVE_VISIBILITY
.private_extern fe51_pack
.private_extern _fe51_pack
#ifdef ASM_HIDE_SYMBOL
ASM_HIDE_SYMBOL fe51_pack
ASM_HIDE_SYMBOL _fe51_pack
#endif
.globl fe51_pack
.globl _fe51_pack

View File

@ -4,9 +4,9 @@
#include "consts_namespace.h"
.p2align 5
#ifdef HAVE_VISIBILITY
.private_extern ladder
.private_extern _ladder
#ifdef ASM_HIDE_SYMBOL
ASM_HIDE_SYMBOL ladder
ASM_HIDE_SYMBOL _ladder
#endif
.globl ladder
.globl _ladder

View File

@ -4,9 +4,9 @@
#include "consts_namespace.h"
.p2align 5
#ifdef HAVE_VISIBILITY
.private_extern ladder_base
.private_extern _ladder_base
#ifdef ASM_HIDE_SYMBOL
ASM_HIDE_SYMBOL ladder_base
ASM_HIDE_SYMBOL _ladder_base
#endif
.globl ladder_base
.globl _ladder_base