From 54674d33687b187876e5b9d260d3ae6aa1f0261c Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Wed, 7 Oct 2009 02:27:42 +0200 Subject: [PATCH] thread libs: move libc_r and libthread_xu to /usr/lib/thread This is so that badly written programs don't mistakenly pick up either libc_r or libthread_xu. The only correct way to get threading support is to link to libpthread. By moving the underlaying thread libs to a directory that is not searched by the linker, we can enforce this policy. Requested-by: hasso@ --- Makefile_upgrade.inc | 2 ++ etc/mtree/BSD.usr.dist | 2 ++ lib/libc_r/Makefile | 3 +++ lib/libpthread/Makefile | 4 ++-- lib/libthread_xu/Makefile | 3 +++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index fb8f6503ab..03ddd0cfd1 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -1176,3 +1176,5 @@ TO_REMOVE+=/usr/share/man/man9/make_adhoc_dev.9.gz TO_REMOVE+=/usr/share/man/cat9/make_sub_dev.9.gz TO_REMOVE+=/usr/share/man/man9/make_sub_dev.9.gz TO_REMOVE+=/usr/libdata/msdosfs +TO_REMOVE+=/usr/lib/libc_r.so +TO_REMOVE+=/usr/lib/libthread_xu.so diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index b8697350d4..41d089680a 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -33,6 +33,8 @@ .. security .. + thread + .. aout .. compat diff --git a/lib/libc_r/Makefile b/lib/libc_r/Makefile index 7360427c11..8c3eec6cfe 100644 --- a/lib/libc_r/Makefile +++ b/lib/libc_r/Makefile @@ -22,6 +22,9 @@ CFLAGS+=-D_PTHREADS_INVARIANTS AINC= -I${.CURDIR}/../libc/${MACHINE_ARCH} -I${.CURDIR}/uthread PRECIOUSLIB= yes +LIBDIR= /usr/lib/thread +NOPROFILE= yes + .include "${.CURDIR}/uthread/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index f6d2046515..6a50195532 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -138,11 +138,11 @@ realinstall: linkinstall linkinstall: # Do not overwrite existing symlinks if [ ! -e ${DESTDIR}${TARGET_SHLIBDIR}/${SONAME} ]; then \ - ${LN} -fs lib${THREAD_LIB}.so \ + ${LN} -fs thread/lib${THREAD_LIB}.so \ ${DESTDIR}${TARGET_SHLIBDIR}/${SONAME}; \ fi if [ ! -e ${DESTDIR}${TARGET_LIBDIR}/${LIBNAME}.a ]; then \ - ${LN} -fs lib${THREAD_LIB}.a \ + ${LN} -fs thread/lib${THREAD_LIB}.a \ ${DESTDIR}${TARGET_LIBDIR}/${LIBNAME}.a; \ fi diff --git a/lib/libthread_xu/Makefile b/lib/libthread_xu/Makefile index 62f298be3b..14bbe53b0c 100644 --- a/lib/libthread_xu/Makefile +++ b/lib/libthread_xu/Makefile @@ -19,6 +19,9 @@ CFLAGS+=-D_PTHREADS_INVARIANTS PRECIOUSLIB= yes +LIBDIR= /usr/lib/thread +NOPROFILE= yes + .include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" -- 2.41.0