[x264-devel] trouble with shared object, fPIC and relocation of R_X86_64_PC32

Matt W mwood23 at gmail.com
Mon Feb 15 08:11:26 CET 2010


Hi--

I am getting this error on compiling x264 with shared object output (I
need a recent lib of x264 to build ffmpeg with x264 support):

gcc -shared -o libx264.so.84 common/mc.o common/predict.o
common/pixel.o common/macroblock.o common/frame.o common/dct.o
common/cpu.o common/cabac.o common/common.o common/mdate.o
common/set.o common/quant.o common/vlc.o encoder/analyse.o
encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o
encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o
common/x86/mc-c.o common/x86/predict-c.o common/x86/cabac-a.o
common/x86/dct-a.o common/x86/deblock-a.o common/x86/mc-a.o
common/x86/mc-a2.o common/x86/pixel-a.o common/x86/predict-a.o
common/x86/quant-a.o common/x86/sad-a.o common/x86/cpu-a.o
common/x86/dct-64.o  -Wl,-soname,libx264.so.84 -lm -lpthread -s

/usr/bin/ld: common/x86/cabac-a.o: relocation R_X86_64_PC32 against
`x264_cabac_range_lps' 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: *** [libx264.so.84] Error 1


I don't see much help online when searching for info on solving this.
one person said to enable PIC in configure, and I did even though I
had already seen it in the compilation output beforehand.  Another
mentioned that VLC needs "-Bsymbolic" in those cases, and that didn't
help me either.


system info:
version:  x264-snapshot-20100214-2245
os:  Debian 5.0.3 amd64
cc: gcc (Debian 4.3.2-1.1) 4.3.2
configure line/out:

~/src/x264-snapshot-20100214-2245$ ./configure --enable-pic
--enable-shared --enable-mp4-output  [ also tried
--extra-cflags="-Wl,-Bsymbolic" ]
fatal: Not a git repository
Platform:   X86_64
System:     LINUX
asm:        yes
avs input:  no
lavf input: yes
ffms input: no
mp4 output: yes
pthread:    yes
debug:      no
gprof:      no
PIC:        yes
shared:     yes
visualize:  no

If someone could help me along I'd greatly appreciate it.  thanks!


More information about the x264-devel mailing list