diff mbox series

[1/1] Makefile: pass -ansi option to cmd_gen_envp

Message ID 20231220085955.25561-1-sebastien.szymanski@armadeus.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [1/1] Makefile: pass -ansi option to cmd_gen_envp | expand

Commit Message

Sébastien Szymanski Dec. 20, 2023, 8:59 a.m. UTC
Without the '-ansi' 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.

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

Pass the '-ansi' option as suggested by the GCC documentation. [1]
Fix the two .env files using C++ comment style for their SPDX licence.

[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>
---
 Makefile                            | 3 ++-
 board/siemens/iot2050/iot2050.env   | 2 +-
 board/storopack/smegw01/smegw01.env | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 750bbdb1b713..5fc7a20df7f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1803,7 +1803,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 -ansi \
+			-D__ASSEMBLY__ \
 			-D__UBOOT_CONFIG__ \
 			-I . -I include -I $(srctree)/include \
 			-include linux/kconfig.h -include include/config.h \
diff --git a/board/siemens/iot2050/iot2050.env b/board/siemens/iot2050/iot2050.env
index 8bbd7abe98f0..a3bdbf4f6998 100644
--- a/board/siemens/iot2050/iot2050.env
+++ b/board/siemens/iot2050/iot2050.env
@@ -1,4 +1,4 @@ 
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (c) Siemens AG, 2023
  *
diff --git a/board/storopack/smegw01/smegw01.env b/board/storopack/smegw01/smegw01.env
index 93de8669109d..6807ada71887 100644
--- a/board/storopack/smegw01/smegw01.env
+++ b/board/storopack/smegw01/smegw01.env
@@ -1,4 +1,4 @@ 
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 #ifdef CONFIG_SYS_BOOT_LOCKED
 #define SETUP_BOOT_MENU setup_boot_menu=setenv bootmenu_0 eMMC=run bootcmd
 #else