public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46
@ 2026-03-01 13:40 Bernd Kuhls
  2026-03-01 20:32 ` Julien Olivain via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2026-03-01 13:40 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46
  2026-03-01 13:40 [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46 Bernd Kuhls
@ 2026-03-01 20:32 ` Julien Olivain via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Olivain via buildroot @ 2026-03-01 20:32 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

On 01/03/2026 14:40, Bernd Kuhls wrote:
> 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>

Applied to next, thanks.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-01 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01 13:40 [Buildroot] [PATCH/next 1/1] boot/shim: Fix build with binutils 2.46 Bernd Kuhls
2026-03-01 20:32 ` Julien Olivain via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox