aboutsummaryrefslogtreecommitdiffstats
path: root/secure/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'secure/usr.sbin')
-rw-r--r--secure/usr.sbin/sshd/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index f587263f7faf..895bcb43c0ec 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -42,6 +42,16 @@ LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1
DPADD+= ${LIBCRYPTO} ${LIBCRYPT}
LDADD+= -lcrypto -lcrypt
+# 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