aboutsummaryrefslogtreecommitdiff
path: root/depends
diff options
context:
space:
mode:
author0xb10c <0xb10c@gmail.com>2021-12-07 14:46:48 +0100
committer0xb10c <0xb10c@gmail.com>2022-01-04 10:13:24 +0100
commite158a2a7aa501da635cb34414abd0c092216e5f4 (patch)
tree0d1fdaff2e5b086e2a544fddaef04145b72478a4 /depends
parent38146a4bd2e55973dbc7c4716b1815e204adbf84 (diff)
downloadbitcoin-e158a2a7aa501da635cb34414abd0c092216e5f4.tar.xz
build: add systemtap's sys/sdt.h as depends
The sys/sdt.h header is required to build Bitcoin Core with Userspace Statically Defined Tracing support. Systemtap version 4.5 (May 2021) is used as the most recent version 4.6 (Nov 2021) fails to build. See e.g. https://sourceware.org/git/?p=systemtap.git;a=commit;h=1d3653936fc1fd13135a723a27e6c7e959793ad0 As Systemtap itself is not needed, the build steps (configure and make) are skipped. We require fewer build dependecies and don't waste time building depends we don't end up using. However, the configure step would normally processes sys/sdt-config.h.in. The resulting sdt-config.h defines _SDT_ASM_SECTION_AUTOGROUP_SUPPORT (either 0 or 1 to indicate whether the assembler supports "?" in .pushsection directives). For now, we assume all currently used assemblers supports this feature and remove the check from the sys/sdt.h header file in a patch. Co-authored-by: Michael Ford <fanquake@gmail.com>
Diffstat (limited to 'depends')
-rw-r--r--depends/Makefile5
-rw-r--r--depends/config.site.in4
-rw-r--r--depends/packages/packages.mk2
-rw-r--r--depends/packages/systemtap.mk12
-rw-r--r--depends/patches/systemtap/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch31
5 files changed, 53 insertions, 1 deletions
diff --git a/depends/Makefile b/depends/Makefile
index 67adc6cc16..d2a3c35f1e 100644
--- a/depends/Makefile
+++ b/depends/Makefile
@@ -39,6 +39,7 @@ NO_SQLITE ?=
NO_WALLET ?=
NO_ZMQ ?=
NO_UPNP ?=
+NO_USDT ?=
NO_NATPMP ?=
MULTIPROCESS ?=
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
@@ -149,8 +150,9 @@ natpmp_packages_$(NO_NATPMP) = $(natpmp_packages)
zmq_packages_$(NO_ZMQ) = $(zmq_packages)
multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages)
+usdt_packages_$(NO_USDT) = $(usdt_$(host_os)_packages)
-packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) $(natpmp_packages_)
+packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) $(natpmp_packages_) $(usdt_packages_)
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
ifneq ($(zmq_packages_),)
@@ -228,6 +230,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@no_bdb@|$(NO_BDB)|' \
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \
+ -e 's|@no_usdt@|$(NO_USDT)|' \
-e 's|@no_natpmp@|$(NO_NATPMP)|' \
-e 's|@multiprocess@|$(MULTIPROCESS)|' \
-e 's|@debug@|$(DEBUG)|' \
diff --git a/depends/config.site.in b/depends/config.site.in
index ed1a1f8d3d..95e6ae85cf 100644
--- a/depends/config.site.in
+++ b/depends/config.site.in
@@ -70,6 +70,10 @@ if test -z "$enable_zmq" && test -n "@no_zmq@"; then
enable_zmq=no
fi
+if test -z "$enable_usdt" && test -n "@no_usdt@"; then
+ enable_usdt=no
+fi
+
if test "@host_os@" = darwin; then
BREW=no
fi
diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk
index 426fa2e748..77866c8e7a 100644
--- a/depends/packages/packages.mk
+++ b/depends/packages/packages.mk
@@ -19,6 +19,8 @@ natpmp_packages=libnatpmp
multiprocess_packages = libmultiprocess capnp
multiprocess_native_packages = native_libmultiprocess native_capnp
+usdt_linux_packages=systemtap
+
darwin_native_packages = native_ds_store native_mac_alias
$(host_arch)_$(host_os)_native_packages += native_b2
diff --git a/depends/packages/systemtap.mk b/depends/packages/systemtap.mk
new file mode 100644
index 0000000000..833e75b978
--- /dev/null
+++ b/depends/packages/systemtap.mk
@@ -0,0 +1,12 @@
+package=systemtap
+$(package)_version=4.5
+$(package)_download_path=https://sourceware.org/systemtap/ftp/releases/
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=75078ed37e0dd2a769c9d1f9394170b2d9f4d7daa425f43ca80c13bad6cfc925
+$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch && \
+ mkdir -p $($(package)_staging_prefix_dir)/include/sys && \
+ cp includes/sys/sdt.h $($(package)_staging_prefix_dir)/include/sys/sdt.h
+endef
diff --git a/depends/patches/systemtap/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch b/depends/patches/systemtap/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
new file mode 100644
index 0000000000..eae0cf72d6
--- /dev/null
+++ b/depends/patches/systemtap/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
@@ -0,0 +1,31 @@
+commit b92d4c121486f3c6e8a2cea537c53eb09894479a
+Author: 0xb10c <0xb10c@gmail.com>
+Date: Tue Dec 7 11:02:07 2021 +0100
+
+ Remove _SDT_ASM_SECTION_AUTOGROUP_SUPPORT check
+
+ We assume that the assembler supports "?" in .pushsection directives.
+ This enables us to skip configure and make.
+
+ See https://github.com/bitcoin/bitcoin/issues/23297.
+
+diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
+index 97766e710..352b4ee25 100644
+--- a/includes/sys/sdt.h
++++ b/includes/sys/sdt.h
+@@ -230,12 +230,10 @@ __extension__ extern unsigned long long __sdt_unsp;
+ nice with code in COMDAT sections, which comes up in C++ code.
+ Without that assembler support, some combinations of probe placements
+ in certain kinds of C++ code may produce link-time errors. */
+-#include "sdt-config.h"
+-#if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT
++/* PATCH: We assume that the assembler supports the feature. This
++ enables us to skip configure and make. In turn, this means we
++ require fewer dependencies and have shorter depend build times. */
+ # define _SDT_ASM_AUTOGROUP "?"
+-#else
+-# define _SDT_ASM_AUTOGROUP ""
+-#endif
+
+ #define _SDT_ASM_BODY(provider, name, pack_args, args) \
+ _SDT_ASM_1(990: _SDT_NOP) \