diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-09-07 22:48:33 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-09 22:14:41 +0100 |
commit | 32c98e6a8cd60aa5d2e60ab7b573ec6abae85ed4 (patch) | |
tree | 19cbe74d4c81378ba418e075ad78b22ffadecadf /meta | |
parent | 9e85a4cbcaf9a30c2d4af1f46289a59db752c863 (diff) | |
download | poky-32c98e6a8cd60aa5d2e60ab7b573ec6abae85ed4.tar.gz |
apr: Fix ptests on musl
musl does not implement dlclose [1] the way apr tests it will always
fail, even though it is per posix. Backport a relevant fix
[1] https://wiki.musl-libc.org/functional-differences-from-glibc.html#Unloading-libraries
(From OE-Core rev: cc694b2dcaa8df255f39feff0b99b8b10090bc4f)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-support/apr/apr/0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch | 37 | ||||
-rw-r--r-- | meta/recipes-support/apr/apr_1.7.4.bb | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-support/apr/apr/0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch b/meta/recipes-support/apr/apr/0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch new file mode 100644 index 0000000000..8ba181b887 --- /dev/null +++ b/meta/recipes-support/apr/apr/0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From a25be1aaa92a6d2e7f4cc3fdfbb92e5a10b63035 Mon Sep 17 00:00:00 2001 | ||
2 | From: Greg Beard <gmbeard@googlemail.com> | ||
3 | Date: Sat, 25 Mar 2023 08:31:36 +0000 | ||
4 | Subject: [PATCH] dso: Check for NULL handle in apr_dso_sym | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/apache/apr/pull/40/commits/0efce00093b1ba405d91c7f0eab9755c8527eead] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | dso/unix/dso.c | 12 ++++++++++++ | ||
10 | 1 file changed, 12 insertions(+) | ||
11 | |||
12 | diff --git a/dso/unix/dso.c b/dso/unix/dso.c | ||
13 | index fdd56f1..583d5de 100644 | ||
14 | --- a/dso/unix/dso.c | ||
15 | +++ b/dso/unix/dso.c | ||
16 | @@ -173,6 +173,18 @@ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, | ||
17 | apr_dso_handle_t *handle, | ||
18 | const char *symname) | ||
19 | { | ||
20 | + /* This is necessary for `testdso.c`. For some reason, musl | ||
21 | + * builds fail the `test_unload_library` test if the below | ||
22 | + * check isn't in place. `test_unload_library` unloads the | ||
23 | + * library and then immediately calls this function. Maybe | ||
24 | + * musl's `dlsym()` assumes the handle is never NULL and | ||
25 | + * some UB is being invoked here... | ||
26 | + */ | ||
27 | + if (handle->handle == NULL) { | ||
28 | + handle->errormsg = "library not loaded"; | ||
29 | + return APR_ESYMNOTFOUND; | ||
30 | + } | ||
31 | + | ||
32 | #if defined(DSO_USE_SHL) | ||
33 | void *symaddr = NULL; | ||
34 | int status; | ||
35 | -- | ||
36 | 2.42.0 | ||
37 | |||
diff --git a/meta/recipes-support/apr/apr_1.7.4.bb b/meta/recipes-support/apr/apr_1.7.4.bb index 5ac7f4b93f..d322629b66 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 \ | |||
23 | file://0001-Add-option-to-disable-timed-dependant-tests.patch \ | 23 | file://0001-Add-option-to-disable-timed-dependant-tests.patch \ |
24 | file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \ | 24 | file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \ |
25 | file://autoconf-2.73.patch \ | 25 | file://autoconf-2.73.patch \ |
26 | file://0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | SRC_URI[sha256sum] = "fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577" | 29 | SRC_URI[sha256sum] = "fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577" |