Hello again,

Martin Pitt [2015-03-05 11:40 +0100]:
> beanstalkd FTBFS with binutils-gold, in particular due to some wrong
> or insufficient linking with --no-add-needed (see
> https://wiki.debian.org/ToolChain/DSOLinking for details):
> 
> | $ LDFLAGS='-Wl,--no-add-needed' sbuild -d sid -j4 beanstalkd_1.10-1.dsc
> | [...]
> | cc -Wl,--no-add-needed  -o beanstalkd linux.o conn.o file.o heap.o job.o 
> ms.o net.o primes.o prot.o serv.o time.o tube.o util.o vers.o walg.o main.o 

Sorry, I just realized that this is problematic by itself: Setting
LDFLAGS seems to override this bit of debian/rules:

ifeq ($(DEB_HOST_ARCH_OS), linux)
……………………export DEB_LDFLAGS_MAINT_APPEND = -lsystemd

> | net.o: In function `make_server_socket':
> | /«PKGBUILDDIR»/net.c:29: undefined reference to `sd_listen_fds'
> | /«PKGBUILDDIR»/net.c:39: undefined reference to `sd_is_socket_inet'
> | util.o: In function `warn_systemd_ignored_option':
> | /«PKGBUILDDIR»/util.c:95: undefined reference to `sd_listen_fds'
> | /«PKGBUILDDIR»/util.c:95: undefined reference to `sd_listen_fds'
> | collect2: error: ld returned 1 exit status
> 
> Indeed the linker call contains no shared libraries whatsoever?

Without setting $LDFLAGS the linker line looks like

cc -Wl,-z,relro -lsystemd  -o beanstalkd linux.o conn.o file.o heap.o job.o 
ms.o net.o primes.o prot.o serv.o time.o tube.o util.o vers.o walg.o main.o 

Which at least has the necessary library. But it needs to come _after_
the object files, as the linker processes the files in order. And if
you put -lsystemd first, there is nothing yet which needs -lsystemd
and it just gets discarded.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

Attachment: signature.asc
Description: Digital signature

Reply via email to