Skip to contentSkip to conversation

fdt: fix dts preprocessor options

PATCH New Allen Martin 3 participants 3 messages Jan 9, 2013 – Jan 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdt: fix dts preprocessor options

Using "-ansi" preprocessor option will cause dts lines that begin with '#' to choke the preprocessor. Change to "-x assembler-with-cpp" instead which is what the kernel uses to preprocess dts files.

---
 dts/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dts/Makefile +1 -1
index 785104e..922c78c 100644
@@ -36,7 +36,7 @@ $(error Your architecture does not have device tree support enabled. \
 Please define CONFIG_ARCH_DEVICE_TREE))
 
 # We preprocess the device tree file provide a useful define
-DTS_CPPFLAGS := -ansi \
+DTS_CPPFLAGS := -x assembler-with-cpp \
 		-DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \
 		-DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\"
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 fdt: fix dts preprocessor options

Quoted 3 lines · Allen Martin

Using "-ansi" preprocessor option will cause dts lines that begin with '#' to choke the preprocessor. Change to "-x assembler-with-cpp" instead which is what the kernel uses to preprocess dts files.

Well, it's what the kernel hopefully /will/ use if I can ever get the patch accepted. But anyway, this seems good to me.

#2 lore raw

PATCH 1/1 fdt: fix dts preprocessor options

In reply to Allen Martin
Quoted 5 lines · Allen Martin

Using "-ansi" preprocessor option will cause dts lines that begin with '#' to choke the preprocessor. Change to "-x assembler-with-cpp" instead which is what the kernel uses to preprocess dts files.

Thanks for picking this up.

Quoted 20 lines
---
 dts/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dts/Makefile +1 -2
index 785104e..922c78c 100644
@@ -36,7 +36,7 @@ $(error Your architecture does not have device tree support enabled. \
 Please define CONFIG_ARCH_DEVICE_TREE))
 
 # We preprocess the device tree file provide a useful define
-DTS_CPPFLAGS := -ansi \
+DTS_CPPFLAGS := -x assembler-with-cpp \
                -DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \
                -DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\"
 
--

1.7.10.4