depends: remove unneeded sodium patches

This commit is contained in:
tobtoht 2023-05-28 01:49:28 +02:00
parent ecfcd728ce
commit f975748713
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
5 changed files with 1 additions and 177 deletions

View file

@ -3,7 +3,6 @@ $(package)_version=1.0.18
$(package)_download_path=https://download.libsodium.org/libsodium/releases/
$(package)_file_name=libsodium-$($(package)_version).tar.gz
$(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
$(package)_patches=disable-glibc-getrandom-getentropy.patch fix-whitespace.patch
define $(package)_set_vars
$(package)_config_opts=--enable-static --disable-shared
@ -12,9 +11,7 @@ endef
define $(package)_preprocess_cmds
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ && \
patch -p1 < $($(package)_patch_dir)/disable-glibc-getrandom-getentropy.patch &&\
autoconf &&\
patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch
autoconf
endef
define $(package)_config_cmds

View file

@ -1,110 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 9e2de27c..6b17c020 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,10 @@ AS_IF([pwd | fgrep ' ' > /dev/null 2>&1],
[AC_MSG_ERROR([The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions])]
)
+AC_PROG_CC_C99
+AM_PROG_AS
+AC_USE_SYSTEM_EXTENSIONS
+
dnl Switches
AC_ARG_ENABLE(ssp,
@@ -210,17 +214,11 @@ AX_VALGRIND_CHECK
dnl Checks
-AC_PROG_CC_C99
-AM_PROG_AS
-AC_USE_SYSTEM_EXTENSIONS
AC_C_VARARRAYS
AC_CHECK_DEFINE([__wasi__], [WASI="yes"], [])
-AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [
- AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2],
- [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"])
-])
+AS_CASE([$host_os], [linux-gnu], [AX_ADD_FORTIFY_SOURCE], [ ])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
[CFLAGS="$CFLAGS -fvisibility=hidden"])
@@ -343,9 +341,11 @@ AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wswitch-enum], [CWFLAGS="$CWFLAGS -Wswitch-enum
AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wvariable-decl], [CWFLAGS="$CWFLAGS -Wvariable-decl"])
AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wwrite-strings], [CWFLAGS="$CWFLAGS -Wwrite-strings"])
-AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"])
-AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"])
-AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"])
+AS_IF([test "x$EMSCRIPTEN" = "x"], [
+ AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"])
+ AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"])
+ AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"])
+])
AX_CHECK_CATCHABLE_SEGV
AX_CHECK_CATCHABLE_ABRT
@@ -362,10 +362,51 @@ AC_SUBST(LIBTOOL_DEPS)
AC_ARG_VAR([AR], [path to the ar utility])
AC_CHECK_TOOL([AR], [ar], [ar])
-dnl Checks for headers
+dnl Checks for headers and codegen feature flags
+
+target_cpu_aarch64=no
+AC_MSG_CHECKING(for ARM64 target)
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#ifndef __aarch64__
+#error Not aarch64
+#endif
+#include <arm_neon.h>
+ ], [(void) 0])],
+ [AC_MSG_RESULT(yes)
+ target_cpu_aarch64=yes],
+ [AC_MSG_RESULT(no)
+ target_cpu_aarch64=no])
AS_IF([test "x$EMSCRIPTEN" = "x"], [
+ AS_IF([test "x$target_cpu_aarch64" = "xyes"], [
+ have_armcrypto=no
+ AC_MSG_CHECKING(for ARM crypto instructions set)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arm_neon.h>]], [[ vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(__ARM_FEATURE_CRYPTO)) ]])],
+ [
+ AC_MSG_RESULT(yes)
+ have_armcrypto=yes
+ ],
+ [
+ AC_MSG_RESULT(no)
+ oldcflags="$CFLAGS"
+ AX_CHECK_COMPILE_FLAG([-march=armv8-a+crypto], [
+ CFLAGS="$CFLAGS -march=armv8-a+crypto"
+ AC_MSG_CHECKING(for ARM crypto instructions set with -march=armv8-a+crypto)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arm_neon.h>]], [[ vaeseq_u8(vmovq_n_u8(0), vmovq_n_u8(__ARM_FEATURE_CRYPTO)) ]])],
+ [
+ AC_MSG_RESULT(yes)
+ have_armcrypto=yes
+ CFLAGS_ARMCRYPTO="-march=armv8-a+crypto"
+ ],
+ [AC_MSG_RESULT(no)])
+ CFLAGS="$oldcflags"
+ ])
+ ])
+ AS_IF([test "$have_armcrypto" = "yes"],[AC_DEFINE([HAVE_ARMCRYPTO], [1], [ARM crypto extensions are available])])
+ ])
+
oldcflags="$CFLAGS"
AX_CHECK_COMPILE_FLAG([-mmmx], [CFLAGS="$CFLAGS -mmmx"])
AC_MSG_CHECKING(for MMX instructions set)
@@ -542,6 +583,7 @@ __m512i y = _mm512_permutexvar_epi64(_mm512_setr_epi64(0, 1, 4, 5, 2, 3, 6, 7),
])
+AC_SUBST(CFLAGS_ARMCRYPTO)
AC_SUBST(CFLAGS_MMX)
AC_SUBST(CFLAGS_SSE2)
AC_SUBST(CFLAGS_SSE3)

View file

@ -1,25 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 9e2de27c..0fa85c2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -807,6 +807,10 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[
# include <sys/random.h>
#endif
]], [[
+#ifdef __linux__
+# error getrandom() is currently disabled on Linux to support glibc < 2.25
+#endif
+
unsigned char buf;
(void) getrandom((void *) &buf, 1U, 0U);
]])],
@@ -825,6 +829,9 @@ unsigned char buf;
# include <sys/random.h>
#endif
]], [[
+#ifdef __linux__
+# error getentropy() is currently disabled on Linux to support glibc < 2.25
+#endif
#ifdef __APPLE__
# error getentropy() is currently disabled on Apple operating systems
#endif

View file

@ -1,25 +0,0 @@
From 13214d18c6ea1671dcff3dd62ccf88007b41f112 Mon Sep 17 00:00:00 2001
From: Frank Denis <github@pureftpd.org>
Date: Wed, 1 Jul 2020 15:33:52 +0200
Subject: [PATCH] Recognize the arm + apple combo as aarch64
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 05a51fa5..3993dbc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,8 @@ AX_VALGRIND_CHECK
dnl Checks
+AS_IF([test "$host_cpu" = "arm" && test "$host_vendor" = "apple"], [host_cpu=aarch64])
+
AC_C_VARARRAYS
AC_CHECK_DEFINE([__wasi__], [WASI="yes"], [])
--
2.38.1

View file

@ -1,13 +0,0 @@
diff --git a/configure b/configure
index b29f769..ca008ae 100755
--- a/configure
+++ b/configure
@@ -591,7 +591,7 @@ MAKEFLAGS=
PACKAGE_NAME='libsodium'
PACKAGE_TARNAME='libsodium'
PACKAGE_VERSION='1.0.18'
-PACKAGE_STRING='libsodium 1.0.18'
+PACKAGE_STRING='libsodium'
PACKAGE_BUGREPORT='https://github.com/jedisct1/libsodium/issues'
PACKAGE_URL='https://github.com/jedisct1/libsodium'