I got a similar error when compiling ffmpeg on an x86_64 machine running Oracle Linux 6.3. Oracle Linux is based on Red Hat and thus is similar to CentOS in the original question.
Configure:
./configure --enable-shared --enable-nonfree --enable-libmp3lame --enable-libfaac --enable-libx264 --enable-encoder=x264 --enable-gpl
Mark:
/usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libx264.a: could not read symbols: Bad value
In my case, this one, although partially dependent on Ubuntu, has shed more light on the main issue regarding x86_64 systems in general:
"I believe that if you enable FFmpeg sharing, you must do the same on x264 on x86_64 systems, otherwise you will have shared FFmpeg and PIC non-PIC static x264."
The fix was to ensure that the x264 sources that I originally compiled using the --enable-static flag with the setting (which generated "/usr/local/lib/libx264.a") were recompiled using the "--enable-shared" command, which generates the correct target "/usr/local/lib/libx264.so":
1st Attempt: 1. cd /tmp 2. wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 3. tar xfv last_x264.tar.bz2; 4. cd x264-snapshot-xxxxxx 5. ./configure --enable-static 6. make && make install 2nd Attempt: 1. cd /tmp/x264-snapshot-xxxxxx 2. make distclean 3. ./configure --enable-shared 4. make && make install
Saheed
source share