Shared C++ library bug under HP-UX 11

David M. Johnson davidj@haht.com
Tue Dec 7 08:44:00 GMT 1999


g++ 2.95.2 is unable to build an shared C++ library
under HP-UX 11.00

I built g++ with --enable-shared and with binutils
2.9.1, but when I try to build a shared C++ library
I get an error message like this:

   g++ -c -fpic libso.cpp -I/usr/local/include/g++-3
   g++ -fpic -shared -o libso.sl libso.o -lstdc++
   /bin/ld: DP relative code in file
   /opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.2/libstdc++.a(iostream.o)
   - shared library must be position independent.  Use +z or +Z to
recompile.
   collect2: ld returned 1 exit status
   make: *** [libso.sl] Error 1

I looked at the compiler line that built iostream.o
and it includes the -fPIC option. I also looked at the
iostream.o file itself and it is an "s800 relocatable object"
so I am stumped.

I have included some very simple sample code that
demonstrates this problem.

Please let me know if there is any other information
that I can provide to help with this (apparent) bug.

Thanks,
Dave

-------------------------------------------------------------------
David M. Johnson, Software Developer             davidj at haht.com
HAHT Software ( http://www.haht.com )                    919-786-5268

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hpsotest.tgz
Type: application/x-gzip
Size: 624 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19991207/6fb3863a/attachment.bin>


More information about the Gcc-bugs mailing list