Use a link rather than compile test to for __builtin_bswap64 in libnettle;

fixes little-endian base-gcc (mips64el). From George Koehler, tested by
manphiz@gmail.com, ok aja@.
This commit is contained in:
sthen 2019-12-04 10:36:34 +00:00
parent 9676b2edca
commit 4c39430a5d
2 changed files with 15 additions and 2 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.24 2019/06/29 22:26:25 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.25 2019/12/04 10:36:34 sthen Exp $
COMMENT= cryptographic library
DISTNAME= nettle-3.5.1
PKGNAME= lib${DISTNAME}
REVISION= 0
SHARED_LIBS += hogweed 3.0 # 6.5
SHARED_LIBS += nettle 5.0 # 4.5

View File

@ -1,4 +1,7 @@
$OpenBSD: patch-configure,v 1.8 2019/06/29 22:26:25 ajacoutot Exp $
$OpenBSD: patch-configure,v 1.9 2019/12/04 10:36:34 sthen Exp $
The test for __builtin_bswap64 must fail if the linker can't find the
symbol. We need this for base-gcc on little endian, like mips64el.
Fix relocation errors on (at least) sparc64.
@ -7,6 +10,15 @@ We don't want extra debug flags in regular builds.
Index: configure
--- configure.orig
+++ configure
@@ -6062,7 +6062,7 @@ uint64_t y = __builtin_bswap64(x);
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
nettle_cv_c_builtin_bswap64=yes
else
nettle_cv_c_builtin_bswap64=no
@@ -6720,6 +6720,7 @@ else
bsdi4.*) CCPIC="-fPIC" ;;
bsdi*) CCPIC="" ;;