This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Sysroot library search tweak
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Jason Thorpe <thorpej at wasabisystems dot com>,Marc Espie <espie at cvs dot openbsd dot org>
- Date: Wed, 20 Aug 2003 16:07:48 -0400
- Subject: Re: Sysroot library search tweak
- References: <20030716170610.GA18620@nevyn.them.org> <20030820191204.GA29923@nevyn.them.org> <jmbrukdrs6.fsf@desire.geoffk.org>
On Wed, Aug 20, 2003 at 12:59:21PM -0700, Geoff Keating wrote:
> 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?
Argh. When I wrote this I checked for other definitions and did not
find any - I must have missed openbsd.h and netbsd.h. The patch is
wrong, in that case.
I'm not sure what to do with this. Those are the only two definitions
in the tree, and they're wrapped with:
/* NETBSD_NATIVE is defined when gcc is integrated into the NetBSD
source tree so it can be configured appropriately without using
the GNU configure/build mechanism. */
#ifdef NETBSD_NATIVE
Jason, is this code still used for NetBSD? Marc, how about for OpenBSD?
>
> > > 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>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer