This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Dynamic linker is unable to find GCC libraries
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Dynamic linker is unable to find GCC libraries
- From: Kjetil Torgrim Homme <kjetilho at ifi dot uio dot no>
- Date: 20 Jun 2001 20:17:15 +0200
- References: <20000705144533.A8033@idefix.arc.nasa.gov> <orvgyk6xin.fsf@guarana.lsd.ic.unicamp.br> <20000705160119.A12004@idefix.arc.nasa.gov> <or1z1854cq.fsf@guarana.lsd.ic.unicamp.br> <20000706111851.C28027@idefix.arc.nasa.gov>
I was surprised to find that this bug hadn't been fixed yet.
$ g++ hello.cc
$ ./a.out
ld.so.1: ./a.out: fatal: libstdc++.so.3: open failed: No such file or directory
Killed
I don't think it is acceptable to tell our users to add
-Wl,-R/local/gnu/lib/gcc-lib/sparc-sun-solaris2.7/3.0
when they link a C++ project ... :-)
I fixed it by changing the definition of "*libgcc:" in specs. It
seems to work, but I'm sure there are better ways of doing it.
BEFORE:
*libgcc:
%{shared-libgcc:-lgcc_s%M -lgcc}%{static-libgcc:-lgcc}%{!shared-libgcc:%{!static-libgcc:%{shared:-lgcc_s%M -lgcc}}}%{!shared-libgcc:%{!static-libgcc:%{!shared:-lgcc}}}
AFTER:
*libgcc:
%{shared-libgcc:-R/local/gnu/lib/gcc-lib/sparc-sun-solaris2.7/3.0 -lgcc_s%M -lgcc}%{static-libgcc:-lgcc}%{!shared-libgcc:%{!static-libgcc:%{shared:-R /local/gnu/lib/gcc-lib/sparc-sun-solaris2.7/3.0 -lgcc_s%M -lgcc}}}%{!shared-libgcc:%{!static-libgcc:%{!shared:-lgcc}}}
(I had to do the same thing on Linux.)
Kjetil T.
PS. Please CC me on any replies, I'm not a member of the mailing list.