[PATCH] efi_loader: move efi_var_seed.o to objtree
Simon Glass
sjg at chromium.org
Thu Jun 25 14:13:30 CEST 2026
Hi Jon,
On 2026-06-19T15:58:57, Jon Mason <jon.mason at arm.com> wrote:
> efi_loader: move efi_var_seed.o to objtree
>
> With commit bd3f9ee679b4d1456d0d3c261ab76788950e6096
> (kbuild: Bump the build system to 6.1), there is an issue when trying to
> build out of tree, where efi_var_seed.S wants ubootefi.var to be in the
> object tree, but lib/efi_loader/efi_var_seed.o wants ubootefi.var to be
> in the source tree.
>
> If we change efi_var_seed.o to look in the objtree, then it should work
> in both local and out-of-tree. However, it would require anything
> previously working to put ubootefi.vars to the objtree, but it's broken
> now anyway.
>
> Signed-off-by: Jon Mason <jon.mason at arm.com>
>
> lib/efi_loader/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> @@ -75,7 +75,7 @@ obj-$(CONFIG_EFI_ECPT) += efi_conformance.o
> obj-$(CONFIG_EFI_DEBUG_SUPPORT) += efi_debug_support.o
>
> EFI_VAR_SEED_FILE := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE))
> -$(obj)/efi_var_seed.o: $(srctree)/$(EFI_VAR_SEED_FILE)
> +$(obj)/efi_var_seed.o: $(objtree)/$(EFI_VAR_SEED_FILE)
A couple of things beyond Heinrich's objection.
This only changes the make-level prerequisite. The actual lookup
happens inside efi_var_seed.S via .incbin, which resolves through the
assembler's -I search paths. In your failing log the assembler is
invoked with -I. (the objtree root) and -I ./lib/efi_loader, but no -I
pointing at $(srctree), so the file is only found if it sits in the
objtree. Flipping the make dep to $(objtree) papers over the symptom
but doesn't wire the search path to anything new - the build works for
you because -I. was already resolving there.
If the intent is to keep the file in $(srctree) (which is what the
Kconfig help promises - 'If a relative file path is used, it is
relative to the source directory'), the real fix is probably to add -I
$(srctree) to the asflags for this object, e.g.
AFLAGS_efi_var_seed.o := -I $(srctree)
and leave the prerequisite pointing at $(srctree). Otherwise the
Kconfig help in lib/efi_loader/Kconfig needs updating in the same
patch, since this silently inverts the documented behaviour.
Commit-message nits: 'efi_var_seed.S wants ubootefi.var to be in the
object tree' isn't quite right - it wants it on the assembler include
path, which today happens to be the objtree; and 'ubootefi.vars'
should be 'ubootefi.var'.
Regards,
Simon
More information about the U-Boot
mailing list