From: "Richard W.M. Jones" <rjones@redhat.com>
To: Cole Robinson <crobinso@redhat.com>
Cc: deller@gmx.de, qemu-devel <qemu-devel@nongnu.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: hppa-firmware.img missing build-id
Date: Tue, 23 Apr 2024 16:02:43 +0100 [thread overview]
Message-ID: <20240423150243.GB7636@redhat.com> (raw)
In-Reply-To: <6c469c05-1bc5-4fd8-89f1-130f5aba5ff8@redhat.com>
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 parent reply other threads:[~2024-04-23 15:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 14:11 hppa-firmware.img missing build-id Cole Robinson
2024-04-23 14:58 ` Cole Robinson
2024-04-23 15:07 ` Helge Deller
2024-04-23 15:10 ` Daniel P. Berrangé
2024-04-23 18:50 ` Helge Deller
2024-04-23 15:02 ` Richard W.M. Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240423150243.GB7636@redhat.com \
--to=rjones@redhat.com \
--cc=crobinso@redhat.com \
--cc=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.