This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] gcc/Makefile.in gcc-3_0-branch, pass CFLAGS to stage1_build


On Mon, Mar 26, 2001 at 05:35:12PM +0100, Richard Earnshaw wrote:
> > > During stage1, we should be able to override CFLAGS from the
> > > commandline. The comments in the Makefile.in say this explicitly.
> > > But, they are not being passed to stage1 build. I was reading some
> > build
> > > logs when I noticed stage1 being built with some odd flags,
> > > investigation led me to wrongly conclude the previous patch. Now, I
> > am
> > > fairly certain of the attached patch being correct.
> > 
> > It looks correct to me, but I wonder if there are additional flags
> > (the stage2 list is quite long) that stage1 should have.
> >  AFAICT from comments around stag1_build, it is not really important
> > to pass stage1 lots of flags as the bootstrap may be done with a
> > native compiler. However, by the time stage2_build is called,
> > xgcc_stage1 is available with support for all of gcc's flags.
> 
> > > Is attaching this here correct? Or should I let this thread die and
> > > submit a new patch?
> > 
> > It at least needs a valid ChangeLog entry, but this mailing list is
> > the correct place for it.
> > 
> > > -   $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
> > 
> > > +   $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
> >  \
> > > +           CFLAGS="$(CFLAGS)"
> >  Ok here goes. I'll attach patch again, include ChangeLog entry and
> > change subject/thread to match. 
> 
> 
> Hmm, this topic was discussed over two years ago (I brought it up).  It 
> was rejected then because of the risk that the installed compiler might 
> not be able to build a usable stage1 compiler.  Sadly, this is exactly 
> what is happening now on arm-netbsd when we try to bootstrap with the 
> system compiler (egcs-1.2 derived).
> 
> See the following mails for a discussion on the subject:
> 
> http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00172.html
> 
> http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00185.html
> 
> http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00189.html
> 
> http://gcc.gnu.org/ml/gcc-patches/1998-11/msg00207.html
> 
> 
> Can we back out the following please?  There's no technical need for it, 
> and the only effect is that it shaves a small amount of time of the stage2 
> build.
> 
> + 2001-03-22  Gordon Sadler  <gbsadler1@lcisp.com>
> + 
> +       * Makefile.in (stage1_build): Pass CFLAGS to stage1_build.
> + 
> 
> 
I see your point now, too bad there wasn't any comment in the file to
reflect this... I've added that now with the following patch. 



2001-03-26  Gordon Sadler  <gbsadler1@lcisp.com>

	* Makefile.in (stage1_build): Revert previous change so we don't 
	pass CFLAGS to stage1_build and add comment as to why to prevent
	this in the future.
	


Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.602.2.9
diff -p -u -r1.602.2.9 Makefile.in
--- Makefile.in	2001/03/22 21:47:12	1.602.2.9
+++ Makefile.in	2001/03/26 16:53:52
@@ -63,7 +63,7 @@ ALLOCA_FLAGS =
 ALLOCA_FINISH = true
 
 # Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
+# CFLAGS always -g, to decrease chances of a bad bootstrap with host cc.
 # BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
 # compilations.
 # XCFLAGS is used for most compilations but not when using the GCC just built.

@@ -2899,8 +2899,7 @@ STAGE2_FLAGS_TO_PASS = \
 # we can guarantee will build with the native compiler, and also it is the
 # only thing useful for building stage2.
 stage1_build:
-	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
-		CFLAGS="$(CFLAGS)"
+	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" 
 	touch stage1_build
 	echo stage1_build > stage_last
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]