Errors while compiling SWIG wrappers on Solaris

  • Thread starter Michael Schmitt
  • Start date
M

Michael Schmitt

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'
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Michael said:
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
 
M

Michael Schmitt

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
 
M

Martin v. =?iso-8859-15?q?L=F6wis?=

Michael Schmitt said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top