From 343f2a8a6148b8004d6f4d74fb779b4f30c9686a Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 03:11:22 +0100 Subject: M1-M5: sessions, six tools, approvals, prompt, Ctrl-C, target gate - append-only JSONL sessions with --continue/--session; reasoning stored, stripped on replay - read/write/edit/grep/glob + bash with timeout and capped output - diff-preview approval for the first edit of a session, per-call approval for bash - system prompt frozen per session with AGENTS.md snapshot and change warning - SIGINT aborts the turn, second Ctrl-C exits - glibc gate ignores weak symbols; verified in linux/386 debian:12 - acceptance test (calculator in C) passes on both x86-64 and i386 --- scripts/check-glibc.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'scripts/check-glibc.sh') diff --git a/scripts/check-glibc.sh b/scripts/check-glibc.sh index bb9052f..b02cd75 100755 --- a/scripts/check-glibc.sh +++ b/scripts/check-glibc.sh @@ -4,6 +4,10 @@ # 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. +# +# Weak undefined symbols are ignored: they resolve to NULL on older libc and the +# code paths using them fall back. Rust's std does this for glibc 2.39's +# pidfd_spawnp/pidfd_getpid, for example. set -euo pipefail binary=${1:?usage: check-glibc.sh [ceiling, default 2.36]} @@ -14,21 +18,31 @@ if [ ! -f "$binary" ]; then exit 2 fi -max=$(readelf -V "$binary" 2>/dev/null \ +required=$(readelf --dyn-syms --wide "$binary" 2>/dev/null \ + | awk '$5 != "WEAK" { print }' \ + | grep -oE 'GLIBC_[0-9]+\.[0-9]+' \ + | sed 's/^GLIBC_//' \ + | sort -Vu \ + | tail -1 || true) +weak=$(readelf --dyn-syms --wide "$binary" 2>/dev/null \ + | awk '$5 == "WEAK" { print }' \ | grep -oE 'GLIBC_[0-9]+\.[0-9]+' \ | sed 's/^GLIBC_//' \ | sort -Vu \ | tail -1 || true) -if [ -z "${max:-}" ]; then +if [ -z "${required:-}" ]; 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" +echo "check-glibc: required GLIBC_$required, ceiling GLIBC_$ceiling" +if [ -n "${weak:-}" ] && [ "$weak" != "$required" ]; then + echo "check-glibc: weak GLIBC_$weak (optional, resolves to NULL on older libc)" +fi -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 +if [ "$(printf '%s\n%s\n' "$ceiling" "$required" | sort -V | tail -1)" != "$ceiling" ]; then + echo "check-glibc: FAIL — binary needs GLIBC_$required, target has GLIBC_$ceiling" >&2 exit 1 fi -- cgit v1.2.3