Subject: 1.3 SPARC secr set available, and gcc bugs
To: None <tech-toolchain@NetBSD.ORG>
From: Todd Vierling <tv@NetBSD.ORG>
List: tech-toolchain
Date: 01/09/1998 09:09:23
<NetBSD-developers-group>
I've finally prepared a working, non-1.3A-library, secr set for sparc and it
is being uploaded to ftp.netbsd.org:~tv/secr.tgz. (Paul, please pick it up
no earlier than 30 minutes from now and put it in Its Place.) I found out
why it was building against my system's 1.3A libraries, and this is a
severe, multifaceted problem.
</NetBSD-developers-group>
When DESTDIR is set, cc is passed the '-nostdlib' option to make ld search
only the -L library paths on the command line. Problem is, this option is
never passed to ld, and ld ends up getting libc from /usr/lib anyway. I'm
not quite sure why ld puts the preference of /usr/lib first, but this needs
to be fixed. (The .mk files don't even set -nostdlib on a shared library
creation with DESTDIR set, nor do they specify -L/path/to/libdir. These
options should end up passed both to cc _and_ ld.)
On a sidenote, where is gcc's `specs' file? Does our gcc not use one?
That's a useful file to tweak, even if empty by default. I'll see if I can
make a reasonable patch to the in-tree gcc to have it deliberately look for
/usr/libdata/specs as the default specs file (it currently searches for
/usr/libexec/NetBSD/specs, and a couple other weird paths). We _should_
ship with a real `specs' file to allow tweaking by the end user.
Additionally, ld.so does not honor LD_NOSTD_PATH at all. I tried setting
this to test binaries against my DESTDIR tree, and it still wound up
searching for libs in /usr/lib. Huh!? I ended up having to rename my 1.3A
libc.so so that it would force all binaries to see (and test against) an
earlier libc. Same goes for setting both LD_NOSTD_PATH _and_
LD_NO_INTERN_SEARCH.
And, why in the world does the cc command line include crt0.o in a DESTDIR
build? Does -nostdlib imply -nostartfiles in our gcc? It appears to link
properly, but shouldn't finding crt0 be an internal function of gcc, or its
specs file, unless -nostartfiles is specified?
Oh, the woes of the GNU. I'm going to see how many of these problems I can
quickly and reasonably fix.
=====
===== Todd Vierling (Personal tv@pobox.com) =====
== "There's a myth that there is a scarcity of justice to go around, so
== that if we extend justice to 'those people,' it will somehow erode the
== quality of justice everyone else receives." -- Maria Price