Enforce -lpthread and -lc to always be the 2 last components of the link list

Differential Revision:	https://reviews.freebsd.org/D1118
Suggested by:		kib
This commit is contained in:
Baptiste Daroussin 2014-11-22 12:48:09 +00:00
parent 0c4bf57982
commit dec0135828
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274849

View File

@ -161,3 +161,13 @@ LIBZ?= ${DESTDIR}${LIBDIR}/libz.a
LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a
LIBZFS_CORE?= ${DESTDIR}${LIBDIR}/libzfs_core.a
LIBZPOOL?= ${DESTDIR}${LIBDIR}/libzpool.a
# enforce the 2 -lpthread and -lc to always be the last in that exact order
.if defined(LDADD)
.if ${LDADD:M-lpthread}
LDADD:= ${LDADD:N-lpthread} -lpthread
.endif
.if ${LDADD:M-lc}
LDADD:= ${LDADD:N-lc} -lc
.endif
.endif