diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-10-29 10:10:22 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-01 10:41:18 +0000 |
commit | 671aa4424ae18f5a40d8770de80115004221ae47 (patch) | |
tree | f09b11ec25f896164f01392b46a15180cd50f9f4 | |
parent | 887fa42d4499f9361feff2601882faf850db40f2 (diff) | |
download | poky-671aa4424ae18f5a40d8770de80115004221ae47.tar.gz |
libsolv: Enable correct qsort_r on musl
Newer musl now has this function implemented and signatures are same as
glibc, current codepaths forces it on BSD path which is wrong for musl
and results in random segfaults in apps using libsolv e.g. opkg
(From OE-Core rev: caf0457ef1e081eed177ade5e727dd7aa3f41bdd)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch | 34 | ||||
-rw-r--r-- | meta/recipes-extended/libsolv/libsolv_0.7.20.bb | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch b/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch new file mode 100644 index 0000000000..6f0dea2e9c --- /dev/null +++ b/meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 06321f1a2aa89b8e028946e793344657eaad0165 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 28 Oct 2021 22:28:45 -0700 | ||
4 | Subject: [PATCH] utils: Conside musl when wrapping qsort_r | ||
5 | |||
6 | musl now has implemented qsort_r, the signature however matches glibc | ||
7 | and not BSD, current check makes it such that it falls into BSD case | ||
8 | when building for musl, which clearly is wrong, therefore instead of | ||
9 | just checking for glibc check for linux to decide which qsort_r | ||
10 | signature to use. This covers both glibc and musl | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | src/util.c | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/util.c b/src/util.c | ||
20 | index 72426e09..8f29bc5a 100644 | ||
21 | --- a/src/util.c | ||
22 | +++ b/src/util.c | ||
23 | @@ -159,7 +159,7 @@ solv_setcloexec(int fd, int state) | ||
24 | |||
25 | see also: http://sources.redhat.com/ml/libc-alpha/2008-12/msg00003.html | ||
26 | */ | ||
27 | -#if (defined(__GLIBC__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R)) | ||
28 | +#if (defined(__linux__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R)) | ||
29 | |||
30 | void | ||
31 | solv_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *compard) | ||
32 | -- | ||
33 | 2.33.1 | ||
34 | |||
diff --git a/meta/recipes-extended/libsolv/libsolv_0.7.20.bb b/meta/recipes-extended/libsolv/libsolv_0.7.20.bb index 6861def533..21017c3902 100644 --- a/meta/recipes-extended/libsolv/libsolv_0.7.20.bb +++ b/meta/recipes-extended/libsolv/libsolv_0.7.20.bb | |||
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8" | |||
9 | DEPENDS = "expat zlib" | 9 | DEPENDS = "expat zlib" |
10 | 10 | ||
11 | SRC_URI = "git://github.com/openSUSE/libsolv.git;branch=master \ | 11 | SRC_URI = "git://github.com/openSUSE/libsolv.git;branch=master \ |
12 | file://0001-utils-Conside-musl-when-wrapping-qsort_r.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRCREV = "f618e6aae1d44be633b2ab91d4fd4f4f974f4d40" | 15 | SRCREV = "f618e6aae1d44be633b2ab91d4fd4f4f974f4d40" |