shadow-maint / shadow

Upstream shadow tree
Other
292 stars 228 forks source link

Link correctly with libdl #917

Closed thesamesam closed 7 months ago

thesamesam commented 7 months ago

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
alejandro-colomar commented 7 months ago

This breaks the Debian build; you'll need some tweaks (see CI results for more details):

#15 5.467 configure.ac:35: error: possibly undefined macro: LT_LIB_DLLOAD
#15 5.467       If this token and others are legitimate, please use m4_pattern_allow.
#15 5.467       See the Autoconf documentation.
#15 5.471 autoreconf: error: /usr/bin/autoconf failed with exit status: 1
#15 ERROR: process "/bin/sh -c ./autogen.sh --without-selinux --enable-man --with-yescrypt" did not complete successfully: exit code: 1

BTW, out of curiousity, what systems want the latest shadow but an old glibc? Do you need this backported to the stable branch?

thesamesam commented 7 months ago

Will look at CI in a bit.

BTW, out of curiousity, what systems want the latest shadow but an old glibc?

Consider building binaries you will need to deploy to an enterprise Linux distribution. You can get away with modern userland, but you need an older libstdc++ and glibc.

Do you need this backported to the stable branch?

Yes please.

alejandro-colomar commented 7 months ago

Cherry-picked to 4.14.x: