From f975748713810fba1113895a213849b06b7c27af Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 28 May 2023 01:49:28 +0200 Subject: [PATCH] depends: remove unneeded sodium patches --- contrib/depends/packages/sodium.mk | 5 +- contrib/depends/patches/sodium/ac.patch | 110 ------------------ .../disable-glibc-getrandom-getentropy.patch | 25 ---- .../depends/patches/sodium/fix-arm64.patch | 25 ---- .../patches/sodium/fix-whitespace.patch | 13 --- 5 files changed, 1 insertion(+), 177 deletions(-) delete mode 100644 contrib/depends/patches/sodium/ac.patch delete mode 100644 contrib/depends/patches/sodium/disable-glibc-getrandom-getentropy.patch delete mode 100644 contrib/depends/patches/sodium/fix-arm64.patch delete mode 100644 contrib/depends/patches/sodium/fix-whitespace.patch diff --git a/contrib/depends/packages/sodium.mk b/contrib/depends/packages/sodium.mk index 30b88ee..43f2690 100644 --- a/contrib/depends/packages/sodium.mk +++ b/contrib/depends/packages/sodium.mk @@ -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 diff --git a/contrib/depends/patches/sodium/ac.patch b/contrib/depends/patches/sodium/ac.patch deleted file mode 100644 index 8b48151..0000000 --- a/contrib/depends/patches/sodium/ac.patch +++ /dev/null @@ -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 -+ ], [(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 ]], [[ 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 ]], [[ 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) diff --git a/contrib/depends/patches/sodium/disable-glibc-getrandom-getentropy.patch b/contrib/depends/patches/sodium/disable-glibc-getrandom-getentropy.patch deleted file mode 100644 index 2f07c10..0000000 --- a/contrib/depends/patches/sodium/disable-glibc-getrandom-getentropy.patch +++ /dev/null @@ -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 - #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 - #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 diff --git a/contrib/depends/patches/sodium/fix-arm64.patch b/contrib/depends/patches/sodium/fix-arm64.patch deleted file mode 100644 index a5d739c..0000000 --- a/contrib/depends/patches/sodium/fix-arm64.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 13214d18c6ea1671dcff3dd62ccf88007b41f112 Mon Sep 17 00:00:00 2001 -From: Frank Denis -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 - diff --git a/contrib/depends/patches/sodium/fix-whitespace.patch b/contrib/depends/patches/sodium/fix-whitespace.patch deleted file mode 100644 index c3d3af0..0000000 --- a/contrib/depends/patches/sodium/fix-whitespace.patch +++ /dev/null @@ -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' -