On Thu, Apr 27, 2006 at 10:50:07AM +0100, Andrew Haley wrote:
> x86 is special.  On x86 it's somewhat possible to build shared
> libraries without PIC, but it's a really bad idea.  On other arches,
> PIC is compulsory.  So:
> 
> 
> [EMAIL PROTECTED] ~]$ /usr/bin/gcc -m32 -shared -o client.so client.c
> [EMAIL PROTECTED] ~]$ /usr/bin/gcc -m64 -shared -o client.so client.c
> /usr/bin/ld: /tmp/ccaXMxyb.o: relocation R_X86_64_32 against `a local symbol' 
> can not be used when making a shared object; recompile with -fPIC

On all arches that use binutils you can use -Wl,--warn-shared-textrel
to get at least a warning about this...

        Jakub

Reply via email to