summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-11-23 20:35:28 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-11-23 20:35:28 (GMT)
commit2e1dcdf8d499e857647a74e26cf07c312bb03649 (patch)
tree0150941b6e1cd6fd09e81c99d403a034f172f32c
parent70309ce671a8550a44fbd190d6988cc556d1eaa5 (diff)
scripts/xldd: better find sysroot with old gcc
Only starting with 4.4 does gcc have a -print-sysroot option. For 4.3 or before, we have to play some tricks: - ask gcc where libc.so is, (we expect it in ${sysroot}/usr/lib/libc.so) - trim /usr/lib/libc.so from the result Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rwxr-xr-xscripts/xldd.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/xldd.in b/scripts/xldd.in
index 40a5fe7..9c8ffbc 100755
--- a/scripts/xldd.in
+++ b/scripts/xldd.in
@@ -134,7 +134,15 @@ if [ ! -d "${root}" ]; then
exit 1
fi
-sysroot="$( "${gcc}" -print-sysroot )"
+sysroot="$( "${gcc}" -print-sysroot 2>/dev/null )"
+if [ -z "${sysroot}" ]; then
+ sysroot="$( "${gcc}" -print-file-name=libc.so 2>/dev/null \
+ |sed -r -e 's:/usr/lib/libc.so$::;' \
+ )"
+fi
+if [ -z "${sysroot}" ]; then
+ do_error "unable to find sysroot for \`${gcc}'"
+fi
do_report_needed_found() {
local needed="${1}"