summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/toolchain.in1
-rw-r--r--scripts/functions17
2 files changed, 17 insertions, 1 deletions
diff --git a/config/toolchain.in b/config/toolchain.in
index 89f3ffb..61d939d 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -33,6 +33,7 @@ config TARGET_VENDOR
A tuple is of the form arch-vendor-kernel-system.
You can set the second part, vendor, to whatever you see fit.
Use a single word, or use underscores "_" to separate words.
+ Use neither dash nor space, as it breaks things.
Keep the default (unkown) if you don't know better.
diff --git a/scripts/functions b/scripts/functions
index cffd6ba..6fbc9cf 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -697,7 +697,22 @@ CT_DoBuildTargetTuple() {
CT_DoKernelTupleValues
# Finish the target tuple construction
- CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}${CT_TARGET_KERNEL:+-}${CT_TARGET_SYS}")
+ CT_TARGET="${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}${CT_TARGET_KERNEL:+-}${CT_TARGET_SYS}"
+
+ # Sanity checks
+ __sed_alias=""
+ if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
+ __sed_alias=$(echo "${CT_TARGET}" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
+ fi
+ case ":${CT_TARGET_VENDOR}:${CT_TARGET_ALIAS}:${__sed_alias}:" in
+ :*" "*:*:*:) CT_Abort "Don't use spaces in the vendor string, it breaks things.";;
+ :*"-"*:*:*:) CT_Abort "Don't use dashes in the vendor string, it breaks things.";;
+ :*:*" "*:*:) CT_Abort "Don't use spaces in the target alias, it breaks things.";;
+ :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed transform, it breaks things.";;
+ esac
+
+ # Canonicalise it
+ CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
# Prepare the target CFLAGS
CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}"