Subject: bl3 eating -Wl,--rpath -Wl,/path flags to gcc
To: None <tech-pkg@NetBSD.org>
From: Dan McMahill <dmcmahill@NetBSD.org>
List: tech-pkg
Date: 03/24/2004 19:04:09
Trying to debug a shared library issue, I found that the bl3 scripts seem to be
eating a required -Wl,--rpath -Wl,/path/to/shared/lib flag to gcc. Any ideas
on how to stop this from happening? In the build log, I see:
libtool --mode=link gcc -Wl,-R/usr/pkg/pvm3/lib/NETBSDALPHA -O2 -mieee \
-I/usr/pkg/include -I../../include -DCTIMEISTIMET -DSOCKADHASLEN \
-DRSHCOMMAND=\"/usr/bin/ssh\" -DHASERRORVARS -DNOREXEC -DNEEDMENDIAN \
-DSYSERRISCONST -o hello ../../examples/hello.c -L../../lib/NETBSDALPHA -lpvm3
*** [buildlink3] Warning: libtool detected -L../../lib/NETBSDALPHA
*** [buildlink3] Warning: libtool replaced -lpvm3 with ../../lib/NETBSDALPHA/libpvm3.la
gcc -O2 -mieee -I/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/include \
-I../../include -DCTIMEISTIMET -DSOCKADHASLEN -DRSHCOMMAND=\"/usr/bin/ssh\" \
-DHASERRORVARS -DNOREXEC -DNEEDMENDIAN -DSYSERRISCONST -o .libs/hello \
../../examples/hello.c ../../lib/NETBSDALPHA/.libs/libpvm3.so \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/lib \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/pvm3/lib/NETBSDALPHA \
-Wl,--rpath -Wl,/usr/pkg/pvm3/lib/NETBSDALPHA
so, we have passed -Wl,--rpath -Wl,/usr/pkg/pvm3/lib/NETBSDALPHA to gcc. Now in
work.bondage/.work I see:
[*] /usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/bin/gcc -O2 -mieee \
-I/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/include \
-I../../include -DCTIMEISTIMET -DSOCKADHASLEN -DRSHCOMMAND="/usr/bin/ssh" \
-DHASERRORVARS -DNOREXEC -DNEEDMENDIAN -DSYSERRISCONST -o .libs/hello \
../../examples/hello.c ../../lib/NETBSDALPHA/.libs/libpvm3.so \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/lib \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/pvm3/lib/NETBSDALPHA \
-Wl,--rpath -Wl,/usr/pkg/pvm3/lib/NETBSDALPHA
<.> /usr/pkgsrc-current/parallel/pvm3/work.bondage/.gcc/bin/gcc -O2 -mieee \
-I/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/include \
-I../../include -DCTIMEISTIMET -DSOCKADHASLEN -DRSHCOMMAND=\"/usr/bin/ssh\" \
-DHASERRORVARS -DNOREXEC -DNEEDMENDIAN -DSYSERRISCONST -o .libs/hello \
../../examples/hello.c ../../lib/NETBSDALPHA/.libs/libpvm3.so \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/.buildlink/lib \
-L/usr/pkgsrc-current/parallel/pvm3/work.bondage/pvm3/lib/NETBSDALPHA
so we have lost the -Wl,--rpath -Wl,/usr/pkg/pvm3/lib/NETBSDALPHA stuff. And
of course once installed:
1 % ldd /usr/pkg/pvm3/bin/NETBSDALPHA/hello
/usr/pkg/pvm3/bin/NETBSDALPHA/hello:
-lpvm3.3 => not found
-lc.12 => /usr/lib/libc.so.12
2 % env LD_LIBRARY_PATH=/usr/pkg/pvm3/lib/NETBSDALPHA ldd /usr/pkg/pvm3/bin/NETBSDALPHA/hello
/usr/pkg/pvm3/bin/NETBSDALPHA/hello:
-lpvm3.3 => /usr/pkg/pvm3/lib/NETBSDALPHA/libpvm3.so.3
-lc.12 => /usr/lib/libc.so.12
So am I doing something wrong or is bl3 broken?
-Dan
--