summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Martin <paul.martin@codethink.co.uk>2015-03-04 14:28:36 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-03-23 15:32:59 +0000
commit03aaed6441cd00f95aa7170c96406a3a3113ee17 (patch)
tree8dbb3284e67deb9c9f15427dd4aa52f140b08e90
parentaf943e0b0a20b2a9916ccac19c5ffaef43c484a4 (diff)
downloaddefinitions-03aaed6441cd00f95aa7170c96406a3a3113ee17.tar.gz
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.
-rw-r--r--strata/build-essential/stage2-glibc.morph2
1 files changed, 2 insertions, 0 deletions
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