On Wed, Feb 21, 2007 at 03:27:44PM -0600, Phuong, Guy wrote:
> Make  (after perl Makefile.PL) I get an error message and I'm forced to stop
> here.   The error message is as follows

Hello, Guy.

[SNIP]
> gcc  -shared Suma.o suma.o  -o blib/arch/auto/PDL/Suma/Suma.so   -lm
> /usr/bin/ld: suma.o: relocation R_X86_64_PC32 against `cos@@GLIBC_2.2.5' can
> not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
> make: *** [blib/arch/auto/PDL/Suma/Suma.so] Error 1
> 
> I'm not exactly sure what the error is.  Do you have any idea? 

I don't have the references near me at the moment.... But it tells you
a possible solution. Did you try passing -fPIC to gcc (as a $CFLAGS or
whatever in the makefile).

I tend to use this flag whenever I make a shared library on a PPC
(Linux). From the gcc man page:

       -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, PowerPC and SPARC.

           Position-independent code requires special support, and therefore
           works only on certain machines.


Previously on using -fpic

       -fpic
                                                                  Such code
           accesses all constant addresses through a global offset table
           (GOT).  The dynamic loader resolves the GOT entries when the pro-
           gram starts (the dynamic loader is not part of GCC; it is part of
           the operating system). 

Sorry I have tottally forgotten the reasons why and tend to refer to it
as compilere voodoo...

Timothy

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to