This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building shared library with g77 on HP-UX


On Tue, Oct 07, 2003 at 09:50:13PM +0200, Toon Moene wrote:
> Albert Chin wrote:
> >I'm trying to build the SciPy module for Python 2.3.2 using GCC 3.3 on
> >HP-UX 11i. GCC was built with --enable-shared so I do have a
> >libg2c.sl.
> 
> ...
> 
> >  /usr/ccs/bin/ld: Invalid loader fixup in text space needed in output
> >  file for symbol "f_exit" in input file
> >  "/opt/TWWfsw/gcc33/lib/libfrtbegin.a(frtbegin.o)"
> 
> ...
> 
> >Should libfrtbegin.a be built with -fpic?
> 
> I don't know.  libfrtbegin.a contains the static part of the run-time 
> library, i.e. that part that should be part of the executable.
> 
> Perhaps it's incorrectly picked up while building a shared library (but 
> then I wonder why I don't get these bug reports from other g77 users) ...

Some systems like Solaris and Linux don't care if a library was built
with PIC or non-PIC. They'll happily link in the object file/library
to the resulting shared library. HP-UX cares and therefore gives the
error above.

I added a -v option to the link line and get:
  /opt/TWWfsw/gcc33/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3/collect2 -z -b
  -o build/lib.hp-ux-B.11.11-9000/785-2.3/scipy/linalg/fblas.sl
  -L/opt/TWWfsw/gcc33r/lib -Lbuild/temp.hp-ux-B.11.11-9000/785-2.3
  -Lbuild/temp.hp-ux-B.11.11-9000/785-2.3
  -L/opt/TWWfsw/gcc33/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3
  -L/usr/ccs/bin -L/usr/ccs/lib -L/opt/langtools/lib
  -L/opt/TWWfsw/gcc33/lib
  build/temp.hp-ux-B.11.11-9000/785-2.3/opt/TWWfsw/python232p/lib/python2.3/site-packages/f2py2e/src/fortranobject.o
  build/temp.hp-ux-B.11.11-9000/785-2.3/build/temp.hp-ux-B.11.11-9000/785-2.3/fblasmodule.o
  -lfblas_f2py -llapack_src -lblas_src -lg2c -lm -lfrtbegin -lg2c -lm
  -lgcc_s -lgcc_s

So yes, "-lfrtbegin" is being linked in. Is this wrong? If so, how do
I fix?

-- 
albert chin (china@thewrittenword.com)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]