All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi/libstub: zboot: Avoid eager evaluation of objcopy flags
@ 2023-05-22  6:33 Ard Biesheuvel
  2023-05-22 13:39 ` Alan Bartlett
  0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2023-05-22  6:33 UTC (permalink / raw)
  To: linux-efi; +Cc: bagasdotme, ajb, Ard Biesheuvel, Pedro Falcato

The Make variable containing the objcopy flags may be constructed from
the output of build tools operating on build artifacts, and these may
not exist when doing a make clean.

So avoid evaluating them eagerly, to prevent spurious build warnings.

Suggested-by: Pedro Falcato <pedro.falcato@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/libstub/Makefile.zboot | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/Makefile.zboot b/drivers/firmware/efi/libstub/Makefile.zboot
index 89ef820f3b34483a..2c489627a8078945 100644
--- a/drivers/firmware/efi/libstub/Makefile.zboot
+++ b/drivers/firmware/efi/libstub/Makefile.zboot
@@ -32,7 +32,8 @@ zboot-size-len-$(CONFIG_KERNEL_GZIP)   := 0
 $(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
 	$(call if_changed,$(zboot-method-y))
 
-OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \
+# avoid eager evaluation to prevent references to non-existent build artifacts
+OBJCOPYFLAGS_vmlinuz.o = -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \
 			  --rename-section .data=.gzdata,load,alloc,readonly,contents
 $(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
 	$(call if_changed,objcopy)
-- 
2.39.2


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

* Re: [PATCH] efi/libstub: zboot: Avoid eager evaluation of objcopy flags
  2023-05-22  6:33 [PATCH] efi/libstub: zboot: Avoid eager evaluation of objcopy flags Ard Biesheuvel
@ 2023-05-22 13:39 ` Alan Bartlett
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Bartlett @ 2023-05-22 13:39 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-efi, bagasdotme, Pedro Falcato

On Mon, 22 May 2023 at 07:33, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> The Make variable containing the objcopy flags may be constructed from
> the output of build tools operating on build artifacts, and these may
> not exist when doing a make clean.
>
> So avoid evaluating them eagerly, to prevent spurious build warnings.
>
> Suggested-by: Pedro Falcato <pedro.falcato@gmail.com>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  drivers/firmware/efi/libstub/Makefile.zboot | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/libstub/Makefile.zboot b/drivers/firmware/efi/libstub/Makefile.zboot
> index 89ef820f3b34483a..2c489627a8078945 100644
> --- a/drivers/firmware/efi/libstub/Makefile.zboot
> +++ b/drivers/firmware/efi/libstub/Makefile.zboot
> @@ -32,7 +32,8 @@ zboot-size-len-$(CONFIG_KERNEL_GZIP)   := 0
>  $(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
>         $(call if_changed,$(zboot-method-y))
>
> -OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \
> +# avoid eager evaluation to prevent references to non-existent build artifacts
> +OBJCOPYFLAGS_vmlinuz.o = -I binary -O $(EFI_ZBOOT_BFD_TARGET) $(EFI_ZBOOT_OBJCOPY_FLAGS) \
>                           --rename-section .data=.gzdata,load,alloc,readonly,contents
>  $(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
>         $(call if_changed,objcopy)
> --
> 2.39.2
>
Yes, that fixes the warning. So --

Tested-by: Alan Bartlett <ajb@elrepo.org>

Than you.

Alan.

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

end of thread, other threads:[~2023-05-22 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22  6:33 [PATCH] efi/libstub: zboot: Avoid eager evaluation of objcopy flags Ard Biesheuvel
2023-05-22 13:39 ` Alan Bartlett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.