[OE-core] musl thoughts

Khem Raj raj.khem at gmail.com
Mon Mar 25 17:44:28 UTC 2019


On Sat, Mar 23, 2019 at 2:16 PM Adrian Bunk <bunk at stusta.de> wrote:
>
> On Fri, Mar 22, 2019 at 03:18:01PM -0700, Khem Raj wrote:
> >...
> > There are certain design aspects of musl which are actually turning
> > out to be good
> > e.g. there is no __MUSL__ define, so non-portable code can not be
> > hidden which is a good thing,
> >...
>
> Please take a closer look at some of the musl changes to NM that made
> upgrading NM so hard for Andreas.
>
> +#if defined(__GLIBC__)
>  #include <net/ethernet.h>
> +#else /* musl libc */
> +#define ETH_ALEN       6               /* Octets in one ethernet addr   */
> +#endif
>
> Using __GLIBC__ in workarounds for bugs in musl is wrong,
> and cannot be upstreamed since it would do the wrong thing
> on other non-broken C libraries.

yes, not everything that fixed builds for musl are golden, and some
are workarounds
as above which obviously can't be upstreamed, my comments were from
overall perspective
not specific to network manager patches

>
> > While the eyes may hurt
> > to see them, it does serve a
> > good reminder of whats needed for a given package.
> >...
>
> Who is responsible for fixing the root causes of such bugs in musl,

your concluded its a bug in musl, probably based on the patch but its
one sided view
musl is calling out namespace collisions etc. see

https://www.openwall.com/lists/musl/2012/10/11/4

so obviously, we need to make sure that kernel headers are not written
with an assumption
that glibc is only options when it comes to C libraries, but there are
such assumptions as well unfortunately

> so that the workaround patches can be dropped from packages like NM?

I think the right approach is to fix the problem where it belongs, and
generally making changes to headers
is a long term approach but is right one until then live with
temporary solutions. there has been changes in
kernel headers which fixes such assumptions broken by musl e.g. see

https://patchwork.kernel.org/cover/10724549/

We have to take more portable approach and I think its better for everyone.
>
> cu
> Adrian
>
> --
>
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
>


More information about the Openembedded-core mailing list