This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: problem with gcc3.2 compiler
Bart Veer wrote:
Question for Mark - do you happen to know if -finit-priority was
already the default by gcc 2.95.2? Alternatively, does anybody still
have a vintage compiler of that era around and can run some tests? I
think 2.95.2 is the oldest version of the compiler we care about. If
-finit-priority was already ignored by then we could just extend the
pkgconf/rules.mak hack to remove it completely. That would be
preferable to trying to figuring out the compiler version at
configure-time or build-time.
As it happens, I have 2.95 sources sitting here, and it does indeed look
like -finit-priority was the default in 2.95 (and presumably 2.95.2).
So it looks like your hunch was right, and we should just drop it in
rules.mak.
The attached patch will do that, and I thought we may as well divvy up the
CFLAGS and CXXFLAGS now anyway for symmetry; and remove -fvtable-gc which
is at best broken, and at worst deprecated and to be removed from GCC
(unfortunately).
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/ChangeLog,v
retrieving revision 1.123
diff -u -5 -p -r1.123 ChangeLog
--- ChangeLog 15 Oct 2003 19:58:56 -0000 1.123
+++ ChangeLog 24 Oct 2003 18:03:26 -0000
@@ -1,5 +1,10 @@
+2003-10-24 Jonathan Larmour <jifl@eCosCentric.com>
+
+ * pkgconf/rules.mak: Remove -finit-priority and -fvtable-gc
+ from all flags.
+
2003-10-15 Gary Thomas <gary@mlbassoc.com>
2003-09-23 Andrew Lunn <andrew.lunn@ascom.ch>
* pkgconf/rules.mak Only pass C flags to the C compiler.
Workaround for BUG #1000035.
Index: pkgconf/rules.mak
===================================================================
RCS file: /cvs/ecos/ecos/packages/pkgconf/rules.mak,v
retrieving revision 1.12
diff -u -5 -p -r1.12 rules.mak
--- pkgconf/rules.mak 15 Oct 2003 19:58:56 -0000 1.12
+++ pkgconf/rules.mak 24 Oct 2003 18:03:26 -0000
@@ -57,15 +57,22 @@ export HOST_CC := gcc
# include any dependency rules generated previously
ifneq ($(wildcard *.deps),)
include $(wildcard *.deps)
endif
+# GCC since 2.95 does -finit-priority by default so remove it from old HALs
+CFLAGS := $(subst -finit-priority,,$(CFLAGS))
+CFLAGS := $(subst -fvtable-gc,,$(CFLAGS))
+
# Separate C++ flags out from C flags.
ACTUAL_CFLAGS = $(CFLAGS)
ACTUAL_CFLAGS := $(subst -fno-rtti,,$(ACTUAL_CFLAGS))
ACTUAL_CFLAGS := $(subst -Woverloaded-virtual,,$(ACTUAL_CFLAGS))
ACTUAL_CFLAGS := $(subst -fvtable-gc,,$(ACTUAL_CFLAGS))
+ACTUAL_CFLAGS := $(subst -finit-priority,,$(ACTUAL_CFLAGS))
+
+ACTUAL_CXXFLAGS = $(CFLAGS)
# pattern matching rules to generate a library object from source code
# object filenames are prefixed to avoid name clashes
# a single dependency rule is generated (file extension = ".o.d")
%.o.d : %.c
@@ -82,21 +89,21 @@ endif
ifeq ($(HOST),CYGWIN)
@mkdir -p `cygpath -w "$(dir $@)" | sed "s@\\\\\\\\@/@g"`
else
@mkdir -p $(dir $@)
endif
- $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
+ $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(ACTUAL_CXXFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
@rm $(@:.o.d=.tmp)
%.o.d : %.cpp
ifeq ($(HOST),CYGWIN)
@mkdir -p `cygpath -w "$(dir $@)" | sed "s@\\\\\\\\@/@g"`
else
@mkdir -p $(dir $@)
endif
- $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
+ $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(ACTUAL_CXXFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
@rm $(@:.o.d=.tmp)
%.o.d : %.S
ifeq ($(HOST),CYGWIN)
@@ -125,21 +132,21 @@ endif
ifeq ($(HOST),CYGWIN)
@mkdir -p `cygpath -w "$(dir $@)" | sed "s@\\\\\\\\@/@g"`
else
@mkdir -p $(dir $@)
endif
- $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
+ $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(ACTUAL_CXXFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.d=.tmp) > $@
@rm $(@:.d=.tmp)
%.d : %.cpp
ifeq ($(HOST),CYGWIN)
@mkdir -p `cygpath -w "$(dir $@)" | sed "s@\\\\\\\\@/@g"`
else
@mkdir -p $(dir $@)
endif
- $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
+ $(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(ACTUAL_CXXFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.d=.tmp) > $@
@rm $(@:.d=.tmp)
%.d : %.S
ifeq ($(HOST),CYGWIN)