Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Errors while compiling SWIG wrappers on Solaris

Reply
Thread Tools

Errors while compiling SWIG wrappers on Solaris

 
 
Michael Schmitt
Guest
Posts: n/a
 
      09-09-2003
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'



 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      09-09-2003
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

 
Reply With Quote
 
 
 
 
Michael Schmitt
Guest
Posts: n/a
 
      09-10-2003
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


 
Reply With Quote
 
Martin v. =?iso-8859-15?q?L=F6wis?=
Guest
Posts: n/a
 
      09-10-2003
Michael Schmitt <(E-Mail Removed)> 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(, 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems while compiling perl on solaris 10 ashish Perl Misc 8 11-26-2006 02:23 PM
Linker errors while compiling C++ applications on AIX 5.3 machine r.nikhilk@gmail.com C++ 2 12-07-2005 09:23 PM
compiling errors while initializing a structure has function pointers as members rashmi C Programming 2 09-20-2005 03:56 PM
"const <anonymous>**" and "<unknown type>" errors while compiling H. S. C++ 3 03-20-2005 05:35 AM
errors while compiling the java file for the example bank application in j2ee tutorial Nachiketh Java 0 02-23-2004 04:25 PM



Advertisments