You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Daniel May <da...@spryware.com> on 2005/12/29 02:17:46 UTC

64-bit build errors

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.
 
Any Ideas ?
 
Daniel May
daniel@may.com
 


Re: 64-bit build errors

Posted by Joe Orton <jo...@redhat.com>.
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