[OE-core] [PATCH v2] elfutils: add PACKAGECONFIG for compression algorithms

Dan Callaghan dan.callaghan at opengear.com
Tue Oct 15 07:21:04 UTC 2019


Excerpts from Jacob Kroon's message of 2019-10-15 08:59:56 +02:00:
> Den 2019-10-15 kl. 08:15, skrev Dan Callaghan:
> > @@ -46,8 +46,12 @@ SRC_URI[sha256sum] 
> > = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc
> >
> >   inherit autotools gettext ptest
> >
> > -EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
> > -EXTRA_OECONF_append_class-native = " --without-bzlib"
> > +EXTRA_OECONF = "--program-prefix=eu-"
> > +
> > +PACKAGECONFIG ??= "bzip2"
> > +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,bzip2"
> > +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
> > +
> >   RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
> >
> >   EXTRA_OECONF_append_class-target += "--disable-tests-rpath"
> >
> 
> If I get it correctly, previously the recipe depended on bzip2, but for
> native it was actually disabled at configure time. Can't we just skip it
> for native then, since it hasn't been required sofar ?
> 
> You can do
> 
> PACKAGECONFIG_class-native = ""

Yes true, that would work, although it seems like needless complication 
to have different build configurations for the target recipe and native 
variant.

Anyway, I figured out why the --without-bzlib was originally added for 
the native variant. The commit message wasn't clear to me, but I have 
seen the problem in action now.

I saw that elfutils-native correctly depends on bzip2-native, and the 
build worked on my PC. But it was actually the host bzip2 library 
leaking into the build.

Poky has "bzip2-native" in ASSUME_PROVIDED. Presumably, this is because 
bzip2 (the command line program) is a required host tool and so there is 
no need to build bzip2-native just to get a working bzip2 program.

However that also means that bzip2-native libraries and headers are 
silently omitted from the recipe-sysroot-native for elfutils-native, 
even though it depends on bzip2-native. On our Jenkins, which has a very 
minimal build environment and lacks the bzip2 headers, elfutils-native 
fails to configure:

    | checking for library containing BZ2_bzdopen... no
    | configure: error: missing -lbz2 for --with-bzlib

It seems to me the real problem here is that "bzip2-native" does not 
really belong in ASSUME_PROVIDED. Recipes can assume that the host 
provides the bzip2 *command* but not necessarily its headers and 
libraries.

So now I am not quite sure what to do...

-- 
Dan Callaghan <dan.callaghan at opengear.com>
Software Engineer
Opengear <https://opengear.com/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20191015/11af6fc3/attachment.sig>


More information about the Openembedded-core mailing list