From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Subject: [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46
Date: Sun, 1 Mar 2026 14:40:52 +0100 [thread overview]
Message-ID: <20260301134053.1460941-1-bernd@kuhls.net> (raw)
Buildroot commit 101997e334efcbfd9bde3100ae75400177cfa56f added binutils
2.46.0 to -next branch causing a build error with shim:
output/per-package/shim/host/bin/x86_64-buildroot-linux-gnu-objcopy:
shimx64.so: file format not recognized
output/per-package/shim/host/bin/x86_64-buildroot-linux-gnu-objcopy:
mmx64.so: file format not recognized
Added an upstream patch to fix the problem.
No backport to buildroot LTS branches necessary.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
.../0001-Fix-build-with-binutils-2.46.patch | 51 +++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 boot/shim/0001-Fix-build-with-binutils-2.46.patch
diff --git a/boot/shim/0001-Fix-build-with-binutils-2.46.patch b/boot/shim/0001-Fix-build-with-binutils-2.46.patch
new file mode 100644
index 0000000000..05ab7b2c83
--- /dev/null
+++ b/boot/shim/0001-Fix-build-with-binutils-2.46.patch
@@ -0,0 +1,51 @@
+From c4665d282072df2ed8ab6ae1d5fa0de41e5db02f Mon Sep 17 00:00:00 2001
+From: Luca Boccassi <luca.boccassi@gmail.com>
+Date: Tue, 6 Jan 2026 11:48:13 +0100
+Subject: [PATCH] Fix build with binutils 2.46
+
+With the new binutils which is in development and in Fedora Rawhide:
+
+objcopy -D -j .text -j .sdata -j .data -j .data.ident \
+ -j .dynamic -j .rodata -j .rel* \
+ -j .rela* -j .dyn -j .reloc -j .eh_frame \
+ -j .vendor_cert -j .sbat -j .sbatlevel \
+ --file-alignment 0x1000 \
+ --target efi-app-x86_64 fbx64.so fbx64.efi
+objcopy: fbx64.so: file format not recognized
+
+It seems it was an intentional compat break, according to the upstream
+commit:
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5e83077d552ed6f81dbc092eb3ccf827a43de42c
+
+* Internal changes to plugin support, and stricter target checking may result
+ in some errors being exposed in user options passed to the various binutils.
+ For example objcopy --target=TARGET now will only work if the input file is
+ for TARGET whereas prior versions of objcopy accepted other target input
+ files and produced a TARGET output. If you do in fact want the old
+ behaviour the correct usage is objcopy --output-target=TARGET.
+
+Switch from --taget to --output-target as suggested.
+
+Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
+
+Upstream: https://github.com/rhboot/shim/commit/c4665d282072df2ed8ab6ae1d5fa0de41e5db02f
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ Make.defaults | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Make.defaults b/Make.defaults
+index c5fa32bec..9b40b7f4a 100644
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -155,7 +155,7 @@ endif
+
+ LIB_GCC = $(shell $(CC) $(ARCH_CFLAGS) -print-libgcc-file-name)
+ EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $(LIB_GCC)
+-FORMAT ?= --target efi-app-$(ARCH)
++FORMAT ?= --output-target efi-app-$(ARCH)
+ LOCAL_EFI_PATH = gnu-efi/$(ARCH_GNUEFI)/gnuefi
+ LIBDIR = gnu-efi/$(ARCH_GNUEFI)/lib
+
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2026-03-01 13:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 13:40 Bernd Kuhls [this message]
2026-03-01 20:32 ` [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46 Julien Olivain via buildroot
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=20260301134053.1460941-1-bernd@kuhls.net \
--to=bernd@kuhls.net \
--cc=buildroot@buildroot.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox