summaryrefslogtreecommitdiff
path: root/scripts/build/arch
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-01-22 03:45:13 (GMT)
committerAlexey Neyman <stilor@att.net>2018-01-22 03:45:13 (GMT)
commit7c720ae3941c7645fec0529ed3ba4701a9bfcbfe (patch)
treed90909b943e81a9f305a508293f430b1b7641f8a /scripts/build/arch
parent37caa3d4d7986e95e71fcfd102d3a02b08f8a6b8 (diff)
Only decorate TARGET_ARCH if using specific CPU
Otherwise, binutils don't recognize it as a valid target - even though GCC does. Fixes #897. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/arch')
-rw-r--r--scripts/build/arch/sh.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/build/arch/sh.sh b/scripts/build/arch/sh.sh
index 1911b20..8339b94 100644
--- a/scripts/build/arch/sh.sh
+++ b/scripts/build/arch/sh.sh
@@ -1,8 +1,12 @@
# Compute sh-specific values
CT_DoArchTupleValues () {
- # The architecture part of the tuple:
- CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${CT_ARCH_SUFFIX:-${target_endian_eb}}"
+ # The architecture part of the tuple. Binutils do not accept specifications
+ # like 'sheb-unknown-elf' even though GCC does. So keep the tuple just sh-*-elf
+ # unless user wants something specific (either CPU or explicit suffix).
+ if [ "${CT_ARCH_SH_VARIANT}" != "sh" -o -n "${CT_ARCH_SUFFIX}" ]; then
+ CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${CT_ARCH_SUFFIX:-${target_endian_eb}}"
+ fi
# Endianness stuff (uses non-standard CFLAGS). If both are compiled, let the
# compiler's default or multilib iterator be used.