This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Pedantic preprocessor
- From: Sergei Gavrikov <w3sg at SoftHome dot net>
- To: eCos patches list <ecos-patches at ecos dot sourceware dot org>
- Date: Sun, 14 Oct 2007 00:49:07 +0300
- Subject: Pedantic preprocessor
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
--- 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