Public bug reported: 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 [0] https://git.jami.net/savoirfairelinux/ring-daemon ** Affects: ffmpeg (Ubuntu) Importance: Undecided Status: New ** Tags: ffmpeg linking pic static ** Package changed: xfe (Ubuntu) => ffmpeg (Ubuntu) ** Description changed: 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 + + [0] https://git.jami.net/savoirfairelinux/ring-daemon -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1942352 Title: Ubuntu's use of -Bsymbolic-functions prevents linking a shared object from static FFmpeg To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/1942352/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs