Skip to content

Conversation

@thesamesam
Copy link
Contributor

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
Copy link
Collaborator

alejandro-colomar commented Jan 21, 2024

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
Copy link
Contributor Author

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.

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>
Copy link
Collaborator

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the patch.

@ikerexxe ikerexxe merged commit 0f4e59f into shadow-maint:master Jan 26, 2024
@thesamesam thesamesam deleted the dlopen branch January 26, 2024 09:09
alejandro-colomar pushed a commit to alejandro-colomar/shadow that referenced this pull request Jan 26, 2024
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: 0f4e59f ("Link correctly with libdl")
Link: <shadow-maint#917>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
@alejandro-colomar
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants