Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 1999 06:43:23 +1000
From:      John Birrell <jb@cimlogic.com.au>
To:        "David O'Brien" <obrien@freebsd.org>
Cc:        John Birrell <jb@cimlogic.com.au>, current@freebsd.org
Subject:   Re: Built-in linker library search paths
Message-ID:  <19990830064323.D36761@freebsd1.cimlogic.com.au>
In-Reply-To: <19990829110017.A14719@dragon.nuxi.com>; from David O'Brien on Sun, Aug 29, 1999 at 11:00:17AM -0700
References:  <19990829173737.C36761@freebsd1.cimlogic.com.au> <19990829110017.A14719@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 29, 1999 at 11:00:17AM -0700, David O'Brien wrote:
> > I'd like to remove the search paths altogether, leaving the gcc
> > LIB_SPEC and LD_LIBRARY_PATH environment variable to get the /right/
> > path all the time.
> 
> Can you post a patch first?  IIRC jdp wanted to be more "pure" with ld.so
> finding shared libs.  Many didn't like the more "pure" searching.  I
> really can't tell what the result of your proposed changes would be.

I found my own objection 8-).

I was proposing to simply remove the SEARCH_DIR() lines in the linker
scripts on the assumption that gcc (and egcs) knows about /usr/lib.
What I didn't check before sending the original email was that gcc
actually passes -L/usr/lib to ld. It doesn't, despite the fact that
gcc -print-search-dirs reports /usr/lib as a search directory.
Even with -nostdlib, gcc still passes the built-in search paths to
ld, except for /usr/lib. Yuck.

The conclusion that I reached was that the gcc sources would need
to be changed to pass -L/usr/lib to ld and that if I did this,
we would have a build problem where ld would be built without
the searching before the new gcc. I don't think Cygnus would want
this sort of change, and I'm certain FreeBSD users don't want the
chicken-an-egg build problem.

I found this problem building cross tools. I've settled (for the time
being) on leaving a single SEARCH_DIR() in the linker script for
/usr/lib or the cross-build library path depending on which target
I'm building for. I think I'm at the point where I have all the binutils
stuff configured to be able to build i386, m68k, powerpc, mips and sparc
(and alpha only on alpha) hosted on FreeBSD, targeted to LynxOS, VxWorks,
RTEMS, WinNT, NetBSD, Linux, SunOS, ...

I'm still trying to find a simple way to build gcc/egcs for each based
on the way you build FreeBSD's host compiler.

-- 
John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990830064323.D36761>