[vlc-devel] [PATCH] chromaprint: pass -Bsymbolic to fix static link on Linux.

Konstantin Pavlov thresh at videolan.org
Tue May 15 12:19:37 CEST 2018


On Tue, May 15, 2018 at 01:02:45PM +0300, RĂ©mi Denis-Courmont wrote:
> Err, isn't Bsymbolic already enabled for all VLC binaries? And why is this problem only affecting chromaprint?

Afaict, it's not enabled for everything.

There are actually two ways we set it for specific plugins,

1/ configure.ac defines SYMBOLIC_LDFLAGS:

1148 VLC_SAVE_FLAGS
1149 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
1150 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
1151   AC_TRY_LINK([],, [
1152     ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
1153   ], [
1154     ac_cv_ld_bsymbolic=""
1155   ])
1156 ])
1157 VLC_RESTORE_FLAGS
1158 SYMBOLIC_LDFLAGS="${ac_cv_ld_bsymbolic}"                                                                                                                                                                        
1159 AC_SUBST(SYMBOLIC_LDFLAGS)

And then we use it for ffmpeg-related plugins:
modules/access/Makefile.am:libavio_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(SYMBOLIC_LDFLAGS)
modules/codec/Makefile.am:libavcodec_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(SYMBOLIC_LDFLAGS)
modules/demux/Makefile.am:libavformat_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(SYMBOLIC_LDFLAGS)

2/ And for plugins like x264:

2846 if test "${enable_x264}" != "no"; then
2847       PKG_CHECK_MODULES(X264,x264 >= 0.148, [
2848         VLC_ADD_PLUGIN([x264])
2849         VLC_ADD_LIBS([x264],[${X264_LIBS}])
2850 
2851         AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
2852           VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_bsymbolic}])
2853         ])
2854 

and later:

modules/codec/Makefile.am:libx264_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_x264) -rpath '$(codecdir)'

I'm not sure why we have both ways to pass that option either of those.

-- 
VideoLAN, Vice President
www.videolan.org
+7 926 165 45 31
@cryothresh


More information about the vlc-devel mailing list