From: Jo-Philipp Wich Date: Fri, 18 Dec 2020 16:31:28 +0000 (+0100) Subject: treewide: drop librt and libpthread packages X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4b069f30ef6fabaecd075e0957961fa48393a075;p=openwrt%2Fstaging%2Fjow.git treewide: drop librt and libpthread packages Since OpenWrt's main libc library, musl, does not provide separate shared object files for libpthread and librt, the existing binary packages for them are empty placeholders which provide no runtime functionality and frequently cause confusion among users who attempt to build software linking -lrt or -lpthread on target. To clean this situation up somewhat and to simplify binary package dependecies for all of the potential musl, glibc and uclibc cases, drop those packages and move libpthread.so as well as librt.so into the main libc package for those libc implementations that happen ship them as extra shared libraries. Also let the abstract libc package provide virtual libpthread and librt packages in order to ease migration for packages that still explicitly depend on them. Signed-off-by: Jo-Philipp Wich --- diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index a2830420cc..a6ed34db5c 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/nls.mk define Package/perf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @KERNEL_PERF_EVENTS \ + DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +objdump @!IN_SDK @KERNEL_PERF_EVENTS \ +PACKAGE_libbfd:libbfd +PACKAGE_libopcodes:libopcodes +libtraceevent TITLE:=Linux performance monitoring tool VERSION:=$(LINUX_VERSION)-r$(PKG_RELEASE) diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index 313df75921..8d871ca620 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -33,7 +33,7 @@ include $(INCLUDE_DIR)/kernel.mk define Package/valgrind SECTION:=devel CATEGORY:=Development - DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||aarch64 +libpthread +librt + DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||aarch64 TITLE:=debugging and profiling tools for Linux URL:=http://www.valgrind.org endef diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index e0a080d60e..f2435b988f 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -104,7 +104,7 @@ endef define Package/libevent2-pthreads $(call Package/libevent2/Default) TITLE+= Pthreads library (version 2.1) - DEPENDS+=+libpthread +libevent2-core + DEPENDS+=+libevent2-core endef define Package/libevent2-pthreads/description diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index f8f45e0713..831ca01941 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -34,7 +34,6 @@ endef define Package/libnl-core $(call Package/libnl/default) TITLE:=Core Netlink Library - DEPENDS:=+libpthread endef define Package/libnl-genl diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 6171c31479..17c3dbb9bf 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -29,7 +29,7 @@ define Package/libusb-1.0 SECTION:=libs CATEGORY:=Libraries TITLE:=A library for accessing Linux USB devices - DEPENDS:=+libpthread +librt +libatomic + DEPENDS:=+libatomic URL:=https://libusb.info/ ABI_VERSION:=0 endef diff --git a/package/libs/musl-fts/Makefile b/package/libs/musl-fts/Makefile index 72341cd379..147b828c19 100644 --- a/package/libs/musl-fts/Makefile +++ b/package/libs/musl-fts/Makefile @@ -37,7 +37,6 @@ define Package/musl-fts CATEGORY:=Libraries TITLE:=fts implementation for musl libc URL:=https://github.com/pullmoll/musl-fts - DEPENDS:= +libpthread endef define Package/musl-fts/description diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 7c117b144d..435725539c 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -142,7 +142,7 @@ define Package/libasan $(call Package/gcc/Default) NAME:=libasan TITLE:=Runtime library for AddressSanitizer in GCC - DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc + DEPENDS:=@USE_GLIBC +libstdcpp @!mips64 @!mips64el @!arc ABI_VERSION:=5 endef @@ -171,7 +171,7 @@ define Package/libtsan $(call Package/gcc/Default) NAME:=libtsan TITLE:=Runtime library for ThreadSanitizer in GCC - DEPENDS:=@USE_GLIBC +librt +libstdcpp @!loongarch64 @!mips @!mipsel @!mips64 @!mips64el @!arc + DEPENDS:=@USE_GLIBC +libstdcpp @!loongarch64 @!mips @!mipsel @!mips64 @!mips64el @!arc ABI_VERSION:=0 endef @@ -200,7 +200,11 @@ define Package/liblsan $(call Package/gcc/Default) NAME:=liblsan TITLE:=Runtime library for LeakSanitizer in GCC +<<<<<<< HEAD DEPENDS:=@USE_GLIBC +librt +libstdcpp @!loongarch64 @!mips @!mipsel @!mips64 @!mips64el @!arc +======= + DEPENDS:=@USE_GLIBC +libstdcpp @!mips @!mipsel @!mips64 @!mips64el @!arc +>>>>>>> dedd1df79e (treewide: drop librt and libpthread packages) ABI_VERSION:=0 endef @@ -229,7 +233,7 @@ define Package/libubsan $(call Package/gcc/Default) NAME:=libubsan TITLE:=Runtime library for UndefinedBehaviorSanitizer in GCC - DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc + DEPENDS:=@USE_GLIBC +libstdcpp @!mips64 @!mips64el @!arc ABI_VERSION:=1 endef @@ -266,6 +270,7 @@ endef define Package/libc $(call Package/libc/Default) TITLE:=C library + PROVIDES:=libpthread librt endef define Package/libc/config @@ -283,33 +288,7 @@ define Package/libc/config string prompt "libc shared library files (use wildcards)" depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc - default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*,.so}" - - endmenu -endef - - -define Package/libpthread -$(call Package/libc/Default) - TITLE:=POSIX thread library -endef - -define Package/libpthread/config - menu "Configuration" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread - - config LIBPTHREAD_ROOT_DIR - string - prompt "libpthread shared library base directory" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread - default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN - default "/" if NATIVE_TOOLCHAIN - - config LIBPTHREAD_FILE_SPEC - string - prompt "libpthread shared library files (use wildcards)" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread - default "./lib/libpthread{-*.so,.so.*}" + default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,pthread,resolv,rt,util}{-*.so,.so.*,.so}" endmenu endef @@ -341,33 +320,6 @@ define Package/libthread-db/config endmenu endef -define Package/librt -$(call Package/libc/Default) - TITLE:=POSIX.1b RealTime extension library - DEPENDS:=+libpthread -endef - -define Package/librt/config - menu "Configuration" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt - - config LIBRT_ROOT_DIR - string - prompt "librt shared library base directory" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt - default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN - default "/" if NATIVE_TOOLCHAIN - - config LIBRT_FILE_SPEC - string - prompt "librt shared library files (use wildcards)" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt - default "./lib/librt{-*.so,.so.*}" - - endmenu -endef - - define Package/libgfortran $(call Package/gcc/Default) TITLE:=GFortran support library @@ -555,7 +507,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(CP) \ $(TOOLCHAIN_DIR)/lib/ld*.so.* \ $(1)/lib/ - for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \ + for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libpthread libresolv librt libutil; do \ for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.*; do \ if [ -e "$$$$file" ]; then \ $(CP) $$$$file $(1)/lib/; \ @@ -584,40 +536,19 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libc/install_lib $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/ $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a) + $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a) $(if $(LIBGCC_MAP), \ $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \ $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \ ) endef - define Package/libpthread/install - $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ - $(1)/lib/ - endif - endef - define Package/libthread-db/install $(INSTALL_DIR) $(1)/lib $(CP) \ $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib endef - define Package/libpthread/install_lib - $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a) - endef - - define Package/librt/install - $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) - $(CP) \ - $(TOOLCHAIN_DIR)/lib/librt.so.* \ - $(1)/lib/ - endif - endef - define Package/ldd/install $(INSTALL_DIR) $(1)/usr/bin/ $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/ @@ -705,14 +636,6 @@ else $(call Package/$(LIBC)/install,$1) endef - define Package/libpthread/install - for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \ - $(INSTALL_DIR) $(1)/lib ; \ - $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/lib/ ; \ - done ; \ - exit 0 - endef - define Package/libthread-db/install for file in $(call qstrip,$(CONFIG_LIBTHREAD_DB_FILE_SPEC)); do \ $(INSTALL_DIR) $(1)/lib ; \ @@ -721,14 +644,6 @@ else exit 0 endef - define Package/librt/install - for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \ - $(INSTALL_DIR) $(1)/lib ; \ - $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/lib/ ; \ - done ; \ - exit 0 - endef - define Package/libatomic/install for file in $(call qstrip,$(CONFIG_LIBATOMIC_FILE_SPEC)); do \ $(INSTALL_DIR) $(1)/lib ; \ @@ -782,9 +697,7 @@ $(eval $(call BuildPackage,libasan)) $(eval $(call BuildPackage,libtsan)) $(eval $(call BuildPackage,liblsan)) $(eval $(call BuildPackage,libubsan)) -$(eval $(call BuildPackage,libpthread)) $(eval $(call BuildPackage,libthread-db)) -$(eval $(call BuildPackage,librt)) $(eval $(call BuildPackage,libgfortran)) $(eval $(call BuildPackage,libgomp)) $(eval $(call BuildPackage,ldd)) diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index b96a3f71e5..6fa21cdfb7 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -35,7 +35,7 @@ define Package/ltq-adsl-app CATEGORY:=Network TITLE:=Lantiq DSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread +ltq-dsl-base +libubox +libubus + DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +ltq-dsl-base +libubox +libubus PROVIDES:=ltq-dsl-app MENU:=1 endef diff --git a/package/network/config/ltq-vdsl-vr9-app/Makefile b/package/network/config/ltq-vdsl-vr9-app/Makefile index a73cd4ae62..5a19a6f757 100644 --- a/package/network/config/ltq-vdsl-vr9-app/Makefile +++ b/package/network/config/ltq-vdsl-vr9-app/Makefile @@ -29,7 +29,7 @@ define Package/ltq-vdsl-vr9-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +libpthread +librt +ltq-dsl-base +libubox +libubus + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +ltq-dsl-base +libubox +libubus PROVIDES:=ltq-dsl-app endef diff --git a/package/network/ipv6/thc-ipv6/Makefile b/package/network/ipv6/thc-ipv6/Makefile index b26b0507fb..7df0d62a80 100644 --- a/package/network/ipv6/thc-ipv6/Makefile +++ b/package/network/ipv6/thc-ipv6/Makefile @@ -33,15 +33,12 @@ THC_APPLETS := \ randicmp6 redir6 rsmurf6 sendpees6 sendpeesmp6 smurf6 thcping6 \ toobig6 trace6 toobigsniff6 flood_unreach6 connect6 -THC_DEPENDS_dnsdict6 := +libpthread -THC_DEPENDS_thcping6 := +librt - define BuildTool define Package/thc-ipv6-$(subst _,-,$(1)) TITLE:=THC-IPv6 $(1) utility SECTION:=net CATEGORY:=Network - DEPENDS:=+libpcap $(THC_DEPENDS_$(1)) + DEPENDS:=+libpcap URL:=https://github.com/vanhauser-thc/thc-ipv6 SUBMENU:=THC-IPv6 attack and analyzing toolkit endef diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index e7c45e3523..b5e659e586 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -38,7 +38,7 @@ define Package/opkg SECTION:=base CATEGORY:=Base system TITLE:=opkg package manager - DEPENDS:=+uclient-fetch +libpthread +libubox + DEPENDS:=+uclient-fetch +libubox DEFAULT:=y if !USE_APK URL:=$(PKG_SOURCE_URL) MENU:=1 diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index f0f137c781..47721ae82c 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -25,7 +25,7 @@ define Package/adb CATEGORY:=Utilities TITLE:=Android Debug Bridge CLI tool URL:=http://tools.android.com/ - DEPENDS:=+zlib +libopenssl +libpthread + DEPENDS:=+zlib +libopenssl endef define Package/adb/description diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile index b521daaefc..1b4aab4daf 100644 --- a/package/utils/mdadm/Makefile +++ b/package/utils/mdadm/Makefile @@ -29,7 +29,7 @@ define Package/mdadm SUBMENU:=Disc TITLE:=A tool for managing Soft RAID under Linux URL:=https://www.kernel.org/pub/linux/utils/raid/mdadm/ - DEPENDS:=+libpthread +kmod-md-mod +kmod-md-raid0 +kmod-md-raid10 +kmod-md-raid1 + DEPENDS:=+kmod-md-mod +kmod-md-raid0 +kmod-md-raid10 +kmod-md-raid1 endef define Package/mdadm/description diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 83f3a8c842..824c1a239a 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -33,7 +33,6 @@ include $(INCLUDE_DIR)/meson.mk define Package/util-linux/Default SECTION:=utils CATEGORY:=Utilities - DEPENDS:= +librt URL:=http://www.kernel.org/pub/linux/utils/util-linux/ endef