Created attachment 238165 [details] Install llvm-objdump as /usr/bin/objdump https://reviews.freebsd.org/D37445
Some new failures: https://pkg-status.freebsd.org/gohan05/data/mainamd64PR267854-default/2022-11-19_09h21m12s/logs/errors/pioneer-20220203_1.log https://pkg-status.freebsd.org/gohan05/data/mainamd64PR267854-default/2022-11-19_09h21m12s/logs/errors/reduce-20220617.log https://pkg-status.freebsd.org/gohan05/data/mainamd64PR267854-default/2022-11-19_09h21m12s/logs/errors/seabios-1.14.0.log
misc/seabios is definitely due to different formatting from GNU objdump and llvm-objdump. Error is: Traceback (most recent call last): File "/wrkdirs/usr/ports/misc/seabios/work/seabios-1.14.0/./scripts/layoutrom.py", line 705, in <module> main() File "/wrkdirs/usr/ports/misc/seabios/work/seabios-1.14.0/./scripts/layoutrom.py", line 647, in main info16 = parseObjDump(infile16, '16') File "/wrkdirs/usr/ports/misc/seabios/work/seabios-1.14.0/./scripts/layoutrom.py", line 562, in parseObjDump relocsection = sectionmap[sectionname] KeyError: '.text.call32_prep' GNU objdump produces: work/seabios-1.14.0/out/code16.o: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000000 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text.set_a20 00000020 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .text.set_code_success 0000000c 00000000 00000000 00000054 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 3 .text.pic_eoi2 00000008 00000000 00000000 00000060 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 4 .text.call32_prep 00000099 00000000 00000000 00000068 2**0 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE ... while llvm-objdump produces: out/code16.o: file format elf32-i386 Sections: Idx Name Size VMA Type 0 00000000 00000000 1 .text 00000000 00000000 TEXT 2 .text.set_a20 00000020 00000000 TEXT 3 .text.set_code_success 0000000c 00000000 TEXT 4 .text.pic_eoi2 00000008 00000000 TEXT 5 .text.call32_prep 00000099 00000000 TEXT ... (llvm-objdump also reports a greater number of sections in the list, but it may be that code16.o in the work dir had been processed at the time I ran GNU objdump) seabios has `USE_BINUTILS= yes`, but it is picking up llvm objdump in $PATH. Its Makefile has: CROSS_PREFIX= ifneq ($(CROSS_PREFIX),) CC=$(CROSS_PREFIX)gcc endif AS=$(CROSS_PREFIX)as LD=$(CROSS_PREFIX)ld OBJCOPY=$(CROSS_PREFIX)objcopy OBJDUMP=$(CROSS_PREFIX)objdump STRIP=$(CROSS_PREFIX)strip PYTHON=python CPP=cpp so it looks like seabios should be modified so that it actually picks up GNU objdump, but we should also get llvm-objdump's formatting fixed. ============================================================ math/reduce looks like it might have been OOM and not due to the objdump change: Info: [Bootstrap] reset Info: [Bootstrap] cali gmake[3]: *** [Makefile:6885: bootstrapreduce.img] Killed ============================================================ games/pioneer also looks like it might not be related to objdump change: Compressed model (bowfin): 1188.47 KB -> 640.09 KB Compiling "bowfin" took: 256.523954 --- Starting compiler for (deneb) Segmentation fault ninja: build stopped: subcommand failed. *** Error code 1 (It may be a second order effect where we've built a broken build tool though.)
(In reply to Ed Maste from comment #2) Looks like GNU objdump's output is without the -W (--wide) option? I think if you use that, the format will look similar to llvm-objdump's.
(In reply to Dimitry Andric from comment #3) Yeah, it looks like --wide produces output similar to llvm-objdump, but with additional fields. However seabios is expecting GNU without --wide format. Idx is also off by one for GNU vs llvm. % /usr/local/bin/objdump --wide -h code16.o | head code16.o: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn Flags 0 .text 00000000 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text.set_a20 00000020 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE % /usr/local/bin/objdump -h code16.o | head code16.o: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000000 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text.set_a20 00000020 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE % ~/src/llvm-project/build/bin/llvm-objdump -h code16.o | head code16.o: file format elf32-i386 Sections: Idx Name Size VMA Type 0 00000000 00000000 1 .text 00000000 00000000 TEXT 2 .text.set_a20 00000020 00000000 TEXT
A patch to make seabios use readelf/llvm-readelf instead: https://github.com/MaskRay/seabios/commit/39ee69b81361f75afcac1dcf5b41ba475890c5de This looks like the proper fix
(In reply to Ed Maste from comment #5) Do you know if that's submitted upstream? Last time I checked SeaBIOS explicitly required gcc and binutils to build, but now it's possible to build with clang/llvm? Thanks for looking into this!
(In reply to Roger Pau Monné from comment #6) MaskRay submitted a series of patches to build seabios with lld and avoid requiring GNU objdump, mentioned in my now-closed GitHub issue about formatting differences between GNU objdump and LLVM. https://github.com/llvm/llvm-project/issues/59204 https://github.com/MaskRay/seabios/tree/readelf https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/KBHQU4OLW2THG5Q5F5X7EWTQDJHKNVYC/ (Mailing list archive link is currently reporting "Server error" for me) I suspect the best path is to patch locally to honour OBJDUMP (and other tools) set in environment to unblock this issue. Also submit upstream, as it seems like a good idea (regardless of whether we use objdump or readelf). Separately ping MaskRay's thread to see if we can get that committed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=766fafa0aaaebdaadb520fdc90d2d86d6f0cf471 commit 766fafa0aaaebdaadb520fdc90d2d86d6f0cf471 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2022-12-09 22:08:41 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2022-12-12 13:36:30 +0000 misc/seabios: Update to 1.16.0; use binutils binaries Upstream release information: https://www.seabios.org/Releases#SeaBIOS_1.15.0 https://www.seabios.org/Releases#SeaBIOS_1.16.0 When ports set USE_BINUTILS=yes, the environment is adjusted with, e.g., OBJDUMP=${LOCALBASE}/bin/objdump, so that binaries from devel/binutils are used during the build. SeaBIOS, however, ignores these environment variables, so supply them to MAKE_ARGS. This will fix the build when /usr/bin/llvm-objdump is linked to /usr/bin/objdump. See PR 267854. PR: 267854 Approved by: royger (maintainer) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37667 misc/seabios/Makefile | 5 +++-- misc/seabios/distinfo | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-)
(In reply to Ed Maste from comment #2) I extracted games/pioneer and "objdump" does not appear in the tree. I assume that it and math/reduce are unrelated failures.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=86edb11e7491e657e6c75ef6814867021665c377 commit 86edb11e7491e657e6c75ef6814867021665c377 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2022-11-18 20:47:13 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2022-12-12 15:36:02 +0000 Always install llvm-objdump as objdump Instead of providing no /usr/bin/objdump when LLVM_BINUTILS is false. PR: 267854 [exp-run] Reviewed by: dim MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37445 UPDATING | 8 ++++++++ tools/build/mk/OptionalObsoleteFiles.inc | 7 ++----- usr.bin/clang/llvm-objdump/Makefile | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=982e61aacc79f5b972e4c6e1dab6221403e58b0a commit 982e61aacc79f5b972e4c6e1dab6221403e58b0a Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2022-11-18 20:47:13 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2023-04-05 01:33:57 +0000 Always install llvm-objdump as objdump Instead of providing no /usr/bin/objdump when LLVM_BINUTILS is false. PR: 267854 [exp-run] Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37445 (cherry picked from commit 86edb11e7491e657e6c75ef6814867021665c377) UPDATING | 8 ++++++++ tools/build/mk/OptionalObsoleteFiles.inc | 7 ++----- usr.bin/clang/llvm-objdump/Makefile | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-)