Problem building loadable .oct on HPUX

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem building loadable .oct on HPUX

Tom Goles

Hi,
I've just tried to build my first octave loadable module on HPUX 10.01
(which supports this type of stuff) but got the following link error when I
ran mkoctfile:
 
% mkoctfile ReadFile.C
Making ReadFile.C.o from ReadFile.C
Making ReadFile.C.oct from ReadFile.C.o
collect2: ld returned 1 exit status
/bin/posix/ld: DP-Relative Code in file
/usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.01/2.7.2.2.f.2/libgcc.a(__main.o)

- Shared Library must be Position-Independent  
 
Any ideas what went wrong here? This message appears to indicate that libgcc.a
needs to be shared library. Do I need to re-build libgcc as shared library?
I have not seen any flags in the INSTALL instructions for gcc that
show how to do this so if anyone has any info on how this is done
please let me know (I did try passing --enable-shared to gcc configure

script but after everything was done there were no shared libraries created).
BTW, I'm using gcc2.7.2.2.f and libg++2.7.2 on HPUX 10.01 and Solaris
2.5.1 boxes and was able to build octave with dynamic load flags for
bothsystems without much trouble and everything else I tried so far
worked fine.
 
Thanks for any info on this,
Tom Goles
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Problem building loadable .oct on HPUX

John W. Eaton-6
On  4-Apr-1997, Tom Goles <[hidden email]> wrote:

| I've just tried to build my first octave loadable module on HPUX 10.01
| (which supports this type of stuff) but got the following link error when I
| ran mkoctfile:
|  
| % mkoctfile ReadFile.C
| Making ReadFile.C.o from ReadFile.C
| Making ReadFile.C.oct from ReadFile.C.o
| collect2: ld returned 1 exit status
| /bin/posix/ld: DP-Relative Code in file
| /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.01/2.7.2.2.f.2/libgcc.a(__main.o)
|
| - Shared Library must be Position-Independent  
|  
| Any ideas what went wrong here? This message appears to indicate
| that libgcc.a needs to be shared library. Do I need to re-build
| libgcc as shared library?

Did you also use the --enable-lite-kernel option for configure?  Did
that create working .oct files?

It looks like the last line of mkoctfile is wrong.  It should probably
just be

  $CXX -shared -fPIC -o $octfile $objfile

instead of

  $CXX -shared -o $octfile $objfile $LIBFLAGS $RLD_FLAG $OCTAVE_LIBS \
       $FLIBS $LEXLIB $TERMLIBS $LIBS

Can you try this and let me know if it solves the problem?

Thanks,

jwe