This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR bootstrap/18058
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 6 Mar 2006 22:07:24 +0100
- Subject: Re: [PATCH] Fix PR bootstrap/18058
- References: <200603051923.10302.ebotcazou@libertysurf.fr>
> 2006-03-05 Eric Botcazou <ebotcazou@libertysurf.fr>
>
> PR bootstrap/18058
> * configure.in: Add -fkeep-inline-functions to CFLAGS for stage 1
> if the bootstrap compiler is a GCC version that supports it.
> * configure: Regenerate.
> gcc/
> * Makefile.in (BUILD_RTL): Add build/vec.o.
> (build/gencondmd.o): Filter out -fkeep-inline-functions.
> (build/genextract): Delete.
> (build/genautomata): Likewise.
Zack privately suggested the following slightly improved version.
--
Eric Botcazou
Index: configure.in
===================================================================
--- configure.in (revision 111596)
+++ configure.in (working copy)
@@ -2382,6 +2382,21 @@ case $build in
stage1_cflags="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
;;
esac
+
+# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
+if test "$GCC" = yes; then
+ saved_CFLAGS="$CFLAGS"
+
+ # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
+ CFLAGS="$CFLAGS -fkeep-inline-functions"
+ AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
+ AC_TRY_COMPILE(,,
+ [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
+ [AC_MSG_RESULT([no])])
+
+ CFLAGS="$saved_CFLAGS"
+fi
+
AC_SUBST(stage1_cflags)
# Enable -Werror in bootstrap stage2 and later.
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in (revision 111596)
+++ gcc/Makefile.in (working copy)
@@ -840,7 +840,7 @@ LDEXP_LIB = @LDEXP_LIB@
# even if we are cross-building GCC.
BUILD_LIBS = $(BUILD_LIBIBERTY)
-BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
+BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o \
build/min-insn-modes.o build/gensupport.o build/print-rtl.o
BUILD_ERRORS = build/errors.o
@@ -2913,6 +2913,11 @@ build/gencondmd.o : build/gencondmd.c $(
coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H) \
$(FUNCTION_H) $(REGS_H) $(RECOG_H) real.h output.h $(FLAGS_H) \
$(RESOURCE_H) toplev.h reload.h except.h
+# This pulls in tm-pred.h which contains inline functions wrapping up
+# predicates from the back-end so those functions must be discarded.
+# No big deal since gencondmd.c is a dummy file for non-GCC compilers.
+build/gencondmd.o : \
+ BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS))
# ...these are the programs themselves.
build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
@@ -2977,10 +2982,7 @@ genprogmd = attr attrtab automata codes
extract flags mddeps opinit output peep preds recog
$(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_RTL) $(BUILD_ERRORS)
-# These programs need files over and above what they get from the above list.
-build/genextract$(build_exeext) : build/vec.o
-
-build/genautomata$(build_exeext) : build/vec.o
+# These programs need libs over and above what they get from the above list.
build/genautomata$(build_exeext) : BUILD_LIBS += -lm
# These programs are not linked with the MD reader.