thread libs: move libc_r and libthread_xu to /usr/lib/thread
authorSimon Schubert <corecode@dragonflybsd.org>
Wed, 7 Oct 2009 00:27:42 +0000 (02:27 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Wed, 7 Oct 2009 17:34:37 +0000 (19:34 +0200)
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
etc/mtree/BSD.usr.dist
lib/libc_r/Makefile
lib/libpthread/Makefile
lib/libthread_xu/Makefile

index fb8f650..03ddd0c 100644 (file)
@@ -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
index b869735..41d0896 100644 (file)
@@ -33,6 +33,8 @@
         ..
         security
         ..
+        thread
+        ..
         aout
         ..
         compat
index 7360427..8c3eec6 100644 (file)
@@ -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"
 
index f6d2046..6a50195 100644 (file)
@@ -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
 
index 62f298b..14bbe53 100644 (file)
@@ -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"