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 07:19:34PM +0200, Franz Sirl wrote:
> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
> To: Richard.Earnshaw@arm.com,
>  Richard Earnshaw <rearnsha@arm.com>,
>  gcc-patches@gcc.gnu.org,
>  gbsadler1@lcisp.com,
>  dj@redhat.com,
>  gcc-bugs@gcc.gnu.org
> Subject: Re: [PATCH] gcc/Makefile.in gcc-3_0-branch, pass CFLAGS to stage1_build
> Cc: Richard.Earnshaw@arm.com
> 
> On Monday 26 March 2001 18:35, 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 second the backout request, I have no problems, but I agree with Richards 
> arguments. People can always pass STAGE1_CFLAGS to get different flags for 
> stage1 (which is useful sometimes).
> My understanding is:
>  - passing CFLAGS to the build sets the flags for stage2+ and target libraries
>  - with BOOT_CFLAGS you can override the flags used for stage2+
>  - pass STAGE1_CFLAGS to override flags for stage1 in a native build
> 
> Hmm, I just notice the toplevel Makefile doesn't handle STAGE1_CFLAGS, that 
> may be the real bug here. Hmm2, reminds me to check if passing  
> MAKEINFO/MAKEINFOFLAGS to toplevel works correctly in current sources...
> 
Here is a patch for that very problem, STAGE1_CFLAGS, as well as my
previous patch to revert CFLAGS passing.

Gordon Sadler



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

* Makefile.in (EXTRA_GCC_FLAGS): Pass STAGE1_CFLAGS to submakes.
						 

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.68.4.3
diff -p -u -r1.68.4.3 Makefile.in
--- Makefile.in	2001/03/08 05:42:49	1.68.4.3
+++ Makefile.in	2001/03/26 17:26:29
@@ -464,6 +464,7 @@ EXTRA_GCC_FLAGS = \
 	"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
 	"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
 	"`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
+	"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
 	"`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)

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