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

2019-10-30 Thread Ross Burton

On 29/10/2019 21:46, Dan Callaghan wrote:

I couldn't find anything that would ever use the bzip2 decompression in
elfutils, so I had a quick look at why they even added bzip2 support in
the first place. It turns out it was for reading compressed kernel
images (presumably, in the elfutils tools like eu-readelf):

https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98

 commit d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98
 Author: Roland McGrath 
 Date:   Wed Aug 26 00:23:01 2009 -0700

 libdwfl: Support Linux bzip2 kernel images for automatic decompression.

And indeed on my Fedora host eu-readelf can decode ELF information from
a kernel bzImage, but the eu-readelf built by Yocto's elfutils-native
recipe says "not a valid ELF file" when I feed it the same bzImage.

Whether that's useful or not is a different question. In our product
I am planning to disable bzip2 (because we don't use the elfutils tools
for anything) and enable xz (for .gnu_debugdata sections).


Good digging, thanks.

Lets default to bzip being off for now, and then if anyone does want 
this then they can just turn it on.


Ross
--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

2019-10-29 Thread Dan Callaghan
Excerpts from Adrian Bunk's message of 2019-10-29 22:18:21 +02:00:
> On Wed, Oct 16, 2019 at 08:44:56AM +1000, Dan Callaghan wrote:
> > Elfutils has optional support for bzip2 and xz (lzma). It uses
> > this for decompressing embedded ELF sections like the .gnu_debugdata
> > section for "mini debuginfo":
> >
> > https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
> >...
> > +PACKAGECONFIG ??= "bzip2"
> > +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
> > +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
> >...
> 
> Is any tooling actually doing this compression by default?
> 
> It is a bit surprising that this has the mostly-obsolete bzip2 enabled
> by default but not the more common (and better compressing) xz.

I couldn't find anything that would ever use the bzip2 decompression in 
elfutils, so I had a quick look at why they even added bzip2 support in 
the first place. It turns out it was for reading compressed kernel 
images (presumably, in the elfutils tools like eu-readelf):

https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98

commit d6ccdc1a05f27bf0bb5d802ec14f879aa9fe3e98
Author: Roland McGrath 
Date:   Wed Aug 26 00:23:01 2009 -0700

libdwfl: Support Linux bzip2 kernel images for automatic decompression.

And indeed on my Fedora host eu-readelf can decode ELF information from 
a kernel bzImage, but the eu-readelf built by Yocto's elfutils-native 
recipe says "not a valid ELF file" when I feed it the same bzImage.

Whether that's useful or not is a different question. In our product 
I am planning to disable bzip2 (because we don't use the elfutils tools 
for anything) and enable xz (for .gnu_debugdata sections).

-- 
Dan Callaghan 
Software Engineer
Opengear 


signature.asc
Description: PGP signature
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

2019-10-29 Thread Ross Burton

On 29/10/2019 20:18, Adrian Bunk wrote:

On Wed, Oct 16, 2019 at 08:44:56AM +1000, Dan Callaghan wrote:

Elfutils has optional support for bzip2 and xz (lzma). It uses
this for decompressing embedded ELF sections like the .gnu_debugdata
section for "mini debuginfo":

https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
...
+PACKAGECONFIG ??= "bzip2"
+PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
+PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
...


Is any tooling actually doing this compression by default?

It is a bit surprising that this has the mostly-obsolete bzip2 enabled
by default but not the more common (and better compressing) xz.


Exactly.

Ross
--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

2019-10-29 Thread Adrian Bunk
On Wed, Oct 16, 2019 at 08:44:56AM +1000, Dan Callaghan wrote:
> Elfutils has optional support for bzip2 and xz (lzma). It uses
> this for decompressing embedded ELF sections like the .gnu_debugdata
> section for "mini debuginfo":
> 
> https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
>...
> +PACKAGECONFIG ??= "bzip2"
> +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
> +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
>...

Is any tooling actually doing this compression by default?

It is a bit surprising that this has the mostly-obsolete bzip2 enabled 
by default but not the more common (and better compressing) xz.

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

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

2019-10-29 Thread Ross Burton

On 22/10/2019 13:53, Richard Purdie wrote:

Breaks nativesdk-elftutils:

https://autobuilder.yoctoproject.org/typhoon/#/builders/62/builds/1157

Probably need to do:

DEPENDS_BZIP2 = "bzip2"
DEPENDS_BZIP2_class-native = "bzip2-replacement-native"


but I still think the default should be bzip2 off for -native unless
someone can tell me why we need it. That would mean adding something
like:

PACKAGECONFIG_class-native ??= ""


Proposal: lets just disable bzip2 support in elfutils by default.

Ross
--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

2019-10-22 Thread Richard Purdie
On Wed, 2019-10-16 at 08:44 +1000, Dan Callaghan wrote:
> Elfutils has optional support for bzip2 and xz (lzma). It uses
> this for decompressing embedded ELF sections like the .gnu_debugdata
> section for "mini debuginfo":
> 
> https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
> 
> Previously this support was unconditionally disabled but the reasons for
> disabling them seem to no longer apply. Both the target and native
> variants of elfutils can build successfully against both bzip2 and xz.
> 
> Signed-off-by: Dan Callaghan 
> ---
>  meta/recipes-devtools/elfutils/elfutils_0.177.bb | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/elfutils/elfutils_0.177.bb 
> b/meta/recipes-devtools/elfutils/elfutils_0.177.bb
> index 78c3791936..f050577c0d 100644
> --- a/meta/recipes-devtools/elfutils/elfutils_0.177.bb
> +++ b/meta/recipes-devtools/elfutils/elfutils_0.177.bb
> @@ -3,7 +3,7 @@ HOMEPAGE = "https://sourceware.org/elfutils;
>  SECTION = "base"
>  LICENSE = "GPLv2 & LGPLv3+ & GPLv3+"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
> -DEPENDS = "libtool bzip2 zlib virtual/libintl"
> +DEPENDS = "libtool zlib virtual/libintl"
>  DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack "
>  # The Debian patches below are from:
>  # 
> http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz
> @@ -46,8 +46,15 @@ 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-"
> +
> +DEPENDS_BZIP2 = "bzip2-replacement-native"
> +DEPENDS_BZIP2_class-target = "bzip2"
> +
> +PACKAGECONFIG ??= "bzip2"
> +PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_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"

Breaks nativesdk-elftutils:

https://autobuilder.yoctoproject.org/typhoon/#/builders/62/builds/1157

Probably need to do:

DEPENDS_BZIP2 = "bzip2"
DEPENDS_BZIP2_class-native = "bzip2-replacement-native"


but I still think the default should be bzip2 off for -native unless
someone can tell me why we need it. That would mean adding something
like:

PACKAGECONFIG_class-native ??= ""

Cheers,

Richard


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core