All of lore.kernel.org
 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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  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-26 21:26 ` [U-Boot] [PATCH,v2] dts/Makefile: Turn off some " Horst Kronstorfer
  2012-08-10 21:50 ` [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific " Wolfgang Denk
  2 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2012-07-19  3:22 UTC (permalink / raw)
  To: u-boot

On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
> 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.'

i think you should use -ansi instead.  that's what we use in other places for 
the same reason.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120718/7ca93baf/attachment.pgp>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-19  3:22 ` Mike Frysinger
@ 2012-07-24 10:11   ` Horst Kronstorfer
  2012-07-24 15:28     ` Mike Frysinger
  0 siblings, 1 reply; 11+ messages in thread
From: Horst Kronstorfer @ 2012-07-24 10:11 UTC (permalink / raw)
  To: u-boot

On 07/19/2012 05:22 AM, Mike Frysinger wrote:
> On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
>> 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.'
>
> i think you should use -ansi instead.  that's what we use in other places for
> the same reason.
> -mike
>

this would increase the probability of a name clash.

-h

>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-24 10:11   ` Horst Kronstorfer
@ 2012-07-24 15:28     ` Mike Frysinger
  2012-07-24 19:38       ` Horst Kronstorfer
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2012-07-24 15:28 UTC (permalink / raw)
  To: u-boot

On Tuesday 24 July 2012 06:11:04 Horst Kronstorfer wrote:
> On 07/19/2012 05:22 AM, Mike Frysinger wrote:
> > On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
> >> 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.'
> > 
> > i think you should use -ansi instead.  that's what we use in other places
> > for the same reason.
> 
> this would increase the probability of a name clash.

no idea what you're talking about.  have you actually looked at the output of 
`gcc -E -dD -ansi` ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120724/a16a7581/attachment.pgp>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-24 15:28     ` Mike Frysinger
@ 2012-07-24 19:38       ` Horst Kronstorfer
  2012-07-25 16:06         ` Mike Frysinger
  0 siblings, 1 reply; 11+ messages in thread
From: Horst Kronstorfer @ 2012-07-24 19:38 UTC (permalink / raw)
  To: u-boot

On 07/24/2012 05:28 PM, Mike Frysinger wrote:
> On Tuesday 24 July 2012 06:11:04 Horst Kronstorfer wrote:
>> On 07/19/2012 05:22 AM, Mike Frysinger wrote:
>>> On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
>>>> 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.'
>>>
>>> i think you should use -ansi instead.  that's what we use in other places
>>> for the same reason.
>>
>> this would increase the probability of a name clash.
>
> no idea what you're talking about.  have you actually looked at the output of
> `gcc -E -dD -ansi` ?

$ gcc -E -dM -ansi - </dev/null | wc -l
229
$ gcc -E -dM -undef - </dev/null | wc -l
2

-h

> -mike
>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-24 19:38       ` Horst Kronstorfer
@ 2012-07-25 16:06         ` Mike Frysinger
  2012-07-26  7:06           ` Horst Kronstorfer
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2012-07-25 16:06 UTC (permalink / raw)
  To: u-boot

On Tuesday 24 July 2012 15:38:55 Horst Kronstorfer wrote:
> On 07/24/2012 05:28 PM, Mike Frysinger wrote:
> > On Tuesday 24 July 2012 06:11:04 Horst Kronstorfer wrote:
> >> On 07/19/2012 05:22 AM, Mike Frysinger wrote:
> >>> On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
> >>>> 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.'
> >>> 
> >>> i think you should use -ansi instead.  that's what we use in other
> >>> places for the same reason.
> >> 
> >> this would increase the probability of a name clash.
> > 
> > no idea what you're talking about.  have you actually looked at the
> > output of `gcc -E -dD -ansi` ?
> 
> $ gcc -E -dM -ansi - </dev/null | wc -l
> 229
> $ gcc -E -dM -undef - </dev/null | wc -l
> 2

and ?  did you *look* at the output ?  they're all of the form __foo__.  do 
any device trees really use __foo__ names ?  i don't think so.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120725/02a800f0/attachment.pgp>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-25 16:06         ` Mike Frysinger
@ 2012-07-26  7:06           ` Horst Kronstorfer
  2012-07-26 16:23             ` Mike Frysinger
  0 siblings, 1 reply; 11+ messages in thread
From: Horst Kronstorfer @ 2012-07-26  7:06 UTC (permalink / raw)
  To: u-boot

On 07/25/2012 06:06 PM, Mike Frysinger wrote:
> On Tuesday 24 July 2012 15:38:55 Horst Kronstorfer wrote:
>> On 07/24/2012 05:28 PM, Mike Frysinger wrote:
>>> On Tuesday 24 July 2012 06:11:04 Horst Kronstorfer wrote:
>>>> On 07/19/2012 05:22 AM, Mike Frysinger wrote:
>>>>> On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
>>>>>> 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.'
>>>>>
>>>>> i think you should use -ansi instead.  that's what we use in other
>>>>> places for the same reason.
>>>>
>>>> this would increase the probability of a name clash.
>>>
>>> no idea what you're talking about.  have you actually looked at the
>>> output of `gcc -E -dD -ansi` ?
>>
>> $ gcc -E -dM -ansi - </dev/null | wc -l
>> 229
>> $ gcc -E -dM -undef - </dev/null | wc -l
>> 2
>
> and ?  did you *look* at the output ?  they're all of the form __foo__.

i already considered that.

> do any device trees really use __foo__ names ?  i don't think so.

is there any drawback using '-undef' in this particular case besides
"we use -ansi in other places for the same reason"?

-h

> -mike
>

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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  2012-07-26  7:06           ` Horst Kronstorfer
@ 2012-07-26 16:23             ` Mike Frysinger
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Frysinger @ 2012-07-26 16:23 UTC (permalink / raw)
  To: u-boot

On Thursday 26 July 2012 03:06:06 Horst Kronstorfer wrote:
> On 07/25/2012 06:06 PM, Mike Frysinger wrote:
> > On Tuesday 24 July 2012 15:38:55 Horst Kronstorfer wrote:
> >> On 07/24/2012 05:28 PM, Mike Frysinger wrote:
> >>> On Tuesday 24 July 2012 06:11:04 Horst Kronstorfer wrote:
> >>>> On 07/19/2012 05:22 AM, Mike Frysinger wrote:
> >>>>> On Friday 13 July 2012 09:03:40 Horst Kronstorfer wrote:
> >>>>>> 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.'
> >>>>> 
> >>>>> i think you should use -ansi instead.  that's what we use in other
> >>>>> places for the same reason.
> >>>> 
> >>>> this would increase the probability of a name clash.
> >>> 
> >>> no idea what you're talking about.  have you actually looked at the
> >>> output of `gcc -E -dD -ansi` ?
> >> 
> >> $ gcc -E -dM -ansi - </dev/null | wc -l
> >> 229
> >> $ gcc -E -dM -undef - </dev/null | wc -l
> >> 2
> > 
> > and ?  did you *look* at the output ?  they're all of the form __foo__.
> 
> i already considered that.
> 
> > do any device trees really use __foo__ names ?  i don't think so.
> 
> is there any drawback using '-undef' in this particular case besides
> "we use -ansi in other places for the same reason"?

we use -ansi because it's more portable and has known behavior in the build 
system
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120726/1480d2fb/attachment.pgp>

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

* [U-Boot] [PATCH,v2] dts/Makefile: Turn off some predefined macros
  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-26 21:26 ` 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
  2 siblings, 1 reply; 11+ messages in thread
From: Horst Kronstorfer @ 2012-07-26 21:26 UTC (permalink / raw)
  To: u-boot

Add '-ansi' to DTS_CPPFLAGS to avoid unwanted expansion of dts content
that matches some predefined macros.

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

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
---
Changes in v2:
	- Use '-ansi' instead of '-undef.'

 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 := -ansi -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

* [U-Boot] [PATCH] dts/Makefile: Turn off system-/gcc-specific predefined macros
  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-26 21:26 ` [U-Boot] [PATCH,v2] dts/Makefile: Turn off some " Horst Kronstorfer
@ 2012-08-10 21:50 ` Wolfgang Denk
  2 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Denk @ 2012-08-10 21:50 UTC (permalink / raw)
  To: u-boot

Dear Horst Kronstorfer,

In message <1342184620-31448-1-git-send-email-hkronsto@frequentis.com> you wrote:
> 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(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I object to intellect without discipline;  I object to power without
constructive purpose.
	-- Spock, "The Squire of Gothos", stardate 2124.5

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

* [U-Boot] [PATCH, v2] dts/Makefile: Turn off some predefined macros
  2012-07-26 21:26 ` [U-Boot] [PATCH,v2] dts/Makefile: Turn off some " Horst Kronstorfer
@ 2012-08-10 21:53   ` Wolfgang Denk
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Denk @ 2012-08-10 21:53 UTC (permalink / raw)
  To: u-boot

Dear Horst Kronstorfer,

In message <1343337995-1291-1-git-send-email-hkronsto@frequentis.com> you wrote:
> Add '-ansi' to DTS_CPPFLAGS to avoid unwanted expansion of dts content
> that matches some predefined macros.
> 
> Example: A number of PowerPC related *.dts files in the kernel define a
> property named 'linux,network-index' which (w/o '-ansi') is expanded to
> '1,network-index' by the preprocessor because of '#define linux 1.'
> 
> Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
> ---
> Changes in v2:
> 	- Use '-ansi' instead of '-undef.'
> 
>  dts/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied this one instead, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Overflow on /dev/null, please empty the bit bucket.

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.