Преглед изворни кода

build: fix indirect linking vs rpath by linking --as-needed

libtotem_pg links against libnss/nspr and correctly sets RPATH
corosync links against libtotem_pg, but libtool (via .la) enforces
an extra layer of linking against libnss/nspr without setting RPATH.

corosync final binary can't resolve the second linking and fails
to load.

This issue is visible only on NetBSD that enforces a much stricter
use of rpath (vs other OS/distros). Using --as-needed avoids that
and it's generally safe to use on other OS'es.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Fabio M. Di Nitto пре 13 година
родитељ
комит
d4009196bb
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      configure.ac

+ 1 - 1
configure.ac

@@ -596,7 +596,7 @@ CFLAGS="$ENV_CFLAGS $lt_prog_compiler_pic $SEC_FLAGS $OPT_CFLAGS $GDB_FLAGS \
 	$WERROR_CFLAGS $NSS_CFLAGS $LIBQB_CFLAGS \
 	$SNMP_INCLUDES"
 CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $INCLUDE_DIRS"
-LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic $SEC_LDFLAGS $COVERAGE_LDFLAGS"
+LDFLAGS="$ENV_LDFLAGS $lt_prog_compiler_pic $SEC_LDFLAGS -Wl,--as-needed $COVERAGE_LDFLAGS"
 
 # substitute what we need:
 AC_SUBST([BASHPATH])