From e236d4f71a014cb26417428cc3dac881200e455d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 7 Jul 2020 11:13:49 +0200 Subject: [PATCH] gstreamer-full: Fix link with x264 If a static build is requested and x264 plugin has been enabled the full link fails with: /usr/bin/ld: subprojects/x264/libx264.a(cabac-a.o): relocation R_X86_64_PC32 against symbol `x264_cabac_range_lps' can not be used when making a shared object; recompile with -fPIC Fixes #108 Part-of: --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meson.build b/meson.build index aaf19f4126..41a2a04379 100644 --- a/meson.build +++ b/meson.build @@ -246,6 +246,14 @@ if get_option('default_library') == 'static' ) install_headers('gstinitstaticplugins.h', subdir : 'gstreamer-1.0/gst') + # Avoid a x264 link issue described here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/108 + # Similar issue has been found with VLC: https://mailman.videolan.org/pipermail/vlc-devel/2009-March/057640.html + gstfull_link_args = [] + if cc.has_link_argument('-Wl,-Bsymbolic') + gstfull_link_args += ['-Wl,-Bsymbolic'] + endif + + gst_dep = subproject('gstreamer').get_variable('gst_dep') # Get a list of libraries that needs to be exposed in the ABI. @@ -272,6 +280,7 @@ if get_option('default_library') == 'static' gstfull = both_libraries('gstreamer-full-1.0', init_static_plugins_c, link_with : all_plugins, + link_args: gstfull_link_args, link_whole : exposed_libs, dependencies : gst_dep, install : true,