diff --git a/.gitea/scripts/install-linux-build-dependencies.sh b/.gitea/scripts/install-linux-build-dependencies.sh index ae0446e..afb52dd 100644 --- a/.gitea/scripts/install-linux-build-dependencies.sh +++ b/.gitea/scripts/install-linux-build-dependencies.sh @@ -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 diff --git a/crates/bds-ui/tests/packaging_assets.rs b/crates/bds-ui/tests/packaging_assets.rs index 6c28074..e38ce80 100644 --- a/crates/bds-ui/tests/packaging_assets.rs +++ b/crates/bds-ui/tests/packaging_assets.rs @@ -195,8 +195,9 @@ fn tagged_releases_are_built_and_packaged_with_rust_tools() { "Architectures: arm64", "--download-only", "dpkg-deb --extract", - "ln -s usr/lib \"$sysroot/lib\"", - "ln -s usr/lib64 \"$sysroot/lib64\"", + "libc.so.6 libm.so.6 libmvec.so.1", + "cp -a \"$sysroot/usr/lib/x86_64-linux-gnu/$library\"", + "cp -a \"$sysroot/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2\"", "/usr/share/pkgconfig/.", "/opt/ruds-x64-sysroot", ] {