mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
Makefile: fix host CPP pollution in cmd_gen_envp
Commit2956a84ba7("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 behaviour2956a84intended without pulling in target architecture flags. Use it directly. Fixes:2956a84ba7("Makefile: don't use CFLAGS for environment text file") Signed-off-by: Levi Shafter <levi.shafter@elder-tomes.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
3
Makefile
3
Makefile
@@ -2147,7 +2147,8 @@ ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD)
|
||||
quiet_cmd_gen_envp = ENVP $@
|
||||
cmd_gen_envp = \
|
||||
if [ -s "$(ENV_FILE)" ]; then \
|
||||
$(CPP) -P $(cpp_flags) -x assembler-with-cpp -undef \
|
||||
$(CPP) -P $(KBUILD_CPPFLAGS) $(UBOOTINCLUDE) \
|
||||
-x assembler-with-cpp -undef \
|
||||
-D__ASSEMBLY__ \
|
||||
-D__UBOOT_CONFIG__ \
|
||||
-DDEFAULT_DEVICE_TREE=$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE)) \
|
||||
|
||||
Reference in New Issue
Block a user