Source: efitools
Version: 1.9.2-3.7
Tags: patch ftbfs
User: [email protected]
Usertags: ftcbfs
Control: affects -1 + src:fwupd-efi

fwupd-efi fails to cross build from source, because it fails locating
gnu-efi using pkg-config. gnu-efi still installs to /usr/lib and that's
not a location pkg-config searches during cross compilation. The
solution here is to move its files to multiarch. Once doing that,
efitools fails to build from source, because it hard codes the
assumption that gnu-efi is installed to /usr/lib and some other
non-multiarch paths. I'm attaching a patch that makes it detect
gnu-efi's location from pkg-config. Doing so works both before and after
the move. Please consider applying it. The embedded multiarch.patch
should be safe for forwarding upstream as it falls back to the prior
logic when pkg-config does not work.
 
Helmut
diff -Nru efitools-1.9.2/debian/changelog efitools-1.9.2/debian/changelog
--- efitools-1.9.2/debian/changelog     2026-01-05 22:55:31.000000000 +0100
+++ efitools-1.9.2/debian/changelog     2026-01-15 11:50:49.000000000 +0100
@@ -1,3 +1,10 @@
+efitools (1.9.2-3.8) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support building with a multiarch gnu-efi. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Thu, 15 Jan 2026 11:50:49 +0100
+
 efitools (1.9.2-3.7) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru efitools-1.9.2/debian/control efitools-1.9.2/debian/control
--- efitools-1.9.2/debian/control       2022-05-24 19:48:58.000000000 +0200
+++ efitools-1.9.2/debian/control       2026-01-15 11:50:49.000000000 +0100
@@ -9,7 +9,8 @@
     libssl-dev,
     openssl,
     gnu-efi,
-    sbsigntool
+    sbsigntool,
+    pkgconf,
 Standards-Version: 4.4.1
 Homepage: http://blog.hansenpartnership.com/uefi-secure-boot/
 Vcs-Git: https://salsa.debian.org/efi-team/efitools.git
diff -Nru efitools-1.9.2/debian/patches/multiarch.patch 
efitools-1.9.2/debian/patches/multiarch.patch
--- efitools-1.9.2/debian/patches/multiarch.patch       1970-01-01 
01:00:00.000000000 +0100
+++ efitools-1.9.2/debian/patches/multiarch.patch       2026-01-15 
11:50:49.000000000 +0100
@@ -0,0 +1,19 @@
+--- efitools-1.9.2.orig/Make.rules
++++ efitools-1.9.2/Make.rules
+@@ -1,6 +1,7 @@
+ EFISIGNED = $(patsubst %.efi,%-signed.efi,$(EFIFILES))
+ MANPAGES = $(patsubst doc/%.1.in,doc/%.1,$(wildcard doc/*.1.in))
+ HELP2MAN = help2man
++PKG_CONFIG ?= pkg-config
+ ARCH   = $(shell uname -m | sed 's/i.86/ia32/;s/arm.*/arm/')
+ ifeq ($(ARCH),ia32)
+ ARCH3264 = -m32
+@@ -22,7 +23,7 @@
+ CFLAGS           = -O2 -g $(ARCH3264) -fno-stack-protector -fpic -Wall 
-fshort-wchar -fno-strict-aliasing -fno-merge-constants -D_XOPEN_SOURCE=700
+ LDFLAGS          = -nostdlib
+ CRTOBJ                = crt0-efi-$(ARCH).o
+-CRTPATHS      = /lib /lib64 /lib/efi /lib64/efi /usr/lib /usr/lib64 
/usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi
++CRTPATHS      = /lib /lib64 /lib/efi /lib64/efi /usr/lib /usr/lib64 
/usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi $(shell 
$(PKG_CONFIG) --variable=libdir gnu-efi)
+ CRTPATH               = $(shell for f in $(CRTPATHS); do if [ -e 
$$f/$(CRTOBJ) ]; then echo $$f; break; fi; done)
+ CRTOBJS               = $(CRTPATH)/$(CRTOBJ)
+ # there's a bug in the gnu tools ... the .reloc section has to be
diff -Nru efitools-1.9.2/debian/patches/series 
efitools-1.9.2/debian/patches/series
--- efitools-1.9.2/debian/patches/series        2026-01-05 22:55:31.000000000 
+0100
+++ efitools-1.9.2/debian/patches/series        2026-01-15 11:50:11.000000000 
+0100
@@ -8,3 +8,4 @@
 no-efi-on-aarch64.patch
 gcc15.patch
 objcopy-output-target.patch
+multiarch.patch

Reply via email to