public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* Pedantic preprocessor
@ 2007-10-13 21:49 Sergei Gavrikov
  2007-10-15 11:29 ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Gavrikov @ 2007-10-13 21:49 UTC (permalink / raw)
  To: eCos patches list

[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]

Hello list

They spoke what 'untested' GCC3.4.1 (arm-elf) generates more compact
code for float and double math than 'stable' GCC3.2.1 from ecoscentric
ftp. I use 'stable' GCC3.2.1 and build 'new' toolchain to test that.
That is (new code is a bit compact :). But, suddenly I found that the
GCC3.4.1 preprocessor is more pedantic then GCC3.2.1 one. I wonder
about CPP pedantism from other GCC suites (GCC3.4.X and GCC4.X.X). If a
described issue the below is the GCC's 3.4.1, please, forget this. If
other modern CPP cryes by a same way, a patch is attached.

SYNOPSIS

ecosconfig new sam7ex256
ecosconfig tree
make -s
U CYGHWR_HAL_ARM_AT91, new inferred value AT91SAM7S
U CYGHWR_HAL_ARM_AT91_FIQ, new inferred value 1
U CYGHWR_HAL_ARM_AT91SAM7, new inferred value at91sam7x256
headers finished
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
build finished

MEDICINE

hal_arm.cdl describes 3 make rules to build arm.inc, vectors.o and
target.ld.  CPP 'sees' all $(CFLAGS) options and cryes about the
language specific flags. I found that it's enough to replace $(CFLASG)
by $(ACTUAL_CFLAGS), and all backs as it was with CPP from GCC3.2.1:

headers finished
build finished

I like to see these 2 lines together. And if anybody knows how to fix
this issue in platform CDL, please, enlight me.

Regards,

    Sergei


[-- Attachment #2: hal_arm.cdl.patch --]
[-- Type: text/x-diff, Size: 1305 bytes --]

--- hal/arm/arch/current/cdl/hal_arm.cdl
+++ hal/arm/arch/current/cdl/hal_arm.cdl
@@ -67,7 +67,7 @@
     # n.b. grep does not behave itself under win32
     make -priority 1 {
         arm.inc : <PACKAGE>/src/hal_mk_defs.c
-        $(CC) $(CFLAGS) $(INCLUDE_PATH) -Wp,-MD,arm.tmp -o hal_mk_defs.tmp -S $<
+        $(CC) $(ACTUAL_CFLAGS) $(INCLUDE_PATH) -Wp,-MD,arm.tmp -o hal_mk_defs.tmp -S $<
         fgrep .equ hal_mk_defs.tmp | sed s/#// > $@
         @echo $@ ": \\" > $(notdir $@).deps
         @tail -n +2 arm.tmp >> $(notdir $@).deps
@@ -77,7 +77,7 @@
 
     make {
         <PREFIX>/lib/vectors.o : <PACKAGE>/src/vectors.S
-        $(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(CFLAGS) -c -o $@ $<
+        $(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(ACTUAL_CFLAGS) -c -o $@ $<
         @echo $@ ": \\" > $(notdir $@).deps
         @tail -n +2 vectors.tmp >> $(notdir $@).deps
         @echo >> $(notdir $@).deps
@@ -86,7 +86,7 @@
 
     make {
         <PREFIX>/lib/target.ld: <PACKAGE>/src/arm.ld
-        $(CC) -E -P -Wp,-MD,target.tmp -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
+        $(CC) -E -P -Wp,-MD,target.tmp -xc $(INCLUDE_PATH) $(ACTUAL_CFLAGS) -o $@ $<
         @echo $@ ": \\" > $(notdir $@).deps
         @tail -n +2 target.tmp >> $(notdir $@).deps
         @echo >> $(notdir $@).deps

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

* Re: Pedantic preprocessor
  2007-10-13 21:49 Pedantic preprocessor Sergei Gavrikov
@ 2007-10-15 11:29 ` Gary Thomas
  2007-10-16  9:18   ` Sergei Organov
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2007-10-15 11:29 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

Sergei Gavrikov wrote:
> Hello list
>
> They spoke what 'untested' GCC3.4.1 (arm-elf) generates more compact
> code for float and double math than 'stable' GCC3.2.1 from ecoscentric
> ftp. I use 'stable' GCC3.2.1 and build 'new' toolchain to test that.
> That is (new code is a bit compact :). But, suddenly I found that the
> GCC3.4.1 preprocessor is more pedantic then GCC3.2.1 one. I wonder
> about CPP pedantism from other GCC suites (GCC3.4.X and GCC4.X.X). If a
> described issue the below is the GCC's 3.4.1, please, forget this. If
> other modern CPP cryes by a same way, a patch is attached.
>
> SYNOPSIS
>
> ecosconfig new sam7ex256
> ecosconfig tree
> make -s
> U CYGHWR_HAL_ARM_AT91, new inferred value AT91SAM7S
> U CYGHWR_HAL_ARM_AT91_FIQ, new inferred value 1
> U CYGHWR_HAL_ARM_AT91SAM7, new inferred value at91sam7x256
> headers finished
> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> build finished
>
> MEDICINE
>
> hal_arm.cdl describes 3 make rules to build arm.inc, vectors.o and
> target.ld.  CPP 'sees' all $(CFLAGS) options and cryes about the
> language specific flags. I found that it's enough to replace $(CFLASG)
> by $(ACTUAL_CFLAGS), and all backs as it was with CPP from GCC3.2.1:
>
> headers finished
> build finished
>
> I like to see these 2 lines together. And if anybody knows how to fix
> this issue in platform CDL, please, enlight me.
>   
Your patch is the correct one - I've applied it.  Next time, don't
forget the ChangeLog entry.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

* Re: Pedantic preprocessor
  2007-10-15 11:29 ` Gary Thomas
@ 2007-10-16  9:18   ` Sergei Organov
  2007-10-16 20:59     ` Sergei Gavrikov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Organov @ 2007-10-16  9:18 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Sergei Gavrikov, eCos patches list

Gary Thomas <gary@mlbassoc.com> writes:
> Sergei Gavrikov wrote:
[...]
>> ecosconfig new sam7ex256
>> ecosconfig tree
>> make -s
>> U CYGHWR_HAL_ARM_AT91, new inferred value AT91SAM7S
>> U CYGHWR_HAL_ARM_AT91_FIQ, new inferred value 1
>> U CYGHWR_HAL_ARM_AT91SAM7, new inferred value at91sam7x256
>> headers finished
>> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> build finished
>>
[...]
>> I like to see these 2 lines together. And if anybody knows how to fix
>> this issue in platform CDL, please, enlight me.
>>   
> Your patch is the correct one - I've applied it.  Next time, don't
> forget the ChangeLog entry.

Is there anybody here who is willing/capable to fix the rest of HALs the
same way, as every HAL in eCos suffers from the same problem (e.g., I
recently happened to do the same thing for SPARC HAL)?

-- 
Sergei.

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

* Re: Pedantic preprocessor
  2007-10-16  9:18   ` Sergei Organov
@ 2007-10-16 20:59     ` Sergei Gavrikov
  2007-10-17 10:58       ` Sergei Organov
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Gavrikov @ 2007-10-16 20:59 UTC (permalink / raw)
  To: Sergei Organov; +Cc: Gary Thomas, eCos patches list

On Tue, Oct 16, 2007 at 01:18:04PM +0400, Sergei Organov wrote:
> Gary Thomas <gary@mlbassoc.com> writes:
> > Sergei Gavrikov wrote:
> [...]
> >> ecosconfig new sam7ex256
> >> ecosconfig tree
> >> make -s
> >> U CYGHWR_HAL_ARM_AT91, new inferred value AT91SAM7S
> >> U CYGHWR_HAL_ARM_AT91_FIQ, new inferred value 1
> >> U CYGHWR_HAL_ARM_AT91SAM7, new inferred value at91sam7x256
> >> headers finished
> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
> >> build finished
> >>
> [...]
> >> I like to see these 2 lines together. And if anybody knows how to fix
> >> this issue in platform CDL, please, enlight me.
> >>   
> > Your patch is the correct one - I've applied it.  Next time, don't
> > forget the ChangeLog entry.
> 
> Is there anybody here who is willing/capable to fix the rest of HALs the
> same way, as every HAL in eCos suffers from the same problem (e.g., I
> recently happened to do the same thing for SPARC HAL)?

I wouldn't risk to patch all arch. CDLs vis-a-vis, sorry. IMO, this is
the experts's deal.  I uses the toolchains for arm and i386 targets
only. And as I said, the CPP from a pretty old, but the stable GCC suite
(3.2.1) quite builds eCos for my targets without any warnings. 

Though, I think since the ecoscentric has offered the GCC 3.4.4 suite
for own customers, they have done something like that receipt already.
If they would confirm our way, so the someone's deal will be just a

  s/CFLAGS/ACTUAL_&/g

otherwise, a group of the testers are wanted: 

  find $ECOS_REPOSITORY -regex '.*/arch/.*/cdl/hal.*cdl' | wc -l

... So, submit the same patch for SPARC, please, if you've tested it.

Sergei

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

* Re: Pedantic preprocessor
  2007-10-16 20:59     ` Sergei Gavrikov
@ 2007-10-17 10:58       ` Sergei Organov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Organov @ 2007-10-17 10:58 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos patches list

Sergei Gavrikov <w3sg@SoftHome.net> writes:
> On Tue, Oct 16, 2007 at 01:18:04PM +0400, Sergei Organov wrote:
>> Gary Thomas <gary@mlbassoc.com> writes:
>> > Sergei Gavrikov wrote:
>> [...]
>> >> ecosconfig new sam7ex256
>> >> ecosconfig tree
>> >> make -s
>> >> U CYGHWR_HAL_ARM_AT91, new inferred value AT91SAM7S
>> >> U CYGHWR_HAL_ARM_AT91_FIQ, new inferred value 1
>> >> U CYGHWR_HAL_ARM_AT91SAM7, new inferred value at91sam7x256
>> >> headers finished
>> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> >> cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
>> >> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
>> >> build finished
>> >>
>> [...]
>> >> I like to see these 2 lines together. And if anybody knows how to fix
>> >> this issue in platform CDL, please, enlight me.
>> >>   
>> > Your patch is the correct one - I've applied it.  Next time, don't
>> > forget the ChangeLog entry.
>> 
>> Is there anybody here who is willing/capable to fix the rest of HALs the
>> same way, as every HAL in eCos suffers from the same problem (e.g., I
>> recently happened to do the same thing for SPARC HAL)?
>
> I wouldn't risk to patch all arch. CDLs vis-a-vis, sorry. IMO, this is
> the experts's deal.  I uses the toolchains for arm and i386 targets
> only. And as I said, the CPP from a pretty old, but the stable GCC suite
> (3.2.1) quite builds eCos for my targets without any warnings.

That's the case for most of us, I think, -- we only have 1--2 toolchains
in use and can't easily test global patch.

> Though, I think since the ecoscentric has offered the GCC 3.4.4 suite
> for own customers, they have done something like that receipt already.
> If they would confirm our way, so the someone's deal will be just a
>
>   s/CFLAGS/ACTUAL_&/g

My guess is that at some point somebody introduced ACTUAL_CFLAGS making
use of CFLAGS obsolete, but missed the issue that quite a few of CDLs
need to be patched accordingly, so it should be just a dumb
search-and-replace issue indeed.

> otherwise, a group of the testers are wanted: 
>
>   find $ECOS_REPOSITORY -regex '.*/arch/.*/cdl/hal.*cdl' | wc -l
>
> ... So, submit the same patch for SPARC, please, if you've tested it.

It's not trivial for me as I work with rather customized eCos tree, and
it takes some effort to rebase the patch w.r.t anonymous CVS eCos tree
and then test it. Not worth it for partial solution of a minor issue. I
just hoped it's relatively easy for somebody with comprehensive set of
toolchains to do s/CFLAGS/ACTUAL_CFLAGS/ and then test it.

-- 
Sergei.

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

end of thread, other threads:[~2007-10-17 10:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-13 21:49 Pedantic preprocessor Sergei Gavrikov
2007-10-15 11:29 ` Gary Thomas
2007-10-16  9:18   ` Sergei Organov
2007-10-16 20:59     ` Sergei Gavrikov
2007-10-17 10:58       ` Sergei Organov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).