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]
Other format: [Raw text]

Re: Sysroot library search tweak


Daniel Jacobowitz <drow@mvista.com> writes:

> On Wed, Jul 16, 2003 at 01:06:10PM -0400, Daniel Jacobowitz wrote:
> > I noticed recently that my sysrooted cross-compilers had started searching
> > $prefix/lib.  The following patch fixes this.  A little bit of explanation
> > is needed:
> > 
> >   - The definition of STANDARD_STARTFILE_PREFIX is entirely superfluous. 
> >     It's always defined in DRIVER_DEFINES.
> >   - Therefore, it is always unlibsubdir, which is always "../../..".
> >   - Therefore, it is never an absolute path.
> > 
> > But, tooldir/unlibsubdir is $exec_prefix/lib, which is a host library
> > directory.  So we shouldn't search it.  The code used to be protected by
> > *cross_compile == '0', but "|| target_system_root" was added.
> > 
> > OK?
> 
> Ping.
> 
> By the way, there's a typo in the patch below - where it says "== 0"
> imagine "== '0'" as described above :)

- You need to update the documentation

- STANDARD_STARTFILE_PREFIX is defined in some machine-specific files,
  please check that you didn't break them

- We should search sysroot/STANDARD_STARTFILE_PREFIX instead, does that work?

> > 2003-07-16  Daniel Jacobowitz  <drow@mvista.com>
> > 
> > 	* gcc.c (STANDARD_STARTFILE_PREFIX): Remove unnecessary definition.
> > 	(main): Remove unnecessary case.  Only use standard_startfile_prefix
> > 	if native.
> > 
> > --- gcc-3.3/gcc/gcc.c.orig	2003-07-16 10:43:15.000000000 -0400
> > +++ gcc-3.3/gcc/gcc.c	2003-07-16 10:45:59.000000000 -0400
> > @@ -1346,9 +1346,6 @@ static const char *gcc_exec_prefix;
> >  #ifndef STANDARD_EXEC_PREFIX
> >  #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/"
> >  #endif
> > -#ifndef STANDARD_STARTFILE_PREFIX
> > -#define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
> > -#endif
> >  #ifndef TOOLDIR_BASE_PREFIX
> >  #define TOOLDIR_BASE_PREFIX "/usr/local/"
> >  #endif
> > @@ -6165,15 +6162,10 @@ main (argc, argv)
> >  	add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
> >  			      "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
> >  
> > -      /* If standard_startfile_prefix is relative, base it on
> > -	 standard_exec_prefix.  This lets us move the installed tree
> > -	 as a unit.  If GCC_EXEC_PREFIX is defined, base
> > -	 standard_startfile_prefix on that as well.  */
> > -      if (IS_ABSOLUTE_PATHNAME (standard_startfile_prefix))
> > -	add_sysrooted_prefix (&startfile_prefixes,
> > -			      standard_startfile_prefix, "BINUTILS",
> > -			      PREFIX_PRIORITY_LAST, 0, NULL, 1);
> > -      else
> > +      /* Base standard_startfile_prefix (unlibsubdir) on standard_exec_prefix.
> > +	 This lets us move the installed tree as a unit.  If GCC_EXEC_PREFIX
> > +	 is defined, base standard_startfile_prefix on that as well.  */
> > +      if (*cross_compile == 0)
> >  	{
> >  	  if (gcc_exec_prefix)
> >  	    add_prefix (&startfile_prefixes,
> > 
> 
> -- 
> Daniel Jacobowitz
> MontaVista Software                         Debian GNU/Linux Developer
> 

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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