[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shared libs with non-PIC code on i386



>I have a problem with linking PIC (position independent code) with
>non-PIC code in a shared library. The current policy requires all
>libraries to contain only PIC code, and the gcc (especially gcc-3.0)
>refuses to do such linking on non-x86 plattforms.

Really?  I can't think of anything in gcc that would enforce that, or indeed 
any way that gcc would even be able to tell.  I'm pretty sure it works on at 
least some non-x86 platforms, and it should work on all of them in an ideal 
world.

>In my case, the problem are the xlibs, particularly libXxf86dga.a. This
>library provides the DGA support. Unfortunately, it contains
>non-strip'able non-PIC code, so any *shared* library which wants to use
>DGA access via libXxf86dga must be linked with non-PIC code. This
>problems affects the DGA plugin in my Allegro library and probably some
>others, ie. SDL.

Well, you might investigate how hard it would be to build libXxf86dga.a as 
PIC.  I don't know if the X makefiles can cope with the idea of using PIC code 
for static libraries, but this seems like the best approach.

p.


Attachment: pgpLtn8gIk81B.pgp
Description: PGP signature


Reply to: