From: Sam James Date: Sun, 21 Jan 2024 14:58:33 +0000 (+0000) Subject: Link correctly with libdl X-Git-Tag: 4.15.0-rc1~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f4e59fd00cf2c25548c1fb589d8aaf5955d3e8c;p=thirdparty%2Fshadow.git Link correctly with libdl This fixes build with glibc-2.33 (newer glibc merged libdl and libpthread into libc): ``` libtool: link: x86_64-pc-linux-gnu-gcc -isystem /usr/include/bsd -DLIBBSD_OVERLAY -O2 -pipe -Wl,-O1 -o login login.o login_nopam.o -Wl,--as-needed ../lib/.libs/libshadow.a -lcrypt -lsystemd -lpam -lpam_misc -lbsd /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: ../lib/.libs/libshadow.a(libshadow_la-nss.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5' /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status ``` In Debian, the needed macro from libtool seems to be in libltdl-dev. Signed-off-by: Sam James --- diff --git a/configure.ac b/configure.ac index b29e04118..71263e4c0 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AC_PROG_CC AC_PROG_LN_S AC_PROG_YACC LT_INIT +LT_LIB_DLLOAD dnl Checks for libraries. diff --git a/lib/Makefile.am b/lib/Makefile.am index b5de79c57..5b1121c4c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -20,6 +20,7 @@ endif libshadow_la_CPPFLAGS += -I$(top_srcdir) libshadow_la_CFLAGS = $(LIBBSD_CFLAGS) $(LIBCRYPT_PAM) $(LIBSYSTEMD) +libshadow_la_LIBADD = $(LIBADD_DLOPEN) libshadow_la_SOURCES = \ addgrps.c \ diff --git a/share/containers/debian.dockerfile b/share/containers/debian.dockerfile index 5934f287a..09492939d 100644 --- a/share/containers/debian.dockerfile +++ b/share/containers/debian.dockerfile @@ -9,7 +9,7 @@ RUN export DEBIAN_PRIORITY=critical \ RUN apt-get update -y \ && apt-get dist-upgrade -y RUN apt-get build-dep shadow -y -RUN apt-get install libbsd-dev libcmocka-dev pkgconf -y +RUN apt-get install libltdl-dev libbsd-dev libcmocka-dev pkgconf -y COPY ./ /usr/local/src/shadow/ WORKDIR /usr/local/src/shadow/