From 123ae3045dd21badb93ce52445e18e364b3ac807 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 20 Jan 2021 08:01:25 -0600 Subject: [PATCH] build: remove LIBPTHREAD/LIBTHR build options WITHOUT_LIBTHR has been broken for a little over five years now, since the xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building a useful system without threading support is becoming increasingly more difficult. Additionally, in the five plus years that it's been broken more reverse dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among others) that make it more and more difficult to reconcile the effort needed to fix these options. Remove the broken options. PR: 252760 Reviewed by: brooks, emaste, kib Differential Revision: https://reviews.freebsd.org/D28263 --- Makefile.inc1 | 6 +----- cddl/lib/Makefile | 2 -- cddl/usr.bin/Makefile | 2 -- cddl/usr.sbin/Makefile | 2 -- lib/Makefile | 4 ++-- sbin/ggate/Makefile | 9 ++------- share/man/man3/Makefile | 2 -- share/mk/src.opts.mk | 6 ------ tools/build/mk/OptionalObsoleteFiles.inc | 7 ------- tools/build/options/WITHOUT_LIBPTHREAD | 5 ----- tools/build/options/WITHOUT_LIBTHR | 5 ----- usr.sbin/Makefile | 2 -- usr.sbin/ngctl/Makefile | 2 -- 13 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 tools/build/options/WITHOUT_LIBPTHREAD delete mode 100644 tools/build/options/WITHOUT_LIBTHR diff --git a/Makefile.inc1 b/Makefile.inc1 index 251993ef8b71..6387c68d25a5 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2898,7 +2898,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libzstd \ ${_lib_casper} \ lib/ncurses/ncurses \ - lib/libopie lib/libpam/libpam ${_lib_libthr} \ + lib/libopie lib/libpam/libpam lib/libthr \ ${_lib_libradius} lib/libsbuf lib/libtacplus \ lib/libgeom \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ @@ -2932,10 +2932,6 @@ _prebuild_libs+= lib/libc++ lib/libgeom__L: lib/libexpat__L lib/libsbuf__L lib/libkvm__L: lib/libelf__L -.if ${MK_LIBTHR} != "no" -_lib_libthr= lib/libthr -.endif - .if ${MK_RADIUS_SUPPORT} != "no" _lib_libradius= lib/libradius .endif diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile index 38ab0358dde6..2f360a8684a2 100644 --- a/cddl/lib/Makefile +++ b/cddl/lib/Makefile @@ -28,11 +28,9 @@ _libicp_rescue= libicp_rescue _libzfs= libzfs _libzutil= libzutil _libzfsbootenv= libzfsbootenv -.if ${MK_LIBTHR} != "no" _libzpool= libzpool _libtpool= libtpool .endif -.endif SUBDIR_DEPEND_libctf= libspl SUBDIR_DEPEND_libdtrace= libctf diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile index 8c7fa3ac83fa..5c2595df1c9f 100644 --- a/cddl/usr.bin/Makefile +++ b/cddl/usr.bin/Makefile @@ -15,12 +15,10 @@ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _zinject= zinject -.if ${MK_LIBTHR} != "no" _ztest= ztest _zstream = zstream _zstreamdump = zstreamdump .endif -.endif SUBDIR_PARALLEL= diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile index a736a75a73ec..42de5c96c53a 100644 --- a/cddl/usr.sbin/Makefile +++ b/cddl/usr.sbin/Makefile @@ -13,10 +13,8 @@ SUBDIR= ${_dtrace} \ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" -.if ${MK_LIBTHR} != "no" _zdb= zdb _zhack= zhack -.endif . if ${MK_CXX} != "no" _zfsd= zfsd . endif diff --git a/lib/Makefile b/lib/Makefile index 5d7caa6b9423..ddb627917215 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -93,6 +93,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libstdthreads \ libsysdecode \ libtacplus \ + libthr \ libthread_db \ libucl \ libufs \ @@ -137,7 +138,7 @@ SUBDIR_DEPEND_libsmb= libkiconv SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} -SUBDIR_DEPEND_liblzma= ${_libthr} +SUBDIR_DEPEND_liblzma= libthr .if ${MK_OFED} != "no" SUBDIR_DEPEND_libpcap= ofed .endif @@ -189,7 +190,6 @@ _libcplusplus+= libc++experimental SUBDIR.${MK_EFI}+= libefivar SUBDIR.${MK_GOOGLETEST}+= googletest -SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_NETGRAPH}+= libnetgraph SUBDIR.${MK_NIS}+= libypclnt diff --git a/sbin/ggate/Makefile b/sbin/ggate/Makefile index b46335991671..22532cc18512 100644 --- a/sbin/ggate/Makefile +++ b/sbin/ggate/Makefile @@ -2,13 +2,8 @@ .include -SUBDIR= ${_ggatec} \ - ${_ggated} \ +SUBDIR= ggatec \ + ggated \ ggatel -.if ${MK_LIBTHR} != "no" -_ggatec= ggatec -_ggated= ggated -.endif - .include diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 7fb09f970a26..d33c0d63ea0d 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -370,7 +370,6 @@ MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 SPLAY_RIGHT.3 \ tree.3 SPLAY_ROOT.3 -.if ${MK_LIBTHR} != "no" PTHREAD_MAN= pthread.3 \ pthread_affinity_np.3 \ pthread_atfork.3 \ @@ -504,6 +503,5 @@ PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \ pthread_testcancel.3 pthread_setcanceltype.3 PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \ pthread_join.3 pthread_timedjoin_np.3 -.endif .include diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 55d07dac42dd..8ed02cbce3fa 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -126,8 +126,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS_UTILS \ LEGACY_CONSOLE \ LIBCPLUSPLUS \ - LIBPTHREAD \ - LIBTHR \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ @@ -378,10 +376,6 @@ BROKEN_OPTIONS+=CLANG_BOOTSTRAP LLD_BOOTSTRAP MK_CASPER:= no .endif -.if ${MK_LIBPTHREAD} == "no" -MK_LIBTHR:= no -.endif - .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 0484ad6fa30a..b517cff65338 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4110,13 +4110,6 @@ OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 .endif -.if ${MK_LIBTHR} == no -OLD_LIBS+=lib/libthr.so.3 -OLD_FILES+=usr/lib/libthr.a -OLD_FILES+=usr/lib/libthr_p.a -OLD_FILES+=usr/share/man/man3/libthr.3.gz -.endif - .if ${MK_LLD} == no OLD_FILES+=usr/bin/ld.lld .endif diff --git a/tools/build/options/WITHOUT_LIBPTHREAD b/tools/build/options/WITHOUT_LIBPTHREAD deleted file mode 100644 index 28a6200bfc92..000000000000 --- a/tools/build/options/WITHOUT_LIBPTHREAD +++ /dev/null @@ -1,5 +0,0 @@ -.\" $FreeBSD$ -Set to not build the -.Nm libpthread -providing library, -.Nm libthr . diff --git a/tools/build/options/WITHOUT_LIBTHR b/tools/build/options/WITHOUT_LIBTHR deleted file mode 100644 index 836473511983..000000000000 --- a/tools/build/options/WITHOUT_LIBTHR +++ /dev/null @@ -1,5 +0,0 @@ -.\" $FreeBSD$ -Set to not build the -.Nm libthr -(1:1 threading) -library. diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index da61617e408b..39913a327b87 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -162,10 +162,8 @@ SUBDIR.${MK_LEGACY_CONSOLE}+= kbdcontrol SUBDIR.${MK_LEGACY_CONSOLE}+= kbdmap SUBDIR.${MK_LEGACY_CONSOLE}+= moused SUBDIR.${MK_LEGACY_CONSOLE}+= vidcontrol -.if ${MK_LIBTHR} != "no" || ${MK_LIBPTHREAD} != "no" SUBDIR.${MK_PPP}+= pppctl SUBDIR.${MK_NS_CACHING}+= nscd -.endif SUBDIR.${MK_LPR}+= lpr SUBDIR.${MK_MAN_UTILS}+= manctl SUBDIR.${MK_MLX5TOOL}+= mlx5tool diff --git a/usr.sbin/ngctl/Makefile b/usr.sbin/ngctl/Makefile index 519bf98c7813..a4831523c3fc 100644 --- a/usr.sbin/ngctl/Makefile +++ b/usr.sbin/ngctl/Makefile @@ -11,9 +11,7 @@ WARNS?= 3 LIBADD= netgraph -.if ${MK_LIBTHR} != "no" CFLAGS+= -DEDITLINE LIBADD+= edit pthread -.endif .include