public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
@ 2012-07-13 13:03 Horst Kronstorfer
  2012-07-19  3:22 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Horst Kronstorfer @ 2012-07-13 13:03 UTC (permalink / raw)
  To: u-boot

Add '-undef' to DTS_CPPFLAGS to avoid unwanted expansion of dts content
that matches system-specific or gcc-specific predefined macros.

Example: A number of PowerPC related *.dts files in the kernel define a
property named 'linux,network-index' which (w/o '-undef') is expanded to
'1,network-index' by the preprocessor because of '#define linux 1.'

With '-undef' in place only the standard predefined macros are visible:

 $ gcc -dM -E -undef - </dev/null
 #define __STDC_HOSTED__ 1
 #define __STDC__ 1

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
---
 dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dts/Makefile b/dts/Makefile
index 402dfe1..3c6bc18 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -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 := -DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\"
+DTS_CPPFLAGS := -undef -DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\"
 
 all:	$(obj).depend $(LIB)
 
-- 
1.7.11.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-08-10 21:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13 13:03 [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros Horst Kronstorfer
2012-07-19  3:22 ` Mike Frysinger
2012-07-24 10:11   ` Horst Kronstorfer
2012-07-24 15:28     ` Mike Frysinger
2012-07-24 19:38       ` Horst Kronstorfer
2012-07-25 16:06         ` Mike Frysinger
2012-07-26  7:06           ` Horst Kronstorfer
2012-07-26 16:23             ` Mike Frysinger
2012-07-26 21:26 ` [U-Boot] [PATCH,v2] dts/Makefile: Turn off some " Horst Kronstorfer
2012-08-10 21:53   ` [U-Boot] [PATCH, v2] " Wolfgang Denk
2012-08-10 21:50 ` [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific " Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox