Skip to content

modules: fix multiple definitions build failure

orbea requested to merge orbea/vlc:libcompat into master

Disclaimer: I tested this against commit fd1444e8 to avoid issue #28526 (closed).

With slibtool the build fails with multiple definitions of strnstr because libcompat.la is being overlinked. GNU libtool is more forgiving in this regard and silently hides the issue, but it can be easily solved by removing libcompat.la from a few Makefile.am files.

This issue was reported to the Slibtool issue tracker. https://dev.midipix.org/cross/slibtool/issue/56

rdlibtool --tag=CC --mode=link x86_64-gentoo-linux-musl-gcc -O2 -pipe -Werror=implicit-function-declaration -Werror=implicit-int -fno-strict-aliasing -pthread -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros -fvisibility=hidden -avoid-version -module -export-symbols-regex ^vlc_entry -shrext .so -no-undefined ../compat/libcompat.la ../src/libvlccore.la -Wl,-O1 -Wl,--as-needed -L/usr/lib/sidplay/builders/ -Wl,-z,defs -o libhttps_plugin.la -rpath /usr/lib/vlc/plugins/access access/http/access.lo libvlc_http.la

rdlibtool: lconf: {.name="libtool"}.
rdlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/media-video/vlc-9999/work/vlc-9999/modules"}.
rdlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 65026, .st_ino = 202103912}.
rdlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = -1 [ENOENT].
rdlibtool: lconf: openat(AT_FDCWD,"../",O_DIRECTORY,0) = 3.
rdlibtool: lconf: fstat(3,...) = 0 {.st_dev = 65026, .st_ino = 67110689}.
rdlibtool: lconf: openat(3,"libtool",O_RDONLY,0) = 4.
rdlibtool: lconf: found "/var/tmp/portage/media-video/vlc-9999/work/vlc-9999/libtool".
rdlibtool: link: ln -s libhttps_plugin.so.def .libs/libhttps_plugin.so.def.linux
rdlibtool: link: ln -s libhttps_plugin.so.def.linux .libs/libhttps_plugin.so.def.host
rdlibtool: link: ln -s /dev/null .libs/libhttps_plugin.a.disabled
rdlibtool: link: ln -s libhttps_plugin.la .libs/libhttps_plugin.la.shrext.so
rdlibtool: link: ln -s libhttps_plugin.la.shrext.so .libs/libhttps_plugin.la.shrext
rdlibtool: link: ln -s /usr/lib/vlc/plugins/access .libs/libhttps_plugin.so.slibtool.rpath
rdlibtool: link: x86_64-gentoo-linux-musl-gcc -Wl,--whole-archive ../compat/.libs/libcompat.a -Wl,--no-whole-archive access/http/.libs/access.o -Wl,--whole-archive .libs/libvlc_http.a -Wl,--no-whole-archive -O2 -pipe -Werror=implicit-function-declaration -Werror=implicit-int -fno-strict-aliasing -pthread -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros -fvisibility=hidden -L/usr/lib/sidplay/builders/ -lm -L../src/.libs -lvlccore -lm -lidn -lm -Wl,-O1 -Wl,--as-needed -Wl,-z,defs -L.libs -L./../src/.libs -lvlccore -shared -fPIC -Wl,--no-undefined -Wl,-soname -Wl,libhttps_plugin.so -o .libs/libhttps_plugin.so
/usr/lib/gcc/x86_64-gentoo-linux-musl/13/../../../../x86_64-gentoo-linux-musl/bin/ld: .libs/libvlc_http.a(strnstr.o): in function `strnstr':
strnstr.c:(.text+0x0): multiple definition of `strnstr'; ../compat/.libs/libcompat.a(strnstr.o):strnstr.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
rdlibtool: error logged in slbt_exec_link_create_library(), line 268: flow error: unexpected condition or other.
rdlibtool: < returned to > slbt_exec_link(), line 375.

Merge request reports

Loading