aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-07-28 11:34:17 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-07-28 20:02:23 +0100
commit6a55ff29578e8afbe795547468a78494b3b52831 (patch)
treea2e1bd154c56f528a1c621ca2946dab200312109 /gcc
parent0f1de0c4ce6eb237128d8f6439c2434aded1f51a (diff)
downloadgcc-6a55ff29578e8afbe795547468a78494b3b52831.zip
gcc-6a55ff29578e8afbe795547468a78494b3b52831.tar.gz
gcc-6a55ff29578e8afbe795547468a78494b3b52831.tar.bz2
gcc: Make exec-tool.in handle missing Binutils more gracefully
When users try to build a cross-compiler without first installing binutils they get confusing errors like: /tmp/gcc-obj/./gcc/as: line 114: exec: -m: invalid option This is an incredibly common source of questions on gcc-help and IRC, and bogus bug reports e.g. see PR 116119 for the latest example. This change adds an explicit check for an empty $original variable and exits with a user-friendly error. gcc/ChangeLog: * exec-tool.in: Exit with an error if $original is empty.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/exec-tool.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/exec-tool.in b/gcc/exec-tool.in
index 7d152e0..2767e10 100644
--- a/gcc/exec-tool.in
+++ b/gcc/exec-tool.in
@@ -81,6 +81,14 @@ case "$invoked" in
;;
esac
+if test -z "$original"
+then
+ echo "$0: \$original is unset" >&2
+ echo "This probably means there is no '$invoked' for the target." >&2
+ echo "For a cross-compiler, you probably need to install Binutils first." >&2
+ exit 1
+fi
+
case "$original" in
../*)
# compute absolute path of the location of this script