failed to link to librwtool.a -- "shared library must be position independant" Hi,
I want to build a shared library(libocl.sl) which uses roguewave
tools.h++. I don't want to link to the librwtool.sl since I don't like
my target having unnecessary runtime dependancy. So I tried to link to
the static archive /usr/lib/librwtool.a instead, but got the following
linking error:
>/opt/aCC/bin/aCC +O2 +inst_v +eh "-Dstd=" +DA2.0
+W740,600,908,684,5004,829,741,749,823,495,438,863 ,336,612,552 -z -ext
-w -Wl,-N +Z -Wl,+s +Oprocelim -Wl,+nommap -b -o libocl.sl -Wl,-Fl
libmyosl.a -lstream -lstd -l:librwtool.a
-L/opt/jdk1.4.1_02/jre/lib/PA_RISC/server -ljvm -lrt
/usr/ccs/bin/ld: DP relative code in file
/usr/lib/librwtool.a(cstring.o) - shared library must be position
independent. Use +z or +Z to recompile.
My understanding on this error is that librwtool.a has non-relocatable
stuff in it, and it needs to be rebuilt with +z or +Z flag. (Am I
right ?) However, I found that /usr/lib/librwtool.a is identified as
"relocatable" library:
>file /usr/lib/librwtool.a
/usr/lib/librwtool.a: archive file -PA-RISC1.1 relocatable library
I am totally lost here. I wonder how I can know whether an archieve is
position independant or not ? Is it ever possible to build a shared
library from an archieve librwtool.a. If it is not position
independant, where can I find one ?
Is there anything wrong with my compilation ?
Thanks,
C.J. |