[PATCH] scripts/faddr2line: fix CROSS_COMPILE unset error
From: Liu, Changcheng
Date: Tue Dec 05 2017 - 20:31:41 EST
faddr2line hit var unbound error When CROSS_COMPILE
isn't set since nounset option is set in bash script.
Signed-off-by: Liu Changcheng <changcheng.liu@xxxxxxxxx>
Reported-by: Richard Weinberger <richard.weinberger@xxxxxxxxx>
diff --git a/scripts/faddr2line b/scripts/faddr2line
index 39e07d8..7721d5b 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -44,10 +44,10 @@
set -o errexit
set -o nounset
-READELF="${CROSS_COMPILE}readelf"
-ADDR2LINE="${CROSS_COMPILE}addr2line"
-SIZE="${CROSS_COMPILE}size"
-NM="${CROSS_COMPILE}nm"
+READELF="${CROSS_COMPILE:-}readelf"
+ADDR2LINE="${CROSS_COMPILE:-}addr2line"
+SIZE="${CROSS_COMPILE:-}size"
+NM="${CROSS_COMPILE:-}nm"
command -v awk >/dev/null 2>&1 || die "awk isn't installed"
command -v ${READELF} >/dev/null 2>&1 || die "readelf isn't installed"
--
2.7.4