commit 61031d3a32b701f39f4db4d60e04dc7f87737456
parent 39690a1c8bd2dda98fdb035fe9bebed13aa084ea
Author: Jan Pobrislo <ccx@te2000.cz>
Date: Sat, 3 May 2025 20:54:42 +0000
Add libunwind as strace dependency
Diffstat:
11 files changed, 258 insertions(+), 6 deletions(-)
diff --git a/downloadlist.sha256 b/downloadlist.sha256
@@ -55,3 +55,4 @@ f311f8f3dad84699d0566d1d6f7ec943a9298b28f714cae3c931dfd57492d7eb 189200 https://
0e751989cea94e25d5166a6a1ed9bde218786e39dff82e1f01dff12fc78639d9 2329 https://hacktivis.me/releases/error-standalone/error-standalone-2.0.tar.gz
c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6 65889 https://github.com/argp-standalone/argp-standalone/archive/refs/tags/1.5.0.tar.gz
e209daf0ee038ca5adcc4c277e9273b4d51f46a2ff86da575d36742ac3508a17 2642452 https://github.com/strace/strace/releases/download/v6.13/strace-6.13.tar.xz
+ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157 958468 https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz
diff --git a/templates/pkg/libunwind b/templates/pkg/libunwind
@@ -0,0 +1,14 @@
+{% extends "autotools" %}
+{%- block extra_deps %}
+#@untar:-z:sha256:ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157:.
+{%- endblock %}
+{% block at_script %}
+
+autotools_static libunwind-1.8.1
+
+{% endblock %}
+{% block genlinks_begin %}
+ x["./include/libunwind.h"]=1
+ x["./include/unwind.h"]=1
+ x["./library/libunwind.a"]=1
+{% endblock %}
diff --git a/templates/pkg/strace b/templates/pkg/strace
@@ -1,6 +1,7 @@
{% extends "autotools" %}
{%- block extra_deps %}
#+{{pkg_install_name("patch")}}
+#+{{pkg_install_name("libunwind")}}
#@untar:-J:sha256:e209daf0ee038ca5adcc4c277e9273b4d51f46a2ff86da575d36742ac3508a17:.
#@sha256:{{files["strace-6.5-static.patch"]}}:strace-6.5-static.patch
{%- endblock %}
diff --git a/variants/ccx-x86_64/default.environment b/variants/ccx-x86_64/default.environment
@@ -36,7 +36,7 @@
#+applyuidgid-caps.9856a13db04a0f0192c4208744de2c649db2ae721dc0d0dd37eb90346236a514
#+ccx-utils.ab28a8d701f60db69818ef22c546d02eca1ba3900bcdeaf5676bcc13d4b7f114
#+user-env.4e95a5387aa403e1d16a22254f21fb4cec046c69341a5eae764dd8126fb638a8
-#+strace.b6316a0a4fef0b98fa9cfd4e7c4a8a0ccab27f40d4cf6eb1a825d71dd0c35e11
+#+strace.29a2acdbb5aaf4821aadacddb60a82442cd77827c2834f35ed30c23e514e013b
#+system-config.8b8a2b03a8f9bad97cf0a3db217832b54a3342816a7fb0c6bfb086547549de2c
#+system-config-rc.f1100a179601fb9629ec20a51431541d7092cfabd33ef8d9708e7767d315729f
#+system-config-scripts.bdedb957b96fc1efd8259d16dac786d1d9c220dcde66996a16688989f104925d
diff --git a/variants/ccx-x86_64/libunwind b/variants/ccx-x86_64/libunwind
@@ -0,0 +1,117 @@
+#!/usr/bin/env pthbs-build
+#+musl-cross-make.98979eb41109d371f19d0637d51116db18c7aeef61fbf804a68094c22a302a78
+#+gnu-make.ba8d7c64a23885182fc1c9dc0331d52adcdbc45df6000fb81e8e1dd3ee05694b
+#+busybox.ee3440974794767b833fd3299226771f170d3f8601cf225cb884f0a513db8ab3
+#+busybox-diffutils.c2ebcfcad050ad71b8e30322a463b5c009f254c7a42e95c627d32665e17134dc
+#+m4.46e121f61e0af52abf876bf2688ecfe70eeb04185028d6adde0085e865fdfe75
+#@untar:-z:sha256:ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157:.
+
+build_env_static() {
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library"
+ export CPATH="$pthbs_build_environment/include"
+ export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
+}
+autotools_config() {
+ prefix=/home/ccx/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$(${CC:-gcc} -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library" \
+ --docdir="$prefix/doc/libunwind" \
+ --datadir="$prefix/data" \
+ --datarootdir="$prefix/data" \
+ --localstatedir='/var/pthbs' \
+ "$@"
+
+}
+
+autotools() {
+ cd "$1"
+ shift
+ autotools_config "$@"
+ make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+ make DESTDIR="$pthbs_destdir" install
+}
+
+autotools_static() {
+ build_env_static
+ autotools "$@" --enable-static --disable-shared
+}
+check_static() {
+ local exe || true
+ exe=$pthbs_destdir/'/home/ccx/versions'/$pthbs_package/$1
+ if ! test -f $exe; then
+ printf '%s\n' "Error: file '$1' doesn't exist!"
+ exit 1
+ fi
+ interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
+ if test x '!=' "x$interp_info"; then
+ printf '%s\n' "Error: '$1' is a dynamic binary!"
+ exit 1
+ fi
+}
+
+
+autotools_static libunwind-1.8.1
+
+
+
+cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./include/libunwind.h"]=1
+ x["./include/unwind.h"]=1
+ x["./library/libunwind.a"]=1
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/variants/ccx-x86_64/strace b/variants/ccx-x86_64/strace
@@ -5,6 +5,7 @@
#+busybox-diffutils.c2ebcfcad050ad71b8e30322a463b5c009f254c7a42e95c627d32665e17134dc
#+m4.46e121f61e0af52abf876bf2688ecfe70eeb04185028d6adde0085e865fdfe75
#+patch.05834624d74752d1cbe386cd61dbd0dd98d69aad7777828dcf07390ab8772d4b
+#+libunwind.ab1e76c83917bebf63d9b3ca6af5bd46dc41ac2e5e29c9d42eadf39e4e878b55
#@untar:-J:sha256:e209daf0ee038ca5adcc4c277e9273b4d51f46a2ff86da575d36742ac3508a17:.
#@sha256:37d93db7135d47852dbe763f1b18b3aeab142431a6f5268a17fc700387a326e4:strace-6.5-static.patch
diff --git a/variants/ccx-x86_64/userspace.environment b/variants/ccx-x86_64/userspace.environment
@@ -36,4 +36,4 @@
#+applyuidgid-caps.9856a13db04a0f0192c4208744de2c649db2ae721dc0d0dd37eb90346236a514
#+ccx-utils.ab28a8d701f60db69818ef22c546d02eca1ba3900bcdeaf5676bcc13d4b7f114
#+user-env.4e95a5387aa403e1d16a22254f21fb4cec046c69341a5eae764dd8126fb638a8
-#+strace.b6316a0a4fef0b98fa9cfd4e7c4a8a0ccab27f40d4cf6eb1a825d71dd0c35e11-
\ No newline at end of file
+#+strace.29a2acdbb5aaf4821aadacddb60a82442cd77827c2834f35ed30c23e514e013b+
\ No newline at end of file
diff --git a/variants/root-x86_64/default.environment b/variants/root-x86_64/default.environment
@@ -36,7 +36,7 @@
#+applyuidgid-caps.2d571b717bda734b4464e7d3b36bb2c9eaa265fffd595bc090cbb137258121b8
#+ccx-utils.ccaa449ada3142ef075f3c80a6e475520219814490557f308ded4685231a70ac
#+user-env.8ad55eebe32b11f005f7b5c6dc204fdccc0a53cd7294f87c1e959ea47793dbca
-#+strace.aa86940d5ff7669c8dbe771d26819995847e9dcfc451ce988271c29c84b72c24
+#+strace.c3f5ff2fd2d12bd085ffb0993661ca160d4c9e555d1fd4b1f513fed6d6d21ba8
#+system-config.db2dff20fd0bda4dc1fedd9697304907d9eb143f1c6df0e733e1724a595250e3
#+system-config-rc.8f334e9cbdafc74e6fc7257996dc0fa8200054ec285bdb3901450467d9e52b58
#+system-config-scripts.4c00e32b8c4f6feef53b562356abd54830cc7e889149e4f8bcb928d6e6e93378
diff --git a/variants/root-x86_64/libunwind b/variants/root-x86_64/libunwind
@@ -0,0 +1,117 @@
+#!/usr/bin/env pthbs-build
+#+musl-cross-make.d0431fc0def788be03da43136972361827de52c8e6f0a6f3890dc57fe32e8ecc
+#+gnu-make.444e811a68f4f16724e21354b710fad3592e53a2dbf7c0c78658f3d4e7c8e465
+#+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089
+#+busybox-diffutils.4a0933977737282afcd82b39d435b50946a700fe13472d24e4580a41fa852123
+#+m4.3cffaef6909a65493ddc9aba4c53f77dc594ff5ab8b58c57acaa34c654b09ff3
+#@untar:-z:sha256:ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157:.
+
+build_env_static() {
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library"
+ export CPATH="$pthbs_build_environment/include"
+ export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
+}
+autotools_config() {
+ prefix=/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$(${CC:-gcc} -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library" \
+ --docdir="$prefix/doc/libunwind" \
+ --datadir="$prefix/data" \
+ --datarootdir="$prefix/data" \
+ --localstatedir='/var/pthbs' \
+ "$@"
+
+}
+
+autotools() {
+ cd "$1"
+ shift
+ autotools_config "$@"
+ make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+ make DESTDIR="$pthbs_destdir" install
+}
+
+autotools_static() {
+ build_env_static
+ autotools "$@" --enable-static --disable-shared
+}
+check_static() {
+ local exe || true
+ exe=$pthbs_destdir/'/versions'/$pthbs_package/$1
+ if ! test -f $exe; then
+ printf '%s\n' "Error: file '$1' doesn't exist!"
+ exit 1
+ fi
+ interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
+ if test x '!=' "x$interp_info"; then
+ printf '%s\n' "Error: '$1' is a dynamic binary!"
+ exit 1
+ fi
+}
+
+
+autotools_static libunwind-1.8.1
+
+
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./include/libunwind.h"]=1
+ x["./include/unwind.h"]=1
+ x["./library/libunwind.a"]=1
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+ printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
+}
+$1!="."{exit 1}
+
+
+$2 == "command" { link($0); next }
+$2 == "bin" { link(s1("command", $0)); next }
+
+$2 == "library.so" { link($0); next }
+$2 == "library" { link($0); next }
+$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
+$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
+
+$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
+
+$2 == "man" { link($0); next }
+$2 == "info" { link($0); next }
+$2 == "doc" { link($0); next }
+$2 == "icons" { link($0); next }
+$2 == "terminfo" { link($0); next }
+$2 == "data" { link($0); next }
+$2 == "include" { link($0); next }
+
+{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/variants/root-x86_64/strace b/variants/root-x86_64/strace
@@ -5,6 +5,7 @@
#+busybox-diffutils.4a0933977737282afcd82b39d435b50946a700fe13472d24e4580a41fa852123
#+m4.3cffaef6909a65493ddc9aba4c53f77dc594ff5ab8b58c57acaa34c654b09ff3
#+patch.9d8b2c370a0ccf6e5ad48c27070ff1da2d30d41327fd5711a76cf570b34ae523
+#+libunwind.a4f50882a08688cbaaf022a71b984ef3f8742a4ba070d36d292a941189ea2aae
#@untar:-J:sha256:e209daf0ee038ca5adcc4c277e9273b4d51f46a2ff86da575d36742ac3508a17:.
#@sha256:37d93db7135d47852dbe763f1b18b3aeab142431a6f5268a17fc700387a326e4:strace-6.5-static.patch
diff --git a/variants/root-x86_64/userspace.environment b/variants/root-x86_64/userspace.environment
@@ -36,4 +36,4 @@
#+applyuidgid-caps.2d571b717bda734b4464e7d3b36bb2c9eaa265fffd595bc090cbb137258121b8
#+ccx-utils.ccaa449ada3142ef075f3c80a6e475520219814490557f308ded4685231a70ac
#+user-env.8ad55eebe32b11f005f7b5c6dc204fdccc0a53cd7294f87c1e959ea47793dbca
-#+strace.aa86940d5ff7669c8dbe771d26819995847e9dcfc451ce988271c29c84b72c24-
\ No newline at end of file
+#+strace.c3f5ff2fd2d12bd085ffb0993661ca160d4c9e555d1fd4b1f513fed6d6d21ba8+
\ No newline at end of file