[rrd-users] Relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object

Joshua Keroes joshua at keroes.com
Thu Sep 23 19:11:06 CEST 2010


I solved a suspiciously similar problem yesterday trying to build
net-snmp-5.5 against perl-5.12.2. Both were built from source on a 64bit
CentOS VM using physical Opteron 8300's. The net-snmp-5.5 compile was
breaking during 'make' complaining of -fPIC issues, too.

I rebuilt net-snmp-5.5 a dozen times with different strategies - all failed.
I finally resolved the compile problem by rebuilding Perl with an explicit
-fPIC. This might get you running:

CFLAGS='-m64 -mtune=nocona' ./Configure -des -A ccflags=-fPIC && make &&
make test && make install

Given your reference to X86_64_32, you might not want the -m64 flag. Anyway,
adjust or delete CFLAGS depending on your CPU's and architecture.

After Perl was built, the net-snmp-5.5 compile ran smoothly without any
fancy args.

Good luck,
Joshua

On Thu, Sep 23, 2010 at 7:17 AM, Johans <johan.segers at ext.ec.europa.eu>wrote:

>
> I am migrating my BB with LARRD/RRDTOOL 1.0.49 from 32-bit Red hat Linux 3
> to
> a virtual Red Hat 5.4 64-bit.
>
> BB is installed and works bit I get the following problem when I try to
> compile/link the RRDTOOL.
>
> I run:
>
> 1. sh configure --enable-shared   -> OK
> 2. make -> I get the message below even after changing in the Makefile the
> CCFLAGS .. -fPIC and CXXFLAGS= ..-fPIC (see in red)
>
> The essential line below is : relocation R_X86_64_32 against `a local
> symbol' can not be used when making a shared object; recompile with -fPIC
> Changes made to Makefile:
>
> CFLAGS = -g -O2 -fPIC -Wall -pedantic -Ws  ….
> CXXFLAGS = -g -O2 -fPIC
>
> Has anyone an idea how to solve this problem ?
>
> Rgds,
> Johan
>
> make[3]: Entering directory `/usr/local/rrdtool-1.0.49/perl-shared'
> gcc -c  -I.. -I../src -I../gd1.3 -D_REENTRANT -D_GNU_SOURCE
> -fno-strict-aliasing -pipe -Wdeclaration-after-statement
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -I/usr/include/gdbm -DHAVE_CONFIG_H -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"1.000491\"
> -DXS_VERSION=\"1.000491\" -fPIC
> "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"
> -DPERLPATCHLEVEL=8 RRDs.c
> In file included from ../src/rrd_tool.h:24,
>                 from RRDs.xs:13:
> ../config.h:191:1: warning: "VERSION" redefined
> <command line>:1:1: warning: this is the location of the previous
> definition
> RRDs.c: In function âXS_RRDs_xportâ:
> RRDs.c:302: warning: unused variable âtargâ
> RRDs.c:301: warning: unused variable âRETVALâ
> RRDs.xs:227: warning: unused variable ârow_cntâ
> Running Mkbootstrap for RRDs ()
> chmod 644 RRDs.bs
> rm -f blib/arch/auto/RRDs/RRDs.so
> gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic RRDs.o
> -L../src/.libs/ -lrrd_private   -lm -o blib/arch/auto/RRDs/RRDs.so     \
>                \
>
> /usr/bin/ld: ../src/.libs//librrd_private.a(parsetime.o): relocation
> R_X86_64_32 against `a local symbol' can not be used when making a shared
> object; recompile with -fPIC
> ../src/.libs//librrd_private.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[3]: *** [blib/arch/auto/RRDs/RRDs.so] Error 1
> make[3]: Leaving directory `/usr/local/rrdtool-1.0.49/perl-shared'
> make[2]: *** [perl_shared] Error 2
> make[2]: Leaving directory `/usr/local/rrdtool-1.0.49'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/rrdtool-1.0.49'
> make: *** [all] Error 2
>
> --
> View this message in context:
> http://rrd-mailinglists.937164.n2.nabble.com/Relocation-R-X86-64-32-against-a-local-symbol-can-not-be-used-when-making-a-shared-object-tp5563232p5563232.html
> Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20100923/b8c3346e/attachment.htm 


More information about the rrd-users mailing list