ftbfs 0.5.6-1 undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'

Bug #1789953 reported by Andreas Hasenack on 2018-08-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapper (Ubuntu)
Andreas Hasenack

Bug Description

As seen on https://launchpadlibrarian.net/383188979/buildlog_ubuntu-cosmic-amd64.snapper_0.5.6-1_BUILDING.txt.gz:
libtool: link: g++ -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -std=c++11 -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/snapperd snapperd.o Client.o MetaSnapper.o Background.o Types.o -lboost_system -lboost_thread -lxml2 -lacl -lz -lm ../snapper/.libs/libsnapper.so ../dbus/.libs/libdbus.a -ldbus-1 -lrt -lbtrfs
/usr/bin/ld: Client.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
/usr/bin/ld: //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I believe this is what introduced the build failure:

I don't know why the build still succeeds in debian, though.

Related branches

tags: added: ftbfs
Andreas Hasenack (ahasenack) wrote :

The Debian DSO patch is adding a bunch of -l<library> options to the linker command line, and it's doing that *before* existing *.la files in the same command line:

-snapper_LDADD = ../snapper/libsnapper.la utils/libutils.la ../dbus/libdbus.la
+snapper_LDADD = ../snapper/libsnapper.la -lboost_thread -lboost_system -lxml2 -lacl -lz -lm utils/libutils.la ../dbus/libdbus.la

Turns out the libdbus.la file references the libdbus.a static library, and that one needs symbols from libboost_system which are then not found.

I believe the correct patch would have been:
-snapper_LDADD = ../snapper/libsnapper.la utils/libutils.la ../dbus/libdbus.la
+snapper_LDADD = ../snapper/libsnapper.la utils/libutils.la ../dbus/libdbus.la -lboost_thread -lboost_system -lxml2 -lacl -lz -lm

I.e., *appending* the -l<library> bits after the .la ones.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers