aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-08-29 01:09:46 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2021-08-29 01:09:46 +0200
commit3be643a3c0a70d2f597c7703018514d9e89ed9a1 (patch)
treec0bd71bceab94bca716d0ef52ac07cdf62bee884
parentf8500bc4d3233c10c14a38950c38c9c85c3bae0d (diff)
downloadaports-3be643a3c0a70d2f597c7703018514d9e89ed9a1.tar.gz
aports-3be643a3c0a70d2f597c7703018514d9e89ed9a1.tar.bz2
aports-3be643a3c0a70d2f597c7703018514d9e89ed9a1.tar.xz
main/cryptsetup: Use upstream patch for all-symbols test
-rw-r--r--main/cryptsetup/0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch121
-rw-r--r--main/cryptsetup/APKBUILD8
-rw-r--r--main/cryptsetup/disable-all-symbols-test.patch35
3 files changed, 125 insertions, 39 deletions
diff --git a/main/cryptsetup/0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch b/main/cryptsetup/0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch
new file mode 100644
index 0000000000..f7b3109678
--- /dev/null
+++ b/main/cryptsetup/0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch
@@ -0,0 +1,121 @@
+From 20b678c9f3a25c5777c8790f21a773f5657c60f0 Mon Sep 17 00:00:00 2001
+From: Milan Broz <gmazyland@gmail.com>
+Date: Sat, 21 Aug 2021 13:33:13 +0200
+Subject: [PATCH] Fix symbol version test if dlvsym() is not available.
+
+If we have no dlvsym(), just run dlsym() test.
+---
+ configure.ac | 5 +++
+ tests/all-symbols-test.c | 71 ++++++++++++++++++++++++++--------------
+ 2 files changed, 52 insertions(+), 24 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 61fa8b63..48098b41 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,6 +101,11 @@ AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR([You need the uuid library.])])
+ AC_SUBST(UUID_LIBS, $LIBS)
+ LIBS=$saved_LIBS
+
++saved_LIBS=$LIBS
++AC_SEARCH_LIBS([dlsym],[dl])
++AC_CHECK_FUNCS([dlvsym])
++LIBS=$saved_LIBS
++
+ AC_SEARCH_LIBS([clock_gettime],[rt posix4])
+ AC_CHECK_FUNCS([posix_memalign clock_gettime posix_fallocate explicit_bzero])
+
+diff --git a/tests/all-symbols-test.c b/tests/all-symbols-test.c
+index d1bafbdd..adc56162 100644
+--- a/tests/all-symbols-test.c
++++ b/tests/all-symbols-test.c
+@@ -68,34 +68,57 @@ static void test_logf(int level, const char *format, ...)
+ #define log_std(x...) test_logf(LOG_NORMAL, x)
+ #define log_err(x...) test_logf(LOG_ERROR, x)
+
+-static int check_all_symbols(void *h)
++static int check_dlvsym(void *h, const char *symbol, const char *version)
++{
++#ifdef HAVE_DLVSYM
++ void *sym;
++ char *err;
++
++ log_dbg("Checking %s@%s...", symbol, version);
++ sym = dlvsym(h, symbol, version);
++ UNUSED(sym);
++ err = dlerror();
++
++ if (err) {
++ log_err("%s.", err);
++ return 1;
++ }
++
++ log_dbg("OK\n");
++#endif
++ return 0;
++}
++
++static int check_dlsym(void *h, const char *symbol)
+ {
+ void *sym;
+ char *err;
++
++ log_dbg("Checking %s...", symbol);
++ sym = dlsym(h, symbol);
++ UNUSED(sym);
++ err = dlerror();
++
++ if (err) {
++ log_err("%s", err);
++ return 1;
++ }
++
++ log_dbg("OK\n");
++ return 0;
++}
++
++static int check_all_symbols(void *h)
++{
+ unsigned scount = 0;
+
+-#define CHECK_SYMBOL(SYM, VER) \
+-do { \
+- log_dbg("Checking " #SYM "@" #VER "..."); \
+- sym = dlvsym(h, #SYM, #VER); \
+- UNUSED(sym); \
+- err = dlerror(); \
+- \
+- if (err) { \
+- log_err("%s.", err); \
+- return 1; \
+- } \
+- \
+- log_dbg("OK\nChecking " #SYM "..."); \
+- sym = dlsym(h, #SYM); \
+- UNUSED(sym); \
+- err = dlerror(); \
+- if (err) { \
+- log_err("%s", err); \
+- return 1; \
+- } \
+- log_dbg("OK\n"); \
+- scount++; \
++#define CHECK_SYMBOL(SYM, VER) \
++do { \
++ if (check_dlvsym(h, #SYM, #VER)) \
++ return 1; \
++ if (check_dlsym(h, #SYM)) \
++ return 1; \
++ scount++; \
+ } while (0);
+
+ #include "test-symbols-list.h"
+@@ -106,7 +129,7 @@ do { \
+ return 1;
+ }
+
+- log_std("Performed %u symbol checks in total\n.", scount);
++ log_std("Performed %u symbol checks in total.\n", scount);
+
+ return 0;
+ }
diff --git a/main/cryptsetup/APKBUILD b/main/cryptsetup/APKBUILD
index 10d931ff8e..375685a005 100644
--- a/main/cryptsetup/APKBUILD
+++ b/main/cryptsetup/APKBUILD
@@ -1,14 +1,14 @@
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cryptsetup
-pkgver=2.4.0
+pkgver=2.4.0 # XXX: remove automake/autoconf when upgrading to 2.5.0
pkgrel=0
pkgdesc="Userspace setup tool for transparent encryption of block devices using the Linux 2.6 cryptoapi"
url="https://gitlab.com/cryptsetup/cryptsetup"
arch="all"
license="GPL-2.0-or-later WITH OpenSSL-Exception"
makedepends_host="lvm2-dev openssl-dev popt-dev util-linux-dev
- json-c-dev argon2-dev"
+ json-c-dev argon2-dev automake autoconf"
makedepends="$makedepends_build $makedepends_host"
checkdepends="device-mapper sharutils which bash coreutils"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-openrc"
@@ -17,7 +17,7 @@ source="https://www.kernel.org/pub/linux/utils/cryptsetup/v${pkgver%.*}/cryptset
dmcrypt.confd
flush-stdout.patch
- disable-all-symbols-test.patch
+ 0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch
"
# secfixes:
@@ -70,5 +70,5 @@ sha512sums="
a3ca3e648749136ee724692b61488cd855f118eb93435942c2b04964a34fe49d0f0da4ef64cd2531c1c0f650e77808cf5d802789fd7664398248ead668bb35e5 dmcrypt.initd
74422d5e1614b43af894ea01da1ea80d805ec7f77981cbb80a6b1a4becad737a8825d7269812499095a7f50d39fa7da5bf4e4edae63529b1fe87b9176943a733 dmcrypt.confd
529187851def5fbc08e995eba90d3f013f1cf8469dcb9344f83d1e3c73c71467ca4ed62c8282ec27ebfa30ccc33653fdd1aea8d1d80e1ac4293d51865c9a6200 flush-stdout.patch
-62ba40047110a5ac9bd51584b9c66aec11f2fe08d7c7512bf38e7f6965666c42b49cdc409619dc0c9e4d8c36578dcafd4b7b57b493231b99cddea6a856021238 disable-all-symbols-test.patch
+1255ca3507d1476145f210b9e13f972ec1eb77e1325f69ee8d3748871819dd6f6d02e2eccf101ebd30478d2676d2486a51ed204b2fe23ed10eb56ce4a7c441f8 0001-Fix-symbol-version-test-if-dlvsym-is-not-available.patch
"
diff --git a/main/cryptsetup/disable-all-symbols-test.patch b/main/cryptsetup/disable-all-symbols-test.patch
deleted file mode 100644
index fd4fb007ea..0000000000
--- a/main/cryptsetup/disable-all-symbols-test.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-The all-symbol-test.c file requires dlvsym which is a GNU extension and
-presently not available on musl libc. This patch essentially makes
-check_all_symbols a no-op, thereby disabling it without requiring
-rebuilding the automake Makefiles.
-
-diff -upr cryptsetup-2.4.0.orig/tests/all-symbols-test.c cryptsetup-2.4.0/tests/all-symbols-test.c
---- cryptsetup-2.4.0.orig/tests/all-symbols-test.c 2021-08-18 19:40:14.751188763 +0200
-+++ cryptsetup-2.4.0/tests/all-symbols-test.c 2021-08-18 19:42:29.727938025 +0200
-@@ -70,6 +70,7 @@ static void test_logf(int level, const c
-
- static int check_all_symbols(void *h)
- {
-+#ifdef __GLIBC__
- void *sym;
- char *err;
- unsigned scount = 0;
-@@ -98,15 +99,15 @@ do { \
- scount++; \
- } while (0);
-
--#include "test-symbols-list.h"
--#undef CHECK_SYMBOL
--
- if (!scount) {
- log_err("test-symbols-list.h file is probably empty.");
- return 1;
- }
-
- log_std("Performed %u symbol checks in total\n.", scount);
-+#include "test-symbols-list.h"
-+#undef CHECK_SYMBOL
-+#endif
-
- return 0;
- }