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

Jerome Forissier jerome.forissier at linaro.org
Thu Nov 14 11:58:53 CET 2024



On 11/14/24 11:49, Quentin Schulz wrote:
> 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/

Ah, missed that, sorry.

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

Agreed. I would argue my version is a bit more flexible as
it does not assume "ccache", but yours is certainly good enough!

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

Thanks,
-- 
Jerome


More information about the U-Boot mailing list