From 03aaed6441cd00f95aa7170c96406a3a3113ee17 Mon Sep 17 00:00:00 2001 From: Paul Martin Date: Wed, 4 Mar 2015 14:28:36 +0000 Subject: stage2-glibc: Fix symlink to dynamic linker On non-x86 systems, the linker may not be called ld-linux.so.* but the older name of ld.so.* When the linker is ld.so.1, for example, the install script of stage2-glibc does not exit with an error (as basename/ls are in subshells), but rather $loader is empty string. This means that the symlink made is from /lib/lib to /tools/lib rather than from /lib/ld.so.1 to /tools/lib/ld.so.1. --- strata/build-essential/stage2-glibc.morph | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strata/build-essential/stage2-glibc.morph b/strata/build-essential/stage2-glibc.morph index 48ceb767..7346cd3b 100644 --- a/strata/build-essential/stage2-glibc.morph +++ b/strata/build-essential/stage2-glibc.morph @@ -62,5 +62,7 @@ install-commands: "$DESTDIR/lib64/ld64.so.1" ;; *) loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*)) + [ -z $loader ] && loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld.so*)) + [ -z $loader ] && ( echo "Bug in stage2-glibc ld.so symlinks" ; exit 1 ) ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader" esac -- cgit v1.2.1