[OE-core] [PATCH 3/3] elfutils: Fix eu-* utils builds for musl

Adrian Bunk bunk at stusta.de
Thu May 23 15:37:37 UTC 2019


On Thu, May 23, 2019 at 06:52:23AM -0700, Khem Raj wrote:
> On Wed, May 22, 2019 at 11:10 PM Adrian Bunk <bunk at stusta.de> wrote:
> 
> > On Wed, May 22, 2019 at 04:29:33PM -0700, Khem Raj wrote:
> > > On Tue, May 21, 2019 at 11:49 PM Adrian Bunk <bunk at stusta.de> wrote:
> > > >
> > > > On Tue, May 21, 2019 at 06:32:28PM -0700, Khem Raj wrote:
> > > > >...
> > > > > PN and PN-binutils is not empty anymore on musl
> > > > >...
> > > > > ++#if !defined(FNM_EXTMATCH)
> > > > > ++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching.
> > */
> > > > > ++#endif
> > > > >...
> > > >
> > > > This might fix the compilation, but it is horribly wrong.
> > > >
> > > > It passes a flag to a function that this function does not understand.
> > > >
> > > > In the best case the function returns with an error on unknown flags.
> > > >
> > > > In the worst case the function does silently something different from
> > > > what the caller expects it to do.
> > > >
> > >
> > > I forgot that the API is provided by libc here so mimic'ing the define
> > > infact could
> > > cause pain. I think its better to nullify it in this case where it is
> > > being used in these
> > > files.
> >
> > Just looking at the usage in src/elfcompress.c, my first impression is
> > that this tool is mostly useless without a properly working FNM_EXTMATCH.
> >
> > Are the eu-* utils actually important in the cases where space is so
> > limited that people are forced to use musl instead of glibc?
> >
> >
> They are primarily needed for testing and now we have good auto testing
> infra it would be good to build them

Known-broken code is not a good basis for testing.

When I build elfutils locally on my x86_64 desktop and run "make check"
all tests pass (with 3 skipped tests).

Adding
  #undef FNM_EXTMATCH
  #define FNM_EXTMATCH 0
to the defines in src/elfcompress.c gives me one test failure.

That could have easily been a day wasted by someone debugging why this 
test failed with musl.

If these tests are really important the fnmatch replacement from gnulib 
might help, similar to the other cases where missing functionality is 
added from gnulib to add functionality for musl builds (e.g. argp, fts).

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