Materialize legacy libc paths in the x64 sysroot.
Some checks failed
Tagged release / prepare-release (push) Successful in 3m2s
Tagged release / build-linux-x64 (push) Failing after 28m40s
Tagged release / build-macos (push) Has been skipped
Tagged release / build-linux-arm64 (push) Has been skipped
Tagged release / build-windows (push) Has been skipped
Tagged release / publish-release (push) Has been skipped

This commit is contained in:
Hermes Agent
2026-08-14 16:37:03 +00:00
parent 7f12cd053b
commit 11c39e3f38
2 changed files with 23 additions and 7 deletions

View File

@@ -80,11 +80,26 @@ case "$target" in
sudo dpkg-deb --extract "$package" "$sysroot"
done
# Recreate Ubuntu's merged-/usr root links. libc development linker
# scripts refer to /lib paths, while libc6 stores the files in
# /usr/lib; --sysroot expects the same links as a complete rootfs.
sudo ln -s usr/lib "$sysroot/lib"
sudo ln -s usr/lib64 "$sysroot/lib64"
# libc's development linker scripts use legacy absolute paths even
# though Noble stores their targets below /usr. Materialize those few
# aliases so GNU ld can resolve them inside the extracted sysroot.
legacy_lib="$sysroot/lib/x86_64-linux-gnu"
sudo mkdir -p "$legacy_lib" "$sysroot/lib64"
for library in libc.so.6 libm.so.6 libmvec.so.1; do
source="$sysroot/usr/lib/x86_64-linux-gnu/$library"
if [ ! -f "$source" ]; then
echo "the downloaded amd64 libc is missing $library" >&2
exit 1
fi
sudo cp -a "$sysroot/usr/lib/x86_64-linux-gnu/$library" "$legacy_lib/"
done
loader="$sysroot/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"
if [ ! -f "$loader" ]; then
echo "the downloaded amd64 libc is missing its dynamic loader" >&2
exit 1
fi
sudo cp -a "$sysroot/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" \
"$sysroot/lib64/"
# Architecture-independent development packages may already be
# installed on the host, so apt does not download them again. Their