This is the mail archive of the gcc-bugs@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]

Re: Dynamic linker is unable to find GCC libraries


On Jul  5, 2000, Benoit Hudson <bhudson@ptolemy.arc.nasa.gov> wrote:

>         we don't pass -R to the linker because your program might hang even
>         if it isn't using the library.
> Is easily refuted by:
>         every C++ program uses libstdc++.

That's not true.  Why do you think so?

> I've fixed the problem in my personal installation by making g++ be a
> script (and c++ is a symlink to g++)
>         #! /bin/sh
>         exec real-g++ "$@" -R $(libdir)

> I'd have to write about the same, but -rpath, on my linux box.

> So it's easy to fix, but it shouldn't be the user's responsibility.

The usual recommended fix for this problem is to add the directory
containing libstdc++ to /etc/ld.so.conf, so that users don't have to
bother to add it to their own LD_LIBRARY_PATHs.

Another option for you is to set the environment variable LD_RUN_PATH
so that, whenever you link a program, the directories listed in this
variable will be encoded in the executable, and, when it's run,
they'll be searched.

Yet another option is to change the SONAME of libstdc++.so so that it
becomes the its full pathname.  But then, you won't be allowed to move
libstdc++.so to another directory, ever.

-- 
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


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