Skip to contentSkip to conversation

elfutils: add PACKAGECONFIG for compression algorithms

PATCH Superseded Dan Callaghan 7 participants 19 messages Oct 15, 2019 – Oct 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 elfutils: add PACKAGECONFIG for compression algorithms

Elfutils has optional support for zlib, 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 these were 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 all three compression libraries.

---
 meta/recipes-devtools/elfutils/elfutils_0.177.bb | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +7 -2
index 78c3791936..ff033d287a 100644
@@ -46,8 +46,13 @@ 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 ??= ""
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+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"
Signature · 1 line
2.20.1
#1 lore raw

Excerpts from Dan Callaghan's message of 2019-10-15 15:48:27 +10:00:

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 54

Quoted 4 lines
meta/recipes-devtools/elfutils/elfutils_0.177.bb +4 -0
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,bzip2"
+PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"

I just realised that the --without-zlib option doesn't make sense, zlib is actually mandatory.

And bzip2 should probably be in the default PACKAGECONFIG, because the recipe is currently enabling it for the target (although not for the native variant).

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#2 lore raw

PATCH v2 1/1 elfutils: add PACKAGECONFIG for compression algorithms

In reply to Dan Callaghan

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.

---
 meta/recipes-devtools/elfutils/elfutils_0.177.bb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +7 -3
index 78c3791936..86e76d706a 100644
@@ -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,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"
Signature · 1 line
2.20.1
#3 lore raw

Den 2019-10-15 kl. 08:15, skrev Dan Callaghan:

Quoted 34 lines

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.

---
  meta/recipes-devtools/elfutils/elfutils_0.177.bb | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +1 -2
index 78c3791936..86e76d706a 100644
@@ -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,12 @@ SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc
 
  inherit autotools gettext ptest
 
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 57

Quoted 10 lines
meta/recipes-devtools/elfutils/elfutils_0.177.bb +6 -1
-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 = ""

Jacob

#4 lore raw

Excerpts from Jacob Kroon's message of 2019-10-15 08:59:56 +02:00:

Quoted 23 lines

Den 2019-10-15 kl. 08:15, skrev Dan Callaghan:

Quoted 7 lines
(quoted diff) +0 -0
@@ -46,8 +46,12 @@ SRC_URI[sha256sum] 

= "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc

inherit autotools gettext ptest

meta/recipes-devtools/elfutils/elfutils_0.177.bb +0 -1
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 57

Quoted 10 lines
meta/recipes-devtools/elfutils/elfutils_0.177.bb +6 -1
-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 ?

Quoted 3 lines

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...

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#5 lore raw

Den 2019-10-15 kl. 09:21, skrev Dan Callaghan:

Quoted 24 lines

Excerpts from Jacob Kroon's message of 2019-10-15 08:59:56 +02:00:

Quoted 23 lines

Den 2019-10-15 kl. 08:15, skrev Dan Callaghan:

Quoted 7 lines
(quoted diff) +0 -0
@@ -46,8 +46,12 @@ SRC_URI[sha256sum]

= "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc

inherit autotools gettext ptest

meta/recipes-devtools/elfutils/elfutils_0.177.bb +0 -1
-EXTRA_OECONF = "--program-prefix=eu- --without-lzma"

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 57

Quoted 10 lines
meta/recipes-devtools/elfutils/elfutils_0.177.bb +6 -1
-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 ?

Quoted 8 lines
Quoted 3 lines

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.

Lots of recipes do this. I personally think its ok if it helps keeping build times down by avoiding unnecessary deps.

Quoted 18 lines

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:

Quoted 8 lines

| 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.

Maybe try removing bzip2-native from ASSUME_PROVIDED in your local jenkins builds ? Something like 'ASSUME_PROVIDED_remove = "bzip2-native"' in local.conf.

Jacob

#6 lore raw
In reply to Dan Callaghan
Quoted 13 lines · Dan Callaghan

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

Quoted 6 lines

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...

If you need bzip-native for the libraries, DEPEND on bzip2-replacement-native.

Ross

#7 lore raw

Excerpts from Ross Burton's message of 2019-10-15 11:55:31 +01:00:

Quoted 2 lines

If you need bzip-native for the libraries, DEPEND on bzip2-replacement-native.

Oh, thanks for the hint! I hadn't seen that trick used before but now I see it is in quite a few places. I will post a fresh patch using that.

It does seem like it would be simpler to just take bzip2-native out of ASSUME_PROVIDED, but I guess leaving it in there lets people avoid building bzip2-native under some circumstances.

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#8 lore raw
Quoted 3 lines · Dan Callaghan

It does seem like it would be simpler to just take bzip2-native out of ASSUME_PROVIDED, but I guess leaving it in there lets people avoid building bzip2-native under some circumstances.

I believe it's a bootstrap speed thing. If we can assume bzip2 on the host exists we don't need to build it to get going, which is especially fun if you need to decompress bzip2 files to build bzip2...

Ross

#9 lore raw
Quoted 6 lines · Ross Burton
Quoted 3 lines · Dan Callaghan

It does seem like it would be simpler to just take bzip2-native out of ASSUME_PROVIDED, but I guess leaving it in there lets people avoid building bzip2-native under some circumstances.

I believe it's a bootstrap speed thing.  If we can assume bzip2 on the host exists we don't need to build it to get going, which is especially fun if you need to decompress bzip2 files to build bzip2...

To save other people from checking if the bzip2 recipe and Ross are mad:

$ grep "SRC_URI =" meta/recipes-extended/bzip2/bzip2_1.0.8.bb
SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \

so the recipe is sane at least. ;-)
../Randy

Quoted 2 lines

Ross

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#10 lore raw
In reply to Dan Callaghan
Quoted 9 lines · Dan Callaghan

Excerpts from Ross Burton's message of 2019-10-15 11:55:31 +01:00:

Quoted 2 lines

If you need bzip-native for the libraries, DEPEND on bzip2-replacement-native.

Oh, thanks for the hint! I hadn't seen that trick used before but now
I see it is in quite a few places. I will post a fresh patch using that.

Quoted 4 lines

It does seem like it would be simpler to just take bzip2-native out of
ASSUME_PROVIDED, but I guess leaving it in there lets people avoid building bzip2-native under some circumstances.

Its in ASSUME_PROVIDED since we do rely on bzip2 being there so that people can have .bz2 files in SRC_URI.

I have a small preference for disabling bzip2 in elfutils-native, just because we only really want to build things that are necessary. The more dependencies we add in, the longer builds take.

Do we really need bzip2 in elfutils-native?

Cheers,

Richard

#11 lore raw

PATCH v3 1/1 elfutils: add PACKAGECONFIG for compression algorithms

In reply to Dan Callaghan

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.

---
 meta/recipes-devtools/elfutils/elfutils_0.177.bb | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +10 -3
index 78c3791936..f050577c0d 100644
@@ -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"
Signature · 1 line
2.20.1
#12 lore raw
Quoted 36 lines · Dan Callaghan

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.

---
 meta/recipes-devtools/elfutils/elfutils_0.177.bb | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
meta/recipes-devtools/elfutils/elfutils_0.177.bb +3 -3
index 78c3791936..f050577c0d 100644
@@ -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-"
+

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 60

Quoted 10 lines
meta/recipes-devtools/elfutils/elfutils_0.177.bb +7 -0
+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

#13 lore raw
Quoted 10 lines · Richard Purdie

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"

Quoted 5 lines

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

#14 lore raw
In reply to Dan Callaghan

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 56

Quoted 10 lines · Dan Callaghan

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
...

meta/recipes-devtools/elfutils/elfutils_0.177.bb +3 -0
+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

Signature · 4 lines
       "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
#15 lore raw
Quoted 14 lines · Adrian Bunk

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 56

Quoted 10 lines · Dan Callaghan

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
...

meta/recipes-devtools/elfutils/elfutils_0.177.bb +3 -0
+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?

Quoted 2 lines

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

#16 lore raw
In reply to Adrian Bunk

Excerpts from Adrian Bunk's message of 2019-10-29 22:18:21 +02:00:

Quoted 14 lines · Dan Callaghan

meta/recipes-devtools/elfutils/elfutils_0.177.bb SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc · line 56

Quoted 10 lines

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
...

meta/recipes-devtools/elfutils/elfutils_0.177.bb +3 -0
+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?

Quoted 2 lines

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 <[email protected]>
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).

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#17 lore raw
Quoted 13 lines · Dan Callaghan

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 <[email protected]>
Date: Wed Aug 26 00:23:01 2009 -0700

libdwfl: Support Linux bzip2 kernel images for automatic decompression.

Quoted 7 lines

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

#18 lore raw

✗ patchtest: failure for elfutils: add PACKAGECONFIG for compression algorithms (rev3)

In reply to Dan Callaghan

== Series Details ==

Series: elfutils: add PACKAGECONFIG for compression algorithms (rev3)
Revision: 3
URL : https://patchwork.openembedded.org/series/20471/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 0ad21fe63f)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe