Comment 0 for bug 1942352

Revision history for this message
Apteryx (maxco) wrote :

Hello,

I've spent much time trying to figure out why linking the Jami daemon [0] as a shared library against Ubuntu's own build of FFmpeg or our own would *not* work (any version, from 18.04 to 21.04), while it would link just fine in Debian.

It turns out this is caused by Ubuntu's usage of -Bsymbolic-functions by default:

ffmpeg/libavcodec$ gcc -shared -Wl,-Bsymbolic -o libfoo.so h264_cabac.o cabac.o => OK

But,

ffmpeg/libavcodec$ gcc -shared -Wl,-Bsymbolic -o libfoo.so h264_cabac.o cabac.o -Wl,-Bsymbolic-functions
/usr/bin/ld: h264_cabac.o: relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

This is rather confusing!

Any idea of how this can be resolved/worked around?

Thanks,

Maxim