From deb15fb4c81d933318c78ef11ffee7462c398a59 Mon Sep 17 00:00:00 2001 From: kib Date: Sun, 4 May 2014 07:57:20 +0000 Subject: [PATCH] MFC r265003: Fix order of libthr and libc in the global dso list for sshd. git-svn-id: svn://svn.freebsd.org/base/stable/9@265314 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- secure/usr.sbin/sshd/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index eb6fa2dec..2cb338314 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -50,6 +50,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD+= -lcrypt -lcrypto -lz +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif -- 2.45.0