#68 Included Makefile.mk snippets confuse the paths
Closed 9 months ago by orbea. Opened 9 months ago by orbea.

OS: Gentoo
slibtool: 8a41491
ola: 0.10.9

With slibtool it fails.

ld: cannot find -lolaartnetconf: No such file or directory
ld: cannot find -lolae131conf: No such file or directory
rdlibtool --tag=CXX --mode=link x86_64-gentoo-linux-musl-g++ -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -O2 -pipe -std=gnu++11 -rdynamic -Wl,-O1 -Wl,--as-needed -o olad/olad olad/Olad.o olad/libolaserver.la common/libolacommon.la ola/libola.la

rdlibtool: lconf: {.name="libtool"}.
rdlibtool: fdcwd: {.fdcwd=AT_FDCWD, .realpath="/var/tmp/portage/app-misc/ola-0.10.9-r1/work/ola-0.10.9"}.
rdlibtool: lconf: fstatat(AT_FDCWD,".",...) = 0 {.st_dev = 65026, .st_ino = 205461287}.
rdlibtool: lconf: openat(AT_FDCWD,"libtool",O_RDONLY,0) = 3.
rdlibtool: lconf: found "/var/tmp/portage/app-misc/ola-0.10.9-r1/work/ola-0.10.9/libtool".
rdlibtool: link: x86_64-gentoo-linux-musl-g++ olad/Olad.o -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -O2 -pipe -std=gnu++11 -rdynamic -Wl,-O1 -Wl,--as-needed -Lolad/.libs -lolaserver -Lolad/../plugins/artnet/.libs -lolaartnet -Lolad/plugins/artnet/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/artnet/olad/plugin_api/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/artnet/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/artnet/olad/plugin_api/ola/../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/artnet/plugins/artnet/../../common/.libs -Lolad/plugins/artnet/./messages/.libs -lolaartnetconf -lprotobuf -Lolad/../plugins/dummy/.libs -loladummy -Lolad/plugins/dummy/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/dummy/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/dummy/olad/plugin_api/../../common/.libs -Lolad/plugins/dummy/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/dummy/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/e131/.libs -lolae131 -Lolad/plugins/e131/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/e131/olad/plugin_api/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/e131/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/e131/olad/plugin_api/ola/../common/.libs -Lolad/plugins/e131/./messages/.libs -lolae131conf -lprotobuf -luuid -Lolad/plugins/e131/libs/acn/../../common/.libs -lolacommon -Lolad/plugins/e131/libs/acn/libs/acn/../../common/.libs -Lolad/../plugins/espnet/.libs -lolaespnet -Lolad/plugins/espnet/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/espnet/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/espnet/olad/plugin_api/../../common/.libs -Lolad/plugins/espnet/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/espnet/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/gpio/.libs -lolagpio -Lolad/plugins/gpio/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/gpio/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/gpio/olad/plugin_api/../../common/.libs -Lolad/plugins/gpio/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/gpio/olad/plugin_api/ola/../common/.libs -Lolad/plugins/gpio/./.libs -lolagpiocore -Lolad/plugins/gpio/plugins/gpio/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/../plugins/karate/.libs -lolakarate -Lolad/plugins/karate/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/karate/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/karate/olad/plugin_api/../../common/.libs -Lolad/plugins/karate/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/karate/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/kinet/.libs -lolakinet -Lolad/plugins/kinet/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/kinet/olad/plugin_api/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/kinet/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/kinet/olad/plugin_api/ola/../common/.libs -Lolad/plugins/kinet/plugins/kinet/../../common/.libs -Lolad/../plugins/milinst/.libs -lolamilinst -Lolad/plugins/milinst/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/milinst/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/milinst/olad/plugin_api/../../common/.libs -Lolad/plugins/milinst/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/milinst/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/opendmx/.libs -lolaopendmx -Lolad/plugins/opendmx/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/opendmx/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/opendmx/olad/plugin_api/../../common/.libs -Lolad/plugins/opendmx/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/opendmx/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/openpixelcontrol/.libs -lolaopenpixelcontrol -Lolad/plugins/openpixelcontrol/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/openpixelcontrol/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/openpixelcontrol/olad/plugin_api/../../common/.libs -Lolad/plugins/openpixelcontrol/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/openpixelcontrol/olad/plugin_api/ola/../common/.libs -Lolad/plugins/openpixelcontrol/plugins/openpixelcontrol/../../common/.libs -Lolad/../plugins/pathport/.libs -lolapathport -Lolad/plugins/pathport/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/pathport/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/pathport/olad/plugin_api/../../common/.libs -Lolad/plugins/pathport/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/pathport/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/renard/.libs -lolarenard -Lolad/plugins/renard/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/renard/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/renard/olad/plugin_api/../../common/.libs -Lolad/plugins/renard/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/renard/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/sandnet/.libs -lolasandnet -Lolad/plugins/sandnet/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/sandnet/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/sandnet/olad/plugin_api/../../common/.libs -Lolad/plugins/sandnet/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/sandnet/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/shownet/.libs -lolashownet -Lolad/plugins/shownet/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/shownet/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/shownet/olad/plugin_api/../../common/.libs -Lolad/plugins/shownet/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/shownet/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/spi/.libs -lolaspi -Lolad/plugins/spi/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/spi/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/spi/olad/plugin_api/../../common/.libs -Lolad/plugins/spi/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/spi/olad/plugin_api/ola/../common/.libs -Lolad/plugins/spi/./.libs -lolaspicore -Lolad/plugins/spi/plugins/spi/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/../plugins/stageprofi/.libs -lolastageprofi -Lolad/plugins/stageprofi/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/stageprofi/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/stageprofi/olad/plugin_api/../../common/.libs -Lolad/plugins/stageprofi/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/stageprofi/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/uartdmx/.libs -lolauartdmx -Lolad/plugins/uartdmx/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/uartdmx/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/uartdmx/olad/plugin_api/../../common/.libs -Lolad/plugins/uartdmx/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/uartdmx/olad/plugin_api/ola/../common/.libs -Lolad/../plugins/usbpro/.libs -lolausbpro -Lolad/plugins/usbpro/../../olad/plugin_api/.libs -lolaserverplugininterface -Lolad/plugins/usbpro/olad/plugin_api/../../common/.libs -lolacommon -lresolv -lprotobuf -Lolad/plugins/usbpro/olad/plugin_api/../../ola/.libs -lola -Lolad/plugins/usbpro/olad/plugin_api/ola/../common/.libs -Lolad/plugins/usbpro/plugins/usbpro/../../common/.libs -Lolad/plugins/usbpro/./messages/.libs -lolausbproconf -lprotobuf -Lolad/../common/.libs -lolacommon -lresolv -Lolad/../ola/.libs -lola -Lolad/ola/../common/.libs -Lolad/./plugin_api/.libs -lolaserverplugininterface -o olad/.libs/olad
/usr/lib/gcc/x86_64-gentoo-linux-musl/13/../../../../x86_64-gentoo-linux-musl/bin/ld: cannot find -lolaartnetconf: No such file or directory
/usr/lib/gcc/x86_64-gentoo-linux-musl/13/../../../../x86_64-gentoo-linux-musl/bin/ld: cannot find -lolae131conf: No such file or directory
collect2: error: ld returned 1 exit status
rdlibtool: error logged in slbt_exec_link_create_executable(), line 245: flow error: unexpected condition or other.
rdlibtool: < returned to > slbt_exec_link(), line 471.
make[2]: *** [Makefile:9747: olad/olad] Error 2
make[2]: Leaving directory '/var/tmp/portage/app-misc/ola-0.10.9-r1/work/ola-0.10.9'
make[1]: *** [Makefile:16481: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-misc/ola-0.10.9-r1/work/ola-0.10.9'
make: *** [Makefile:7554: all] Error 2

Where slibtool tries to link with:

-Lolad/plugins/e131/./messages/.libs -lolae131conf
-Lolad/plugins/artnet/./messages/.libs -lolaartnetconf 

Where the path to the libraries is wrong.

./plugins/e131/messages/libolae131conf.la
./plugins/artnet/messages/libolaartnetconf.la

Where libolae131conf.la is added to plugins_e131_libolae131_la_LIBADD in plugins/e131/Makefile.mk.

plugins_e131_libolae131_la_LIBADD = \
    olad/plugin_api/libolaserverplugininterface.la \
    plugins/e131/messages/libolae131conf.la \
    libs/acn/libolae131core.la

And libolaartnetconf.la in added to plugins_artnet_libolaartnet_la_LIBADD in plugins/artnet/Makefile.mk.

plugins_artnet_libolaartnet_la_LIBADD = \
    olad/plugin_api/libolaserverplugininterface.la \
    plugins/artnet/libolaartnetnode.la \
    plugins/artnet/messages/libolaartnetconf.la

And both Makefile.mk files are included in plugins/Makefile.mk.

include plugins/artnet/Makefile.mk
include plugins/dummy/Makefile.mk
include plugins/espnet/Makefile.mk
include plugins/ftdidmx/Makefile.mk
include plugins/gpio/Makefile.mk
include plugins/karate/Makefile.mk
include plugins/kinet/Makefile.mk
include plugins/milinst/Makefile.mk
include plugins/opendmx/Makefile.mk
include plugins/openpixelcontrol/Makefile.mk
include plugins/osc/Makefile.mk
include plugins/pathport/Makefile.mk
include plugins/renard/Makefile.mk
include plugins/sandnet/Makefile.mk
include plugins/shownet/Makefile.mk
include plugins/spi/Makefile.mk
include plugins/stageprofi/Makefile.mk
include plugins/usbdmx/Makefile.mk

if !USING_WIN32
include plugins/usbpro/Makefile.mk
include plugins/dmx4linux/Makefile.mk
include plugins/e131/Makefile.mk
include plugins/uartdmx/Makefile.mk
endif

Which is included in the main Makfile.am.

# The includes
# -----------------------------------------------------------------------------

# Since `make install` relinks the libraries, this should be in the order in
# which libraries depend on each other. e.g. common, plugin_api, plugins, server.
include common/Makefile.mk
include data/Makefile.mk
include debian/Makefile.mk
include doxygen/Makefile.mk
include examples/Makefile.mk
include include/Makefile.mk
include javascript/Makefile.mk
include man/Makefile.mk
include libs/Makefile.mk
include ola/Makefile.mk
# olad/plugin_api/Makefile.mk is included directly due to the order of
# dependencies between them; we need to build olad/plugin_api, then the
# plugins, then olad
include olad/plugin_api/Makefile.mk
include plugins/Makefile.mk
include olad/Makefile.mk
include protoc/Makefile.mk
include python/Makefile.mk
include scripts/Makefile.mk
include tools/Makefile.mk

The way these are being included seem to confuse slibtool, as is already known GNU libtool links directly with the .so files on Linux.


Looking at tmp1 for -lolaartnetconf.

$ find . -type f -name '*tmp1' | xargs grep -- -lolaartnetconf 
./olad/.libs/libolaserver.so.slibtool.deps.tmp1:-lolaartnetconf
./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp1:-lolaartnetconf

./olad/.libs/libolaserver.so.slibtool.deps.tmp1

-Lplugins/artnet/./messages/.libs
-lolaartnetconf

./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp1

-L../../olad/plugin_api/.libs
-lolaserverplugininterface
-Lolad/plugin_api/../../common/.libs
-lolacommon
-lresolv
-lprotobuf
-lprotobuf
-lprotobuf
-Lolad/plugin_api/../../ola/.libs
-lola
-Lolad/plugin_api/ola/../common/.libs
-lolacommon
-lresolv
-lprotobuf
-lprotobuf
-lprotobuf
-Lplugins/artnet/../../common/.libs
-lolacommon
-L../../plugins/artnet/messages/.libs
-lolaartnetconf
-lprotobuf
$ diff -u ./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp1 ./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp2
--- ./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp1
+++ ./plugins/artnet/.libs/libolaartnet.so.slibtool.deps.tmp2
@@ -16,6 +16,6 @@
 -lprotobuf
 -Lplugins/artnet/../../common/.libs
 -lolacommon
--L../../plugins/artnet/messages/.libs
+-L./messages/.libs
 -lolaartnetconf
 -lprotobuf

Metadata Update from @orbea:
- Issue status updated to: Closed (was: Open)

9 months ago

The issue lied elsewhere and was in fact rather subtle, having to do with the scenario when the dependencies of a/b/libfoo.la were imported in the dependency list of x/libbar.la. The different directory depths of the .la build targets had to be accounted for, an this has been done in commit 62a0071.

Login to comment on this ticket.

Metadata