diff options
author | Sam James <sam@gentoo.org> | 2024-01-21 14:58:33 +0000 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-01-26 13:32:08 +0100 |
commit | 7540b0519728e5ca342abfefa4aff46b4b9c0c48 (patch) | |
tree | 650bb863c8e80cf4df41245f550d4f1d8b22fa00 | |
parent | eae0b027962c6a6013ff693eeb6db86d81c6f4f6 (diff) |
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 <sam@gentoo.org>
Cc: Iker Pedrosa <ikerpedrosam@gmail.com>
Cherry-picked-from: 0f4e59fd00cf ("Link correctly with libdl")
Link: <https://github.com/shadow-maint/shadow/pull/917>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | lib/Makefile.am | 1 | ||||
-rw-r--r-- | share/containers/debian.dockerfile | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 5dcd22e3..79250fca 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 ca73313d..7db960c8 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 a9d5ba4b..70ea10fb 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 pkgconf -y +RUN apt-get install libltdl-dev libbsd-dev pkgconf -y COPY ./ /usr/local/src/shadow/ WORKDIR /usr/local/src/shadow/ |