[FFmpeg-user] relocation R_X86_64_PC32 against symbol `ff_w1111' can not be used when making a shared object; recompile with -fPIC
Gabriel Pettier
gabriel.pettier at gmail.com
Mon Aug 24 20:13:22 CEST 2015
Hello,
I'm trying to build the ffpyplayer project on ubuntu, which depends on
ffmpeg and sdl, i cloned both, built them, copied the produced .a where
needed, and then went to build ffpyplayer. When it tried to link,
though, i got the following error:
```
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/ffpyplayer/player.o /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libavcodec.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libavdevice.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libavfilter.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libavformat.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libavutil.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libswscale.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libswresample.a /home/tangible/Dev/ffpyplayer/ffmpeg/lib/libpostproc.a /home/tangible/Dev/ffpyplayer/sdl/lib/libSDL2.so -o /home/tangible/Dev/ffpyplayer/ffpyplayer/player.so
/usr/bin/ld:
/home/tangible/Dev/ffpyplayer/ffmpeg/lib/libswscale.a(rgb2rgb.o):
relocation R_X86_64_PC32 against symbol `ff_w1111' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
```
I tried adding the -fPIC option to ffpyplayer options for gcc, didn't
help, added --enable-pic to ./configure of ffmpeg (and make clean&&
make), didn't help, i also tried exporting CFLAGS to -fPIC and rebuild
both ffmpeg and sdl, and it didn't work, i tried a few more things like
passing cc="gcc -fPIC", to ./configure, and i never got past that (i
also made sure i wasn't building against versions installed in the
system, by uninstalling all -dev versions of libav* on my system (ubuntu
15.04). I tried looking through all the involved .a and .so to see what
was compiled with -fPIC or not (but answers on stackoverflow about how
to check that are all different and often saying they should work "most
of the time", which is only so useful…).
Sooo, any pointer greatly appreciated, i'm apparently not the first one
to struggle with this one, but i couldn't find a solution that worked
for me.
Thanks for the great work!
More information about the ffmpeg-user
mailing list