Subject: how rpath is set in gcc build
To: None <tech-toolchain@netbsd.org>
From: None <mcmahill@mtl.mit.edu>
List: tech-toolchain
Date: 08/31/2002 09:54:43
I'm sending here instead of tech-pkg since the lang/gcc package should be
in sync with our in tree toolchain and more toolchain gurus probably read
this one...

I'm trying to understand whats going on here with libstdc++.so.  From the
warning during linking, it looks like its using the correct libstdc++, but
then ldd indicates that the rpath isn't set right.  So my question is,
how can I cause the gcc package to pre-pend
/usr/pkg/gcc-2.95.3/lib/gcc-lib/alpha--netbsd/2.95.3 to the rpath during
linking?  For that matter, how do I check what g++ thinks it should be?  

c++ -dumpspecs shows
*link:
-m elf64alpha   -e __start   %{O*:-O3} %{!O*:-O1}   %{assert*} %{R*}
%{shared:-shared}   %{!shared:     -dc -dp     %{!nostdlib:%{!r*:%{!e*:-e
__start}}}     %{
!static:       %{rdynamic:-export-dynamic}
%{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}
%{static:-static}}

but i'm not quite sure how to interpret that or if this is even the right
thing to look at.

Suggestions?

-Dan

bondage 726 # cat testprog.cpp
#include <iostream>
int main();
int main() {
    std::cout << "Hello World!\n";
    return 0;
}

bondage 727 # /usr/pkg/gcc-2.95.3/bin/c++ -o testprog testprog.cpp 
/usr/pkg/gcc-2.95.3/lib/gcc-lib/alpha--netbsd/2.95.3/libstdc++.so:
warning: reference to compatibility vfork(); include <unistd.h> for
correct reference

bondage 728 # ldd testprog
testprog:
         -lstdc++ => /usr/lib/libstdc++.so
         -lm.0 => /usr/lib/libm.so.0
         -lc.12 => /usr/lib/libc.so.12

bondage 729 # printenv | grep LD_