[PATCH] Makefile: fix host CPP pollution in cmd_gen_envp

Simon Glass sjg at chromium.org
Mon Apr 20 06:56:04 CEST 2026


On 2026-04-17T22:45:09, Levi Shafter <levi.shafter at elder-tomes.com> wrote:
> Makefile: fix host CPP pollution in cmd_gen_envp
>
> Commit 2956a84 ("Makefile: don't use CFLAGS for environment text file")
> switched cmd_gen_envp to use $(cpp_flags) so that KCPPFLAGS would be
> honored when preprocessing the environment text file. However,
> cpp_flags also includes $(PLATFORM_CPPFLAGS), which carries
> architecture-specific flags such as -march=armv8-a+crc set by
> arch/arm/Makefile for CONFIG_ARM64_CRC32=y targets. These flags are
> appropriate for cross-compiled object files but cause the host CPP
> invocation to fail on x86 build machines:
>
>   cc1: error: bad value ('armv8-a+crc') for '-march=' switch
>
> KBUILD_CPPFLAGS already accumulates the user-supplied KCPPFLAGS via
> "KBUILD_CPPFLAGS += $(KCPPFLAGS)", providing the behaviour 2956a84
> intended without pulling in target architecture flags. Use it directly.
>
> Fixes: 2956a84 ("Makefile: don't use CFLAGS for environment text file")
> Reported-by: Levi Shafter <levi.shafter at elder-tomes.com>
> Signed-off-by: Levi Shafter <levi.shafter at elder-tomes.com>
>
> Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list