LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] arm64: Adjust EFI libstub object include logic
@ 2015-03-16  9:30 Steve Capper
  2015-03-16  9:48 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Capper @ 2015-03-16  9:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: will.deacon, catalin.marinas, ard.biesheuvel, Steve Capper

Commit f4f75ad5 ("efi: efistub: Convert into static library")
introduced a static library for EFI stub, libstub.

The EFI libstub directory is referenced by the kernel build system via
a obj subdirectory rule in:
drivers/firmware/efi/Makefile

Unfortunately, arm64 also references the EFI libstub via:
libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/

If we're unlucky, the kernel build system can enter libstub via two
simultaneous threads resulting in build failures such as:

fixdep: error opening depfile: drivers/firmware/efi/libstub/.efi-stub-helper.o.d: No such file or directory
scripts/Makefile.build:257: recipe for target 'drivers/firmware/efi/libstub/efi-stub-helper.o' failed
make[1]: *** [drivers/firmware/efi/libstub/efi-stub-helper.o] Error 2
Makefile:939: recipe for target 'drivers/firmware/efi/libstub' failed
make: *** [drivers/firmware/efi/libstub] Error 2
make: *** Waiting for unfinished jobs....

This patch adjusts the arm64 Makefile to reference the compiled library
explicitly (as is currently done in x86), rather than the directory.

Fixes: f4f75ad5 efi: efistub: Convert into static library
Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 0666888..da226de 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -51,7 +51,7 @@ core-$(CONFIG_XEN) += arch/arm64/xen/
 core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
 libs-y		:= arch/arm64/lib/ $(libs-y)
 libs-y		+= $(LIBGCC)
-libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/
+core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
 
 # Default target when executing plain make
 KBUILD_IMAGE	:= Image.gz
-- 
2.1.0


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

* Re: [PATCH] arm64: Adjust EFI libstub object include logic
  2015-03-16  9:30 [PATCH] arm64: Adjust EFI libstub object include logic Steve Capper
@ 2015-03-16  9:48 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2015-03-16  9:48 UTC (permalink / raw)
  To: Steve Capper; +Cc: linux-kernel, Will Deacon, Catalin Marinas

On 16 March 2015 at 10:30, Steve Capper <steve.capper@linaro.org> wrote:
> Commit f4f75ad5 ("efi: efistub: Convert into static library")
> introduced a static library for EFI stub, libstub.
>
> The EFI libstub directory is referenced by the kernel build system via
> a obj subdirectory rule in:
> drivers/firmware/efi/Makefile
>
> Unfortunately, arm64 also references the EFI libstub via:
> libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/
>
> If we're unlucky, the kernel build system can enter libstub via two
> simultaneous threads resulting in build failures such as:
>
> fixdep: error opening depfile: drivers/firmware/efi/libstub/.efi-stub-helper.o.d: No such file or directory
> scripts/Makefile.build:257: recipe for target 'drivers/firmware/efi/libstub/efi-stub-helper.o' failed
> make[1]: *** [drivers/firmware/efi/libstub/efi-stub-helper.o] Error 2
> Makefile:939: recipe for target 'drivers/firmware/efi/libstub' failed
> make: *** [drivers/firmware/efi/libstub] Error 2
> make: *** Waiting for unfinished jobs....
>
> This patch adjusts the arm64 Makefile to reference the compiled library
> explicitly (as is currently done in x86), rather than the directory.
>

The thing to note here is that x86 links the stub into the
decompressor, which is a separate binary.

So rather than descending into the directory for the second time due
to it having been included in libs-y, we will now be relying on the
fact that vmlinux depends on the [empty]
drivers/firmware/efi/libstub/builtin.o, the building of which will
always have as a side effect that drivers/firmware/efi/libstub/lib.a
is also built.
I think that is fine, but it is subtly different from x86

> Fixes: f4f75ad5 efi: efistub: Convert into static library
> Signed-off-by: Steve Capper <steve.capper@linaro.org>
> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 0666888..da226de 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -51,7 +51,7 @@ core-$(CONFIG_XEN) += arch/arm64/xen/
>  core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
>  libs-y         := arch/arm64/lib/ $(libs-y)
>  libs-y         += $(LIBGCC)
> -libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/
> +core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
>
>  # Default target when executing plain make
>  KBUILD_IMAGE   := Image.gz
> --
> 2.1.0
>

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

end of thread, other threads:[~2015-03-16  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  9:30 [PATCH] arm64: Adjust EFI libstub object include logic Steve Capper
2015-03-16  9:48 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).