This is the mail archive of the 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]
Other format: [Raw text]

Re: Possible GCC 4.3 driver regression caused by your patch

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 
> >is
> >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 
> >breaks
> >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?

Hi Carlos,

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 @@
 			      standard_startfile_prefix, NULL),
+	  add_prefix (&startfile_prefixes,
+		      concat (standard_exec_prefix,
+			      machine_suffix,
+			      standard_startfile_prefix, NULL),
       /* 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.


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