Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Library build error relocation/fPIC?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
andyjeffries
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 196
Location: Stevenage, Herts, UK

PostPosted: Sun Dec 12, 2004 5:14 pm    Post subject: Library build error relocation/fPIC? Reply with quote

Hi there,

As part of my application I distribute a statically linked library. However, when I compile the library on my new A64 box I get:

/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: gtkscintilla.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
gtkscintilla.o: could not read symbols: Bad value

Can anyone help me with what this means and what I have to do to make the build 32/64 bit clean?

Thanks,


Andy
_________________
Developer of gPHPEdit
A8N-SLI/AMD X2 4800+/2GB Dual Channel/GF 7900GT OC
Back to top
View user's profile Send private message
herbie
Guru
Guru


Joined: 09 Oct 2002
Posts: 319
Location: London UK

PostPosted: Mon Dec 13, 2004 12:33 am    Post subject: Reply with quote

Your error message gives you the solution to your problem "recompile with -fPIC". i.e add -fPIC to you CFLAGS when compileing this shared library. According to the gcc man page:
Quote:
-fPIC
If supported for the target machine, emit position-independent code,
suitable for dynamic linking and avoiding any limit on the size of
the global offset table. This option makes a difference on the m68k
and the SPARC.

i.e you need to compile shared libs with -fPIC on amd64.
Back to top
View user's profile Send private message
andyjeffries
Apprentice
Apprentice


Joined: 14 Apr 2004
Posts: 196
Location: Stevenage, Herts, UK

PostPosted: Mon Dec 13, 2004 9:28 am    Post subject: Reply with quote

Doh! Thanks, I was adding it to the LDFLAGS (thinking it was an error from the linker). Teach me to try and work on a Sunday ;-)

Are there any documents on how to port applications (GTK ideally) to AMD64?
_________________
Developer of gPHPEdit
A8N-SLI/AMD X2 4800+/2GB Dual Channel/GF 7900GT OC
Back to top
View user's profile Send private message
phoolish
n00b
n00b


Joined: 20 Nov 2004
Posts: 19

PostPosted: Thu Jul 07, 2005 9:11 pm    Post subject: Reply with quote

Tried your solution with no luck. I'll keep looking. Thanks.
_________________
and karma was her middle name. ~ a friend.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum