Fun with shared libs on HPUX - Request for help

Robert A Nesius rnesius@ichips.intel.com
Sun Mar 26 15:30:00 GMT 2000


Howdy all, 
I managed to get a nice build of gcc 2.95.1 built by following 
(roughly) the following steps. 

On: HPUX 10.20 

Build binuntils 2.9.1 - install bin utils into area where gcc 
  will be installed.  

Configure gcc 2.95.1 like so: 
setenv CC gcc
../gcc-2.95.1/configure --prefix=/usr/intel/pkgs/gcc/2.95.1 --enable-shared 
--enable-threads --without-gnu-ld --with-gnu-as  
--with-as=/usr/intel/pkgs/gcc/2.95.1/hppa1.1-hp-hpux10.20/bin/as 

And that seemed to work great!  But the problem I'm running 
into is that my libstdc++ lib is apparantly not really a 
shared library, even though -fPIC is getting set by the 
configure.  When I try to create a shared library that needs 
to pull in routines from libstdc++, I get errors indicating I 
need to build libstdc++ with +z or +Z.  

eg: 
[pdxhp204]-> ~ 55> /usr/intel/pkgs/gcc/2.95.1/bin/g++ -shared -fpic -o libworld.
sl my_helloworld.o
/usr/ccs/bin/ld: DP relative code in file /usr/intel/pkgs/gcc/2.95.1/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.1/libstdc++.a(iostream.o) - shared library must be position
    independent.  Use +z or +Z to recompile.
collect2: ld returned 1 exit status

I'm having trouble bottoming out on what the best way to fix this 
is.  Build libstdc++ by itself separately after the main build 
and reinstall it, using aCC and +Z?  

Working around the build issues for HPUX has caused me to get into a 
slightly confused state as to how fix this.  Could some HPUX savvy 
people offer some insights?  

Thanks much! 

-Rob
-- 
#include <sig.h>
------------------------------------------------------------------
Robert Nesius             rnesius@ichips.intel.com    503.264.2830



More information about the Gcc-help mailing list