From 7175543e00caa9ce35487fa7f8b1b479c1ba00a2 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 02:54:21 +0100 Subject: M0: streaming provider, SSE decoder, mock provider, i686 build gate --- scripts/check-glibc.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/check-glibc.sh (limited to 'scripts/check-glibc.sh') diff --git a/scripts/check-glibc.sh b/scripts/check-glibc.sh new file mode 100755 index 0000000..bb9052f --- /dev/null +++ b/scripts/check-glibc.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Gate a release on the glibc the target actually has. +# +# The dev host's 32-bit glibc is newer than Debian 12's, so a dependency can +# silently raise the required symbol version. Without this check the failure +# only shows up as "version `GLIBC_2.38' not found" on the target machine. +set -euo pipefail + +binary=${1:?usage: check-glibc.sh [ceiling, default 2.36]} +ceiling=${2:-2.36} + +if [ ! -f "$binary" ]; then + echo "check-glibc: no such file: $binary" >&2 + exit 2 +fi + +max=$(readelf -V "$binary" 2>/dev/null \ + | grep -oE 'GLIBC_[0-9]+\.[0-9]+' \ + | sed 's/^GLIBC_//' \ + | sort -Vu \ + | tail -1 || true) + +if [ -z "${max:-}" ]; then + echo "check-glibc: no versioned symbols (statically linked?) — nothing to check" + exit 0 +fi + +echo "check-glibc: max symbol version GLIBC_$max, ceiling GLIBC_$ceiling" + +if [ "$(printf '%s\n%s\n' "$ceiling" "$max" | sort -V | tail -1)" != "$ceiling" ]; then + echo "check-glibc: FAIL — binary needs GLIBC_$max, target has GLIBC_$ceiling" >&2 + exit 1 +fi + +echo "check-glibc: ok" -- cgit v1.2.3