diff mbox series

apr: Fix ptests on musl

Message ID 20230906040939.1386757-1-raj.khem@gmail.com
State Accepted, archived
Commit cc694b2dcaa8df255f39feff0b99b8b10090bc4f
Headers show
Series apr: Fix ptests on musl | expand

Commit Message

Khem Raj Sept. 6, 2023, 4:09 a.m. UTC
musl does not implement dlclose [1] the way apr tests it will always
fail, even though it is per posix. Therefore ignore the unload tests

[1] https://wiki.musl-libc.org/functional-differences-from-glibc.html#Unloading-libraries

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-testdso-Do-not-test-dlclone-on-musl.patch | 42 +++++++++++++++++++
 meta/recipes-support/apr/apr_1.7.4.bb         |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-support/apr/apr/0001-testdso-Do-not-test-dlclone-on-musl.patch

Comments

Alexander Kanavin Sept. 6, 2023, 5:45 a.m. UTC | #1
On Wed, 6 Sept 2023 at 06:09, Khem Raj <raj.khem@gmail.com> wrote:
> +Subject: [PATCH] testdso: Do not test dlclone on musl
> +
> +Upstream-Status: Inappropriate [Musl specific]

Let's try to avoid adding more invasive patches that need to be
rebased forever. This certainly can be offered upstream, please do so.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-support/apr/apr/0001-testdso-Do-not-test-dlclone-on-musl.patch b/meta/recipes-support/apr/apr/0001-testdso-Do-not-test-dlclone-on-musl.patch
new file mode 100644
index 00000000000..eb17dab4a25
--- /dev/null
+++ b/meta/recipes-support/apr/apr/0001-testdso-Do-not-test-dlclone-on-musl.patch
@@ -0,0 +1,42 @@ 
+From 4b9243f46948c3c22b36c63694c41e9fdf90dfe9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 5 Sep 2023 17:25:45 -0700
+Subject: [PATCH] testdso: Do not test dlclone on musl
+
+Upstream-Status: Inappropriate [Musl specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/testdso.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/test/testdso.c b/test/testdso.c
+index 0d9f27b..54f166f 100644
+--- a/test/testdso.c
++++ b/test/testdso.c
+@@ -244,15 +244,22 @@ abts_suite *testdso(abts_suite *suite)
+     abts_run_test(suite, test_load_module, NULL);
+     abts_run_test(suite, test_dso_sym, NULL);
+     abts_run_test(suite, test_dso_sym_return_value, NULL);
++#if defined(__linux__) && !defined(__GLIBC__)
++    /* dlclose is a no-op on musl */
++#else
+     abts_run_test(suite, test_unload_module, NULL);
+-
++#endif
+ #ifdef LIB_NAME
+     apr_filepath_merge(&libname, NULL, LIB_NAME, 0, p);
+     
+     abts_run_test(suite, test_load_library, NULL);
+     abts_run_test(suite, test_dso_sym_library, NULL);
+     abts_run_test(suite, test_dso_sym_return_value_library, NULL);
++#if defined(__linux__) && !defined(__GLIBC__)
++    /* dlclose is a no-op on musl */
++#else
+     abts_run_test(suite, test_unload_library, NULL);
++#endif
+ #endif
+ 
+     abts_run_test(suite, test_load_notthere, NULL);
+-- 
+2.42.0
+
diff --git a/meta/recipes-support/apr/apr_1.7.4.bb b/meta/recipes-support/apr/apr_1.7.4.bb
index 5ac7f4b93f7..92948a82ddd 100644
--- a/meta/recipes-support/apr/apr_1.7.4.bb
+++ b/meta/recipes-support/apr/apr_1.7.4.bb
@@ -23,6 +23,7 @@  SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
            file://0001-Add-option-to-disable-timed-dependant-tests.patch \
            file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \
            file://autoconf-2.73.patch \
+           file://0001-testdso-Do-not-test-dlclone-on-musl.patch \
            "
 
 SRC_URI[sha256sum] = "fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577"