linux-stable/arch/arm64
Masahiro Yamada c0a8574204 arm64: add dependency between vmlinuz.efi and Image
A common issue in Makefile is a race in parallel building.

You need to be careful to prevent multiple threads from writing to the
same file simultaneously.

Commit 3939f33450 ("ARM: 8418/1: add boot image dependencies to not
generate invalid images") addressed such a bad scenario.

A similar symptom occurs with the following command:

  $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi
    [ snip ]
    SORTTAB vmlinux
    OBJCOPY arch/arm64/boot/Image
    OBJCOPY arch/arm64/boot/Image
    AS      arch/arm64/boot/zboot-header.o
    PAD     arch/arm64/boot/vmlinux.bin
    GZIP    arch/arm64/boot/vmlinuz
    OBJCOPY arch/arm64/boot/vmlinuz.o
    LD      arch/arm64/boot/vmlinuz.efi.elf
    OBJCOPY arch/arm64/boot/vmlinuz.efi

The log "OBJCOPY arch/arm64/boot/Image" is displayed twice.

It indicates that two threads simultaneously enter arch/arm64/boot/
and write to arch/arm64/boot/Image.

It occasionally leads to a build failure:

  $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi
    [ snip ]
    SORTTAB vmlinux
    OBJCOPY arch/arm64/boot/Image
    PAD     arch/arm64/boot/vmlinux.bin
  truncate: Invalid number: 'arch/arm64/boot/vmlinux.bin'
  make[2]: *** [drivers/firmware/efi/libstub/Makefile.zboot:13:
  arch/arm64/boot/vmlinux.bin] Error 1
  make[2]: *** Deleting file 'arch/arm64/boot/vmlinux.bin'
  make[1]: *** [arch/arm64/Makefile:163: vmlinuz.efi] Error 2
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile:234: __sub-make] Error 2

vmlinuz.efi depends on Image, but such a dependency is not specified
in arch/arm64/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: SImon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20231119053234.2367621-1-masahiroy@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2023-11-23 19:10:29 +00:00
..
boot remoteproc updates for v6.7 2023-11-07 16:53:28 -08:00
configs ARM defconfig updates for 6.7 2023-11-01 15:04:32 -10:00
crypto crypto: arm64/sha512 - clean up backwards function names 2023-10-20 13:39:26 +08:00
hyperv arm64/hyperv: Use CPUHP_AP_HYPERV_ONLINE state to fix CPU online sequencing 2023-06-17 23:09:47 +00:00
include arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y 2023-11-22 18:46:05 +00:00
kernel arm64 fixes: 2023-11-10 12:22:14 -08:00
kvm ARM: 2023-11-02 15:45:15 -10:00
lib arm64: Avoid cpus_have_const_cap() for ARM64_HAS_WFXT 2023-10-16 14:17:05 +01:00
mm arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y 2023-11-22 18:46:05 +00:00
net bpf: Use bpf_is_subprog to check for subprogs 2023-09-16 09:34:20 -07:00
tools arm64 updates for 6.7: 2023-11-01 09:34:55 -10:00
xen
Kbuild
Kconfig As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
Kconfig.debug
Kconfig.platforms arm64: Add config for AMD Pensando SoC platforms 2023-09-28 09:45:23 +02:00
Makefile arm64: add dependency between vmlinuz.efi and Image 2023-11-23 19:10:29 +00:00