[PATCH v4] Makefile: detect HOST_ARCH properly when CROSS_COMPILE is multi-word

Quentin Schulz quentin.schulz at cherry.de
Thu Nov 14 11:49:31 CET 2024


Hi Jerome,

On 11/14/24 11:21 AM, Jerome Forissier wrote:
> When CROSS_COMPILE contains multiple words, HOST_ARCH is not properly
> detected and the build may fail. It typically happens when using
> ccache. For example:
> 
>   $ make qemu_arm64_defconfig
>   $ make CROSS_COMPILE="ccache aarch64-linux-gnu-"
>     CC      lib/efi_loader/efi_helper.o
>   lib/efi_loader/efi_helper.c:26:15: error: operator '==' has no left operand
>      26 | #if HOST_ARCH == HOST_ARCH_X86_64
>         |               ^~
>   [...]
> 
> Fix the issue by considering only the last word in $(CROSS_COMPILE).
> 

I suggested another fix here: 
https://lore.kernel.org/u-boot/20241111-mk_arch-ccache-v1-1-e27f5f605bc4@cherry.de/

We just need one or the other, in in time for v2025.01 :)

Tested-by: Quentin Schulz <quentin.schulz at cherry.de>
Reviewed-by: Quentin Schulz <quentin.schulz at cherry.de>

Thanks!
Quentin


More information about the U-Boot mailing list