Bug 8506 - Can not build armhf rpms on Fedora 41
Summary: Can not build armhf rpms on Fedora 41
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.19.0
Assignee: Pierre Ossman
URL:
Keywords: adaha_tester, prosaic
Depends on:
Blocks:
 
Reported: 2025-02-04 12:46 CET by Alexander Zeijlon
Modified: 2025-03-04 14:23 CET (History)
1 user (show)

See Also:
Acceptance Criteria:
MUST: * It should be possible to build all ARM packages we need on current versions of Fedora COULD: * The generated ARM packages are properly split to normal and debug packages


Attachments

Description Alexander Zeijlon cendio 2025-02-04 12:46:13 CET
I encountered an issue when building cenbuild packages on my Fedora 41 machine, where it fails to strip binaries of debug symbols when building for our armhf-arch.
Comment 1 Alexander Zeijlon cendio 2025-02-04 12:53:47 CET
There is a stage of the rpmbuild proceedure where it calls the script "find-debuginfo" (part of the package debugedit-5.1-4.fc41.x86_64).

This script in turn calls "gdb-add-index" (part of gdb-headless-15.2-4.fc41.x86_64), which tries to extract symbols with the command "objcopy" (part of binutils-2.43.1-5.fc41.x86_64).

Apparently objcopy is supposed to be able to guess the file format of the input file, but I instead get this error from find-debuginfo:

> /usr/bin/find-debuginfo -j8 --strict-build-id -m -i --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 <path to build folder>
> find-debuginfo: starting
> Extracting debug info from 1 files
> objcopy: Unable to recognise the format of the input file `<path to build folder>/BUILDROOT/opt/cendio-build/arch/armhf/usr/arm-none-linux-gnueabi/sys-root/usr/lib/libXau.so.6.0.0'
> *** ERROR:: GDB exited with exit status 1 during index generation
Comment 2 Alexander Zeijlon cendio 2025-02-04 12:59:38 CET
It is possible to read out the file format of the file in question with "objdump -f <file>".

If I make local copies of find-debuginfo, gdb-add-index, and edit the call to objcopy to explicitly provide the file format that I got from objdumb with "--input-target=elf32-little", the script runs successfully.

Note that this was run outside the rpmbuild context.
Comment 3 Pierre Ossman cendio 2025-02-26 10:50:37 CET
I'm getting the same error with binutils 2.35.2 from RHEL 9, and binutils 2.30 from RHEL 8, and binutils 2.25 from cenbuild.

So I don't think it's an issue with binutils changing. Must be something else.
Comment 4 Pierre Ossman cendio 2025-02-26 12:48:38 CET
The issue is that find-debuginfo didn't have any error management before. It simply ignored the return value of gdb-add-index.

I can see this in a successful build on RHEL 8:

> objcopy: Unable to recognise the format of the input file `/opt/docker-cenbuild/cenbuild/repo/rpmbuild/BUILDROOT/cendio-build-openssl-armhf-3.4.1-1.i386/opt/cendio-build/arch/armhf/usr/arm-none-linux-gnueabi/sys-root/usr/bin/openssl'

Fortunately, it looks like you can override the commands used via the environment. So we can hopefully tell it to use the correct objcopy for the relevant architecture.
Comment 6 Pierre Ossman cendio 2025-02-28 12:29:05 CET
> MUST:
> 
>  * It should be possible to build all ARM packages we need on current versions of Fedora

Works well now.

> COULD:
> 
>  * The generated ARM packages are properly split to normal and debug packages

Yes, I get arm debug packages that are about the same size as the x86 debug packages. However, we got that for previous builds as well. So it's unclear what we actually fixed here.

Not worth digging further in to right now.
Comment 7 Adam Halim cendio 2025-03-04 12:53:33 CET
Tested on Fedora 40 and 41.

The Fedora 40 machine has binutils-2.41 and gdb-headless-16.2. I did not see any issues at all building armhf packages before the fix, and did not notice a difference with the fix applied, except for some small differences in package file size.

On the Fedora 41 machine, I had binutils-2.43.1 and gdb-headless-16.2. I could confirm that upgrading cendio-build-utils from 1.37 --> 1.38 solves the issue for me. With 1.37, I was unable to build armhf packages, getting the same error described in comment #1.
Comment 8 Adam Halim cendio 2025-03-04 14:23:58 CET
> MUST:
>  * It should be possible to build all ARM packages we need on current versions of 
>    Fedora
I did not try building all ARM packages, but tested a couple (libX11, libdrm, libarchive, ftlk) and did not see any issues.
> COULD:
>  * The generated ARM packages are properly split to normal and debug packages
I do see that we get debug packages, but since we don't really use these right now I haven't looked into what's changed with this fix.

Also looked at the commit, looks good!

Note You need to log in before you can comment on or make changes to this bug.