]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Makefile: pass -undef option to cmd_gen_envp
authorSébastien Szymanski <sebastien.szymanski@armadeus.com>
Fri, 23 Feb 2024 11:42:06 +0000 (12:42 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 4 Mar 2024 15:25:47 +0000 (10:25 -0500)
Without the '-undef' option, the 'linux' string in .env files is
replaced with the string '1 '.
For example, in the board/armadeus/opos6uldev/opos6uldev.env file,

kernelimg=opos6ul-linux.bin

becomes

kernelimg=opos6ul-1 .bin

in the include/generated/env.in file.

That's because 'linux' is a System-specific Predefined Macros. [1]

Pass the '-undef' option to fix this issue.

[1] https://gcc.gnu.org/onlinedocs/gcc-13.2.0/cpp/System-specific-Predefined-Macros.html

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Makefile

index 2643d1839b63bfffe45d601a028ae2eaa6ca2208..673290d46058f296260e6acadb9948a3493569d2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1821,7 +1821,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 $(CFLAGS) -x assembler-with-cpp -D__ASSEMBLY__ \
+               $(CPP) -P $(CFLAGS) -x assembler-with-cpp -undef \
+                       -D__ASSEMBLY__ \
                        -D__UBOOT_CONFIG__ \
                        -I . -I include -I $(srctree)/include \
                        -include linux/kconfig.h -include include/config.h \