This is the mail archive of the
mailing list for the GCC project.
Re: Possible GCC 4.3 driver regression caused by your patch
- From: Greg Schafer <gschafer at zip dot com dot au>
- To: Carlos O'Donell <carlos at codesourcery dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc at gcc dot gnu dot org
- Date: Mon, 3 Mar 2008 09:29:18 +1100
- Subject: Re: Possible GCC 4.3 driver regression caused by your patch
- References: <20080301225746.GA25180@eyo32.local> <47CAEF1E.firstname.lastname@example.org>
On Sun, Mar 02, 2008 at 01:17:02PM -0500, Carlos O'Donell wrote:
> Greg Schafer wrote:
> >Hi Carlos and Mark,
> >Your "Relocated compiler should not look in $prefix" patch here:
> >appears to have caused a regression in my GCC 4.3 testing.
> >In summary, there is a small window *during the GCC build itself* where GCC
> >does not pick up the correct startfiles. For example, when GCC_FOR_TARGET
> >called to build the target libraries, the startfiles in $prefix/lib are not
> >used. Instead, the startfiles from the host's /usr/lib are used which
> >my build. Note that the problem seems to rectify itself once the just-built
> >GCC is installed into $prefix.
> >Here's the scenario:
> > - Native build
> > - i686-pc-linux-gnu
> > - --prefix=/temptools
> > - Glibc already installed in /temptools/lib
> What options did you use to configure the compiler? Could you double
> check your host system is actually i686-pc-linux-gnu? When you say
> "breaks my build", what error are you seeing?
The problem boils down to this:
- when xgcc is run from $objdir, GCC thinks it is a relocated compiler
- your patch changed the behaviour of relocated compilers
- therefore your patch also changed the behaviour of GCC when it is run
from $objdir eg: when building the target libs. This is the key point
that breaks my build.
The following patch restores the old behaviour and fixes my build. I suspect
what is really needed is for GCC to somehow differentiate when it is being
run from $objdir and when it is truly relocated. Thoughts?
diff -Naur gcc-4.3.0-RC-20080222.orig/gcc/gcc.c gcc-4.3.0-RC-20080222/gcc/gcc.c
--- gcc-4.3.0-RC-20080222.orig/gcc/gcc.c 2008-01-24 18:57:12.000000000 +0000
+++ gcc-4.3.0-RC-20080222/gcc/gcc.c 2008-03-02 06:07:36.000000000 +0000
@@ -6370,6 +6370,11 @@
NULL, PREFIX_PRIORITY_LAST, 0, 1);
+ add_prefix (&startfile_prefixes,
+ concat (standard_exec_prefix,
+ standard_startfile_prefix, NULL),
+ NULL, PREFIX_PRIORITY_LAST, 0, 1);
/* Sysrooted prefixes are relocated because target_system_root is
For the record, the scenario I quoted initially was contrived to demonstrate
the problem. The real breakage happens in a slightly more complicated
procedure that involves bootstrapping a 64-bit toolchain from a 32-bit host.