gcc default library location

Nathaniel Mallet Nathaniel.Mallet@home.com
Wed Aug 1 19:55:00 GMT 2001


I considered the possibility that this could be the wrong mailing list.
However, it is gcc that's giving me a hard time (and I apologize if that
wasn't clear), not glibc (although the glibc install is what started this),
and it is a gcc question:

Basically, I created very simple "Hello World" application to test my glibc
2.2.3 install. When I run the following:

    gcc -o hw main.o

I get a series of unresolved symbols found in /usr/local/lib/ld.so.6. These
errors showed up in gcc *after* I ran make install for glibc, and so I'm
trying to figure out what default environment settings gcc is picking up to
link to this particular version of ld.so.6, instead of the one found in /lib
(glibc 2.1.9). So far, I've verified:

    - Environement variables
    - The gcc specs files
    - /etc/ld.so.conf

And they all point to /lib. Not one of these locations is pointing to
/usr/local/lib

I do have an temporary fix for this issue, which is to rename
/usr/local/lib/ld.so.6 to something unrelated, and create a softlink to
/lib/ld.so.6. But this does not help me understand why gcc is linking my
application with /usr/local/lib/ld.so.6.

As for why I installed glibc in the default location, it's because I wasn't
interested in installing glibc 2.2.3 as my primary library. The glibc manual
suggests leaving the default install location if glibc is to be used as a
test library. The glibc HOWTO then suggests changes to force gcc to use the
test library during compilation, which I did *not* follow, specifically to
avoid this issue. I'd rather have a working compiler than a working test
library.

I appreciate how busy you must be, and how difficult and frustrating it can
be to deal with novice developers. If you still believe this is a glibc
issue as opposed to a gcc configuration issue, then disregard this email; I
won't push the issue any further.

Thank you for your efforts,

Nathaniel

----- Original Message -----
From: "Alexandre Oliva" <aoliva@redhat.com>
To: <nathaniel.mallet@home.com>
Cc: <gcc-help@gcc.gnu.org>
Sent: Wednesday, August 01, 2001 8:38 AM
Subject: Re: gcc default library location


> On Aug  1, 2001, Nathaniel Mallet <nathaniel.mallet@home.com> wrote:
>
> > I recently build glibc 2.2.3 with gcc 2.95.3. The build went off ok,
> > and make check passed. I then ran make install in the default location
> > /usr/local.
>
> > But now, gcc keeps trying to link /usr/local/lib/ld.so.6 by default,
> > and I'd like to switch it back to /lib/ld.so.6.
>
> What do you mean by `gcc keeps trying to link /usr/local/lib/ld.so.6'?
> Anyway, perhaps you shouldn't have build and installed in the default
> location /usr/local, but used /usr instead?
>
> Anyway, this mailing list is about GCC, not glibc, and the problem
> appears to be in glibc, so maybe you'd get better answers asking in a
> glibc-specific forum?
>
> --
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-help mailing list