You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Orton <jo...@redhat.com> on 2006/01/02 13:20:49 UTC

Re: 64-bit build errors

On Wed, Dec 28, 2005 at 07:17:46PM -0600, Daniel May wrote:
> I was able to successfully build APR on Red Hat EL 4.  I have a shared
> library I am trying to build that is linking in APR statically.  I get
> the following error:
>  
> /usr/bin/ld: /usr/local/apr/lib/libapr-1.a(apr_strings.o): relocation
> R_X86_64_32 against `a local symbol' can not  be used when making a
> shared object; 
> recompile with -fPIC
> /usr/local/apr/lib/libapr-1.a: could not read symbols: Bad value
>  
> If I link against the shared APR lib it works fine.  I included -fPIC in
> my make, but it did not help.

You used -fPIC when building what, your library or APR?  If you want to 
link APR statically into a shared library (though this is generally a 
pretty bad idea), you need to build APR with -fPIC, e.g. using:

  CFLAGS="-fPIC" ./configure ..

Regards,

joe