1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00

Only use .private_extern if this is supported

This commit is contained in:
Frank Denis 2016-03-22 20:42:07 +01:00
parent 26e4cf479a
commit bafc9c70e1
6 changed files with 31 additions and 0 deletions

View File

@ -529,6 +529,27 @@ __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" :
])
AC_SUBST(HAVE_CPUID_V)
HAVE_VISIBILITY_V=0
AS_IF([test "$enable_asm" != "no"],[
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"
".globl dummy_symbol \n"
".globl _dummy_symbol \n"
"dummy_symbol: \n"
"_dummy_symbol: \n"
" nop \n"
);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_VISIBILITY], [1], [the private_extern asm directive
is supported])
HAVE_VISIBILITY_V=1],
[AC_MSG_RESULT(no)])
])
AC_SUBST(HAVE_VISIBILITY_V)
AC_MSG_CHECKING(if weak symbols are supported)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
__attribute__((weak)) void __dummy(void *x) { }

View File

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

View File

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

View File

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

View File

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

View File

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