Skip to contentSkip to conversation

rpm: omit additional advanced tools

RFC New James Knight 2 participants 2 messages Dec 8, 2016

lore
Share & tools
lore
#0 lore raw

RFC 1/1 rpm: omit additional advanced tools

Adjusts RPM's configuration to explicitly disable DWARF library support. This indirectly disables the attempt to build any additional advanced tools (debugedit, elfdeps, sepdebugcrcfix). The use of these tools, specifically sepdebugcrcfix, require the use of binutils. Requiring binutils would restrict this package from building on AArch64 and Nios II. Opting to remove the optional utilities.

---
This change is being introduced to address the series of autobuild issues experienced when introducing the RPM v4.13.0 series [1]. The majority of these builds fail due to the lack of binutils requirement when the dwarf library is reachable:

tools/sepdebugcrcfix.c:31:17: fatal error: bfd.h: No such file or directory #include <bfd.h>

Unfortunately, for my own build environments (Fedora-based), the dwarf library is never detected and my attempts to reproduce these autobuild have eluded me:

    http://autobuild.buildroot.net/results/4e0/4e0b98e152d3b016d0e88da1ccbef2845fc3d327
    http://autobuild.buildroot.net/results/a74/a742b9c96e9a53b8bcf2c00e213cb7978ee11496
    http://autobuild.buildroot.net/results/b23/b23110e01829582c03e5795f22c024431acf9fe3
    http://autobuild.buildroot.net/results/23a/23abd8ec7f055125327203fccc1f177c6824cb08
    http://autobuild.buildroot.net/results/09f/09f420ecb6c6a53aba6832977dcb0c5a59bca42d
    http://autobuild.buildroot.net/results/47a/47aab284da117497b21dd394773de8792d542bad
    http://autobuild.buildroot.net/results/365/36526040b5d97077d0455d76a25a6e54308889de
    http://autobuild.buildroot.net/results/23a/23abd8ec7f055125327203fccc1f177c6824cb08

This is the main reason why I've tagged this patch as RFC. While this solution should resolve these autobuild issues, I do not have the correct test environment up to validate. It very well could be I'm using br-reproduce-build incorrectly. At the same time, I didn't want hold back a possible fix while build servers kept failing on the rpm package. If anyone is willing to assist myself in preparing an environment where these issues occur so I can validate, I'm more then happy for the feedback; else wise, I have no problem if someone is able to verify this patch resolves their own issues.

[1]: http://autobuild.buildroot.net/?reason=rpm-4.13.0
[2]: https://buildroot.org/downloads/manual/manual.html#_analyzing_and_fixing_autobuild_failures

---
 package/rpm/rpm.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/rpm/rpm.mk +6 -0
index accb625..023e7da 100644
@@ -71,8 +71,14 @@ ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
 RPM_CONF_OPTS += --disable-nls
 endif
 
+# ac_cv_header_dwarf_h: Indirectly disables a series of additional tools
+#                        (debugedit, elfdeps, sepdebugcrcfix) that are not
+#                        required and would need additional libraries which
+#                        would restrict the RPM package to binutils-supported
+#                        environments.
 # ac_cv_prog_cc_c99: RPM uses non-standard GCC extensions (ex. `asm`).
 RPM_CONF_ENV = \
+	ac_cv_header_dwarf_h=no \
 	ac_cv_prog_cc_c99='-std=gnu99' \
 	CFLAGS="$(TARGET_CFLAGS) $(RPM_CFLAGS)"
 
Signature · 1 line
2.8.4.windows.1
#1 lore raw

RFC 1/1 rpm: omit additional advanced tools

Hello,

Quoted 8 lines · James Knight

Adjusts RPM's configuration to explicitly disable DWARF library support. This indirectly disables the attempt to build any additional advanced tools (debugedit, elfdeps, sepdebugcrcfix). The use of these tools, specifically sepdebugcrcfix, require the use of binutils. Requiring binutils would restrict this package from building on AArch64 and Nios II. Opting to remove the optional utilities.

Thanks a lot for the investigation, it definitely helped a lot!

However, I cooked and pushed what I believe is a better fix: adjust configure.ac to actually check for bfd.h, and build the tool that uses it only when bfd.h is available.

Also, there was a second issue behind that: when bfd.h is there, the build also fails due to some weird issue. So I've fixed that as well.

And added binutils+elfutils as optional dependencies of rpm.

See:

https://git.buildroot.org/buildroot/commit/?id=0018d7d6ba436a59875328fb3f372aff1888bff8
https://git.buildroot.org/buildroot/commit/?id=9b9fcd7062a5d39603fffb61b3e8e2c0b1932321

Thanks again!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com