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


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.


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