Errors while compiling SWIG wrappers on Solaris

Discussion in 'Python' started by Michael Schmitt, Sep 9, 2003.

  1. Hello.

    I am trying to compile SWIG wrappers for the Python interface of libsvm on
    SunOS 5.9, using g++ 3.2.1. I constantly get "relocations remain" error
    from the linker.

    I tried some hints I found on the web:
    "-shared" for compiling and linking.
    "-fPIC".
    "-Wl,-G".

    But none of these (also in combinations) worked. Any ideas?

    Thanks for any help.
    Michael

    --------------------
    Text relocation remains referenced
    against symbol offset in file
    <unknown> 0x2610 ../svm.o
    <unknown> 0x2614 ../svm.o
    ..
    ..
    ..
    ld: fatal: relocations remain against allocatable but non-writable sections
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `svmc.so'
     
    Michael Schmitt, Sep 9, 2003
    #1
    1. Advertising

  2. Michael Schmitt wrote:
    > I tried some hints I found on the web:
    > "-shared" for compiling and linking.
    > "-fPIC".
    > "-Wl,-G".
    >
    > But none of these (also in combinations) worked. Any ideas?
    >
    > Thanks for any help.
    > Michael
    >
    > --------------------
    > Text relocation remains referenced
    > against symbol offset in file
    > <unknown> 0x2610 ../svm.o
    > <unknown> 0x2614 ../svm.o


    svm.o is not position-independent. You need to compile *svm.o*
    with -fPIC. Passing that option to any other compiler commands,
    or the linker line, will be irrelevant. Once you've done that,
    you may find that additional object files are not
    position-independent, either, you then need to compile these
    with -fPIC as well.

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Sep 9, 2003
    #2
    1. Advertising

  3. Thanks a lot. Compiling svm.o with -fPIC worked.

    I found it very difficult to get information and a better understanding of
    the Linking process. Do you have any hints on background information, that
    helps to be able to debug such errors myself?

    Regards,
    Michael

    "Martin v. Löwis" wrote:

    > Michael Schmitt wrote:
    >> I tried some hints I found on the web:
    >> "-shared" for compiling and linking.
    >> "-fPIC".
    >> "-Wl,-G".
    >>
    >> But none of these (also in combinations) worked. Any ideas?
    >>
    >> Thanks for any help.
    >> Michael
    >>
    >> --------------------
    >> Text relocation remains referenced
    >> against symbol offset in file
    >> <unknown> 0x2610 ../svm.o
    >> <unknown> 0x2614 ../svm.o

    >
    > svm.o is not position-independent. You need to compile *svm.o*
    > with -fPIC. Passing that option to any other compiler commands,
    > or the linker line, will be irrelevant. Once you've done that,
    > you may find that additional object files are not
    > position-independent, either, you then need to compile these
    > with -fPIC as well.
    >
    > Regards,
    > Martin
     
    Michael Schmitt, Sep 10, 2003
    #3
  4. Michael Schmitt <> writes:

    > I found it very difficult to get information and a better understanding of
    > the Linking process. Do you have any hints on background information, that
    > helps to be able to debug such errors myself?


    I recommend to read the manual pages for ld(1), ld.so.1(8), and gcc(1).

    Beyond that, you really have to read and understand the ELF
    specification, and the processor handbook of the processor you are
    using. I don't think there is any popular scientific material about
    these issues, nor do I think anybody could write such material in a
    useful way: You really have to understand what "position-independent"
    means, on a processor-instruction level, to infer properties of the
    object file format.

    Regards,
    Martin
     
    Martin v. =?iso-8859-15?q?L=F6wis?=, Sep 10, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nachiketh
    Replies:
    0
    Views:
    576
    Nachiketh
    Feb 23, 2004
  2. H. S.
    Replies:
    3
    Views:
    584
    H. S.
    Mar 20, 2005
  3. rashmi
    Replies:
    2
    Views:
    481
    Lawrence Kirby
    Sep 20, 2005
  4. Replies:
    2
    Views:
    565
    Niklas Norrthon
    Dec 7, 2005
  5. ashish
    Replies:
    8
    Views:
    339
    Peter J. Holzer
    Nov 26, 2006
Loading...

Share This Page