[FFmpeg-devel] Problem building shared libraries using svn-r11100+ on x86_64

David Bolt 7c6ebd986448736acd2250be77d2cc38
Tue Dec 4 15:09:27 CET 2007

I've a problem building the shared libraries on a 64bit system using any
svn release from 11100 if MMX is enabled. While I can build them on a
32bit system, all the 64bit builds fail with the following error:

i386/dsputil_mmx.o: relocation R_X86_64_PC32 against `ff_pw_3' can not be used when making
a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/bin/ld: final link
failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libavcodec.so.51] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/ffmpeg/libavcodec'
make: *** [lib] Error 2

However, the code is compiled with the option -fPIC as shown by this:

gcc -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2  -fPIC -I/usr/include/gsm
-fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch
-Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign
-I"/usr/src/packages/BUILD/ffmpeg" -I"/usr/src/packages/BUILD/ffmpeg"
-I"/usr/src/packages/BUILD/ffmpeg"/libavutil -I"/usr/src/packages/BUILD/ffmpeg"/libavcodec
-I"/usr/src/packages/BUILD/ffmpeg"/libavdevice -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_ISOC9X_SOURCE -DHAVE_AV_CONFIG_H -I"/usr/src/packages/BUILD/ffmpeg"/libswscale
-I"/usr/src/packages/BUILD/ffmpeg"/libavcodec  -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I"/usr/src/packages/BUILD/ffmpeg"
-I"/usr/src/packages/BUILD/ffmpeg" -I"/usr/src/packages/BUILD/ffmpeg"/libavutil -O2 -g
-fmessage-length=0 -D_FORTIFY_SOURCE=2  -fPIC -I/usr/include/gsm -fomit-frame-pointer -g
-Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith
-Wredundant-decls -Wno-pointer-sign -fPIC -DPIC -c -o i386/dsputil_mmx.o

This is using the following:

CFLAGS='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2  -fPIC -I/usr/include/gsm'

./configure --shlibdir=/usr/lib64 --prefix=/usr \
--mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared \
--enable-libmp3lame --enable-libvorbis --enable-libtheora \
--enable-libfaad --enable-libfaac --enable-libxvid --enable-liba52 \
--enable-swscaler --enable-pp --enable-gpl --enable-vhook \
--enable-x11grab --enable-libgsm --enable-libx264 \
--enable-libamr-nb --enable-libamr-wb

        David Bolt

Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys
                 | SUSE 10.1 32bit  | openSUSE 10.2 32bit | openSUSE 10.3 32bit
SUSE 10.0 64bit  | SUSE 10.1 64bit  | openSUSE 10.2 64bit |
RISC OS 3.11     | RISC OS 3.6      | TOS 4.02            | openSUSE 10.3 PPC

More information about the ffmpeg-devel mailing list