GNOME Bugzilla – Bug 759752
[gst-libav] link error with clang or gcc on FreeBSD
Last modified: 2017-07-14 09:07:00 UTC
Created attachment 317751 [details] [review] Add -Bsymbolic configure check gst-libav doesn't link on FreeBSD with either clang or gcc. libav is build with -Bsymbolic. The solution we can up with was to build all parts with -Bsymbolic (-Bsymbolic-functions is not sufficient) so teach the gstreamer part to build with -Bsymbolic too. Both parts are build with -DPIC and -fPIC, so that is not it. *** Warning: Linking the shared library libgstlibav.la against the *** static library ../../gst-libs/ext/libav/libavutil/libavutil.a is not portable! libtool: link: rm -fr .libs/libgstlibav.exp libtool: link: /usr/bin/nm -B .libs/libgstlibav_la-gstav.o .libs/libgstlibav_la-gstavprotocol.o .libs/libgstlibav_la-gstavcodecmap.o .libs/libgstlibav_la-gstavutils.o .libs/libgstlibav_la-gstavaudenc.o .libs/libgstlibav_la-gstavvidenc.o .libs/libgstlibav_la-gstavauddec.o .libs/libgstlibav_la-gstavviddec.o .libs/libgstlibav_la-gstavcfg.o .libs/libgstlibav_la-gstavdemux.o .libs/libgstlibav_la-gstavmux.o .libs/libgstlibav_la-gstavdeinterlace.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/libgstlibav.exp libtool: link: /usr/bin/grep -E -e "^_*gst_plugin_.*" ".libs/libgstlibav.exp" > ".libs/libgstlibav.expT" libtool: link: mv -f ".libs/libgstlibav.expT" ".libs/libgstlibav.exp" libtool: link: cc -shared -fPIC -DPIC .libs/libgstlibav_la-gstav.o .libs/libgstlibav_la-gstavprotocol.o .libs/libgstlibav_la-gstavcodecmap.o .libs/libgstlibav_la-gstavutils.o .libs/libgstlibav_la-gstavaudenc.o .libs/libgstlibav_la-gstavvidenc.o .libs/libgstlibav_la-gstavauddec.o .libs/libgstlibav_la-gstavviddec.o .libs/libgstlibav_la-gstavcfg.o .libs/libgstlibav_la-gstavdemux.o .libs/libgstlibav_la-gstavmux.o .libs/libgstlibav_la-gstavdeinterlace.o -Wl,-rpath -Wl,/home/gst/gst/head/gst-plugins-base/gst-libs/gst/pbutils/.libs -Wl,-rpath -Wl,/home/gst/gst/head/gst-plugins-base/gst-libs/gst/video/.libs -Wl,-rpath -Wl,/home/gst/gst/head/gst-plugins-base/gst-libs/gst/audio/.libs -Wl,-rpath -Wl,/usr/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs -Wl,-rpath -Wl,/home/gst/gst/head/orc/orc/.libs -Wl,-rpath -Wl,/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs -Wl,-rpath -Wl,/home/gst/gst/head/gstreamer/libs/gst/base/.libs -Wl,-rpath -Wl,/home/gst/gst/head/gstreamer/gst/.libs -Wl,-rpath -Wl,/usr/local/lib -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/video/.libs -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/audio/.libs -L/usr/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs -L/home/gst/gst/head/orc/orc/.libs -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs -L/home/gst/gst/head/gstreamer/libs/gst/base/.libs -L/home/gst/gst/head/gstreamer/gst/.libs ../../gst-libs/ext/libav/libavformat/libavformat.a ../../gst-libs/ext/libav/libavcodec/libavcodec.a ../../gst-libs/ext/libav/libswresample/libswresample.a ../../gst-libs/ext/libav/libavutil/libavutil.a -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/allocators -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/app -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/audio -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/fft -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/pbutils -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/riff -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/rtp -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/rtsp -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/sdp -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag -L/home/gst/gst/head/gst-plugins-base/gst-libs/gst/video -L/usr/local/lib /home/gst/gst/head/gst-plugins-base/gst-libs/gst/pbutils/.libs/libgstpbutils-1.0.so /home/gst/gst/head/gst-plugins-base/gst-libs/gst/video/.libs/libgstvideo-1.0.so /home/gst/gst/head/gst-plugins-base/gst-libs/gst/audio/.libs/libgstaudio-1.0.so /usr/home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs/libgsttag-1.0.so /home/gst/gst/head/orc/orc/.libs/liborc-0.4.so -lpthread /home/gst/gst/head/gst-plugins-base/gst-libs/gst/tag/.libs/libgsttag-1.0.so /home/gst/gst/head/gstreamer/libs/gst/base/.libs/libgstbase-1.0.so /home/gst/gst/head/gstreamer/gst/.libs/libgstreamer-1.0.so -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 -lintl -lm -lz -lbz2 -llzma -pthread -pthread -g -O2 -Wl,-Y/usr/local/lib -pthread -Wl,-soname -Wl,libgstlibav.so -Wl,-retain-symbols-file -Wl,.libs/libgstlibav.exp -o .libs/libgstlibav.so /usr/bin/ld: ../../gst-libs/ext/libav/libavcodec/libavcodec.a(hevc_cabac.o): relocation R_X86_64_PC32 against `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value
I did that change earlier today already :) Let me know if that helped commit d2397bec1791eb0ed5d436f343a11e69d8a29bdc Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Dec 21 12:34:11 2015 +0100 configure: Use -Bsymbolic-functions if available While this is more useful for libraries, some of our plugins with multiple files and some internal API can also benefit from this.
Created attachment 317757 [details] [review] Use -Bsymbolic instead of -Bsymbolic-functions
We should first understand why this is needed. The linker flags of a library should not matter for linking that library to something else. I expect either a problem in ffmpeg (it should not use -Bsymbolic here or something is wrong with that specific symbol, compare to others to find differences) or a problem with your toolchain.
Both ffmpeg and the gstreamer code in gst-libav are build with -fPIC -DPIC as far as I seen. Linking against the dynamic ffmpeg build by standalone ffmpeg works fine. When I copy the libavcodec.a from the standalone ffmpeg into the gst-libav tree it results in the same link issue. I don't know where to look next.
Are the configure flags or the compiler/linker commandlines different for the standalone ffmpeg and the bundled one? Can ffmpeg be changed (by configure parameter) to use -Bsymbolic-functions instead of -Bsymbolic?
Koop?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!