Commit ecb13d7d authored by jan.koester's avatar jan.koester
Browse files

build-chroot: --sysroot on wrapper links, /usr/sbin in PATH

-nostdlib drops crt/libs but not clang's default -L dirs, so a -lfoo
missing from the sysroot resolved to the host's glibc-built
/lib/x86_64-linux-gnu/libfoo.so (cmlibarchive's CHECK_LIBRARY_EXISTS(md)
passed via the host libmd while find_library() saw nothing). chroot
lives in /usr/sbin, which a non-root user's PATH often lacks.

Co-Authored-By: default avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 146e4518
Loading
Loading
Loading
Loading
+4 −0
Changes for build-chroot.sh: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -73,6 +73,10 @@

set -euo pipefail

# chroot (smoke test, in_chroot) lives in /usr/sbin, which a non-root
# user's PATH often lacks
case ":$PATH:" in *:/usr/sbin:*) ;; *) PATH="$PATH:/usr/sbin:/sbin" ;; esac

SYSTEMPP_SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORK="$(realpath -m "${WORK:-$SYSTEMPP_SRC/build-chroot}")"
FRESH_SRC="$(realpath -m "${FRESH_SRC:-$SYSTEMPP_SRC/../fresh}")"