[systemd-devel] build failures in latest master from d848b9cbfa0ba72381363accce481600169df2eb

Dave Reisner d at falconindy.com
Thu Jan 31 16:55:58 PST 2013


On Thu, Jan 31, 2013 at 07:21:27PM -0500, Colin Walters wrote:
> On Thu, 2013-01-31 at 13:09 -0500, Dave Reisner wrote:
> 
> > http://pkgbuild.com/~dreisner/build.log
> 
> So I distilled a few relevant linker lines to compare, but basically the
> only difference is -O0 vs -O2, and the gnome-ostree linker lines have
> -L/usr/lib before -lgpg-error -ldl -lrt.  Nothing that should matter.
> 
> So after your build, can you run this:
> 
> readelf -a .libs/libsystemd-journal.so  | grep NEED

Same build with the reverted commit

$ objdump -p .libs/libsystemd-journal.so | grep NEEDED
  NEEDED               liblzma.so.5
  NEEDED               libgcrypt.so.11
  NEEDED               libgpg-error.so.0
  NEEDED               libdl.so.2
  NEEDED               librt.so.1
  NEEDED               libc.so.6
  NEEDED               ld-linux-x86-64.so.2

> 
> Does it show a DT_NEEDED on libsystemd-daemon.so ?   So I just checked
> on Fedora 18, and I do indeed see it.  But I don't in gnome-ostree.
> This could very well be something going wrong with --as-needed in the
> toolchain.

Yes, --as-needed seems to be the likely candidate here. I've definitely
seen problems with the interaction between libtool and --as-needed
before, but not like this (and said problems still exist).

> Note that systemd is doing a very weird thing - the dynamic
> libsystemd-journal.so links to the noinst libtool library
> libsystemd-shared.la which in turn depends on the dynamic
> libsystemd-daemon.so.

Yup, and this is wrong. It would be nice to factor this out and keep the
noinst library entirely static.

> It's quite possible my libtool version isn't understanding how to
> propagate this...I'll debug this a bit more.
> 
> You know though, honestly systemd is generating so many executables and
> libraries that at this point it'd probably be sane to make
> libsystemd-shared...well, shared.
> 
> Using -Wl,--gc-sections helps a lot, but still.  We could just put it in
> a private path like /usr/lib/systemd/libsystemd-shared.so.  

Not really a fan of this idea...

> [a few minutes pass] Something like the attached patch.  But doing it
> against master I'm still running into apparent build race conditions
> where 'make' works, but 'make -j 8' falls over.

Which just leads me to believe there's something broken in some version
of automake or libtool that you're using....

> From 33fdd8c52748208d34da8cb0b5db2dbcfc940fc0 Mon Sep 17 00:00:00 2001
> From: Colin Walters <walters at verbum.org>
> Date: Thu, 31 Jan 2013 19:11:46 -0500
> Subject: [PATCH] build-sys: Make libsystemd-shared.so
> 
> Previously it was a noinst libtool library, but the library has grown
> enough that it probably makes sense to share the copies in memory.
> Also, linking this way avoids the case of the dynamic -> static ->
> dynamic dependency chain of:
> libsystemd-journal.so -> libsystemd-shared.la -> libsystemd-daemon.so.
> 
> Signed-off-by: Colin Walters <walters at verbum.org>
> ---
>  Makefile.am |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 88662c0..f3e1d4c 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -107,6 +107,8 @@ UNINSTALL_DATA_HOOKS =
>  DISTCLEAN_LOCAL_HOOKS =
>  pkginclude_HEADERS =
>  noinst_LTLIBRARIES =
> +privlibdir = $(pkglibdir)
> +privlib_LTLIBRARIES =
>  lib_LTLIBRARIES =
>  include_HEADERS =
>  pkgconfiglib_DATA =
> @@ -766,7 +768,7 @@ EXTRA_DIST += \
>  	make-directive-index.py
>  
>  # ------------------------------------------------------------------------------
> -noinst_LTLIBRARIES += \
> +privlib_LTLIBRARIES += \
>  	libsystemd-shared.la
>  
>  libsystemd_shared_la_SOURCES = \
> @@ -844,7 +846,9 @@ libsystemd_shared_la_SOURCES = \
>  	src/shared/calendarspec.h \
>  	src/shared/output-mode.h
>  
> -libsystemd_shared_la_LIBADD = libsystemd-daemon.la
> +libsystemd_shared_la_CFLAGS = $(AM_CFLAGS) -fvisibility=default
> +
> +libsystemd_shared_la_LIBADD = libsystemd-daemon.la libsystemd-id128-internal.la
>  
>  #-------------------------------------------------------------------------------
>  noinst_LTLIBRARIES += \
> -- 
> 1.7.1
> 



More information about the systemd-devel mailing list