All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] musl: Update to tip of trunk
@ 2021-10-29 17:10 Khem Raj
  2021-10-29 17:10 ` [PATCH v2 2/3] site/common-musl: Enable qsort_r in glib Khem Raj
  2021-10-29 17:10 ` [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl Khem Raj
  0 siblings, 2 replies; 5+ messages in thread
From: Khem Raj @ 2021-10-29 17:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

This brings following fixes

* b76f37fd add qsort_r and make qsort a wrapper around it
* 7be59733 add SPE FPU support to powerpc-sf
* e3e7189c fix undefined behavior in getdelim via null pointer arithmetic and memcpy
* b713b8b2 fix excessively slow TLS performance on some mips models
* 3eed6a6f fix error checking in pthread_getname_np

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: No change
v3: Rebased on master-next

 meta/recipes-core/musl/musl_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index a2f96f1dbe..03ab0a449f 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -4,7 +4,7 @@
 require musl.inc
 inherit linuxloader
 
-SRCREV = "3f701faace7addc75d16dea8a6cd769fa5b3f260"
+SRCREV = "b76f37fd5625d038141b52184956fb4b7838e9a5"
 
 BASEVER = "1.2.2"
 
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] site/common-musl: Enable qsort_r in glib
  2021-10-29 17:10 [PATCH v3 1/3] musl: Update to tip of trunk Khem Raj
@ 2021-10-29 17:10 ` Khem Raj
  2021-10-29 17:10 ` [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2021-10-29 17:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

musl now has qsort_r

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased on master-next

 meta/site/common-musl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/site/common-musl b/meta/site/common-musl
index 44a7a1aea9..d990c4e072 100644
--- a/meta/site/common-musl
+++ b/meta/site/common-musl
@@ -23,7 +23,7 @@ ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
 ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
 glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
 glib_cv_long_long_format=${glib_cv_long_long_format=ll}
-glib_cv_have_qsort_r=${glib_cv_have_qsort_r=no}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=yes}
 
 #dbus-glib
 ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl
  2021-10-29 17:10 [PATCH v3 1/3] musl: Update to tip of trunk Khem Raj
  2021-10-29 17:10 ` [PATCH v2 2/3] site/common-musl: Enable qsort_r in glib Khem Raj
@ 2021-10-29 17:10 ` Khem Raj
  2021-10-30 10:10   ` [OE-core] " Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Khem Raj @ 2021-10-29 17:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Rebased on master-next

 ...s-Conside-musl-when-wrapping-qsort_r.patch | 34 +++++++++++++++++++
 .../libsolv/libsolv_0.7.20.bb                 |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch

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 @@
+From 06321f1a2aa89b8e028946e793344657eaad0165 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 28 Oct 2021 22:28:45 -0700
+Subject: [PATCH] utils: Conside musl when wrapping qsort_r
+
+musl now has implemented qsort_r, the signature however matches glibc
+and not BSD, current check makes it such that it falls into BSD case
+when building for musl, which clearly is wrong, therefore instead of
+just checking for glibc check for linux to decide which qsort_r
+signature to use. This covers both glibc and musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util.c b/src/util.c
+index 72426e09..8f29bc5a 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -159,7 +159,7 @@ solv_setcloexec(int fd, int state)
+ 
+    see also: http://sources.redhat.com/ml/libc-alpha/2008-12/msg00003.html
+  */
+-#if (defined(__GLIBC__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R))
++#if (defined(__linux__) || defined(__NEWLIB__)) && (defined(HAVE_QSORT_R) || defined(HAVE___QSORT_R))
+ 
+ void
+ solv_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *compard)
+-- 
+2.33.1
+
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"
 DEPENDS = "expat zlib"
 
 SRC_URI = "git://github.com/openSUSE/libsolv.git;branch=master \
+           file://0001-utils-Conside-musl-when-wrapping-qsort_r.patch \
 "
 
 SRCREV = "f618e6aae1d44be633b2ab91d4fd4f4f974f4d40"
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl
  2021-10-29 17:10 ` [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl Khem Raj
@ 2021-10-30 10:10   ` Richard Purdie
  2021-10-30 14:34     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2021-10-30 10:10 UTC (permalink / raw)
  To: Khem Raj, openembedded-core

On Fri, 2021-10-29 at 10:10 -0700, Khem Raj wrote:
> 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
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Rebased on master-next
> 
>  ...s-Conside-musl-when-wrapping-qsort_r.patch | 34 +++++++++++++++++++
>  .../libsolv/libsolv_0.7.20.bb                 |  1 +
>  2 files changed, 35 insertions(+)
>  create mode 100644 meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch
> 
> 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 @@
> +From 06321f1a2aa89b8e028946e793344657eaad0165 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Thu, 28 Oct 2021 22:28:45 -0700
> +Subject: [PATCH] utils: Conside musl when wrapping qsort_r
> +
> +musl now has implemented qsort_r, the signature however matches glibc
> +and not BSD, current check makes it such that it falls into BSD case
> +when building for musl, which clearly is wrong, therefore instead of
> +just checking for glibc check for linux to decide which qsort_r
> +signature to use. This covers both glibc and musl
> +
> +Upstream-Status: Pending

Can we submit this upstream?

It is a bit unfortunate that it looks like you can't build with old and new musl
at the same time :(

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl
  2021-10-30 10:10   ` [OE-core] " Richard Purdie
@ 2021-10-30 14:34     ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2021-10-30 14:34 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Sat, Oct 30, 2021 at 3:10 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Fri, 2021-10-29 at 10:10 -0700, Khem Raj wrote:
> > 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
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > v2: Rebased on master-next
> >
> >  ...s-Conside-musl-when-wrapping-qsort_r.patch | 34 +++++++++++++++++++
> >  .../libsolv/libsolv_0.7.20.bb                 |  1 +
> >  2 files changed, 35 insertions(+)
> >  create mode 100644 meta/recipes-extended/libsolv/libsolv/0001-utils-Conside-musl-when-wrapping-qsort_r.patch
> >
> > 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 @@
> > +From 06321f1a2aa89b8e028946e793344657eaad0165 Mon Sep 17 00:00:00 2001
> > +From: Khem Raj <raj.khem@gmail.com>
> > +Date: Thu, 28 Oct 2021 22:28:45 -0700
> > +Subject: [PATCH] utils: Conside musl when wrapping qsort_r
> > +
> > +musl now has implemented qsort_r, the signature however matches glibc
> > +and not BSD, current check makes it such that it falls into BSD case
> > +when building for musl, which clearly is wrong, therefore instead of
> > +just checking for glibc check for linux to decide which qsort_r
> > +signature to use. This covers both glibc and musl
> > +
> > +Upstream-Status: Pending
>
> Can we submit this upstream?
>
> It is a bit unfortunate that it looks like you can't build with old and new musl
> at the same time :(

Yes I plan to, but I have realized that replacing glibc only check
with linux check is
a bit too greedy where it will include other linux platforms like
android and additionally
ignore some like kfreebsd. So need to confirm that even though it does
not bother
OE it might bother upstream.

interesting that it does not work with older musl since I expect the
second part of check to
trigger, so I wonder why configure defines HAVE_QSORT_R or HAVE___QSORT_R
when they are absent in older musl.

>
> Cheers,
>
> Richard
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-30 14:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 17:10 [PATCH v3 1/3] musl: Update to tip of trunk Khem Raj
2021-10-29 17:10 ` [PATCH v2 2/3] site/common-musl: Enable qsort_r in glib Khem Raj
2021-10-29 17:10 ` [PATCH v2 3/3] libsolv: Enable correct qsort_r on musl Khem Raj
2021-10-30 10:10   ` [OE-core] " Richard Purdie
2021-10-30 14:34     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.