[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-devel
Subject:    Re: hppa-firmware.img missing build-id
From:       "Richard W.M. Jones" <rjones () redhat ! com>
Date:       2024-04-23 15:02:43
Message-ID: 20240423150243.GB7636 () redhat ! com
[Download RAW message or body]

On Tue, Apr 23, 2024 at 10:11:50AM -0400, Cole Robinson wrote:
> Hi,
> 
> hppa-firmware.img and hppa-firmware64.img in qemu.git are missing ELF
> build-id annotations. rpm builds on Fedora will error if an ELF binary
> doesn't have build-id:
> 
> RPM build errors:
> Missing build-id in
> /tmp/rpmbuild/BUILDROOT/qemu-9.0.0-1.rc2.fc41.x86_64/usr/share/qemu/hppa-firmware.img
>  Missing build-id in
> /tmp/rpmbuild/BUILDROOT/qemu-9.0.0-1.rc2.fc41.x86_64/usr/share/qemu/hppa-firmware64.img
>  Generating build-id links failed
> 
> I didn't hit this with qemu 8.2.* builds FWIW

Discussed in chat, and I think the consensus is to rebuild these
downstream, since we have the cross-compilers available.  It requires
adding -Wl,--build-id=sha1 at link time.

FWIW this worked for me on Fedora:

# dnf install /usr/bin/hppa-linux-gnu-gcc
$ pushd roms/seabios-hppa
$ make parisc
$ popd

That didn't actually add the .note.gnu.build-id section though, you
have to add this patch:

diff --git a/Makefile.parisc b/Makefile.parisc
index 36edc0c2..3e0c1812 100644
--- a/Makefile.parisc
+++ b/Makefile.parisc
@@ -168,7 +168,7 @@ $(OUT)hppa-firmware$(BIT_SUFFIX).img: $(OUT)autoconf.h \
$(OUT)head.o $(OUT)ccode3  @echo "  Linking $@"
        $(Q)$(CPP) $(CPPFLAGS) -Isrc -D__ASSEMBLY__ -DBITS=$(BITS) \
src/parisc/pafirmware.lds.S -o $(OUT)pafirmware.lds  $(Q)$(CC) $(CFLAGS32FLAT) -c \
                src/version.c -o $(OUT)version.o
-       $(Q)$(LD) -N -T $(OUT)pafirmware.lds $(OUT)head.o $(OUT)version.o -X -o $@ -e \
startup --as-needed $(OUT)ccode32flat.o $(LIBGCC) +       $(Q)$(LD) --build-id=sha1 \
-N -T $(OUT)pafirmware.lds $(OUT)head.o $(OUT)version.o -X -o $@ -e startup \
--as-needed $(OUT)ccode32flat.o $(LIBGCC)  
 ################ Kconfig rules
 
... and then:

$ objdump -sj .note.gnu.build-id ./out/hppa-firmware.img 

./out/hppa-firmware.img:     file format elf32-big

Contents of section .note.gnu.build-id:
 f0000000 00000004 00000014 00000003 474e5500  ............GNU.
 f0000010 daabe2dc 4e95a4c2 bad0cc57 e7f63152  ....N......W..1R
 f0000020 46274585                             F'E.         

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic