summaryrefslogtreecommitdiff
path: root/scripts/build/arch/sparc.sh
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2016-03-31 01:42:30 (GMT)
committerAlexey Neyman <stilor@att.net>2016-06-10 00:12:49 (GMT)
commita60946eb24430a8b43b8fe6027d32ab17be28111 (patch)
treea0714a5f370a18b08be6c43c7c9f7565375f36e7 /scripts/build/arch/sparc.sh
parent08d91d41f3c0bceed264a24920b4daa98fa18b9a (diff)
arch/sparc: better default CPU when targetting Linux
By default, sparc64-*-linux is configured with -mcpu=v9. However, according to https://sourceware.org/ml/libc-alpha/2005-12/msg00027.html: "There is no Linux sparc64 port that runs on non-UltraSPARC-I+ ISA CPUs." v9 is such a "non-UltraSPARC-I+ ISA CPU", so it makes no sense to default to v9 when targetting Linux. Change the default to ultrasparc, even though it can suboptimally schedule instructions for newer SPARC CPUs. See the pending patch: https://patchwork.ozlabs.org/patch/409424/ Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/arch/sparc.sh')
-rw-r--r--scripts/build/arch/sparc.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/build/arch/sparc.sh b/scripts/build/arch/sparc.sh
index e3e7491..1cf2acf 100644
--- a/scripts/build/arch/sparc.sh
+++ b/scripts/build/arch/sparc.sh
@@ -2,4 +2,17 @@
CT_DoArchTupleValues() {
# That's the only thing to override
CT_TARGET_ARCH="sparc${target_bits_64}${CT_ARCH_SUFFIX}"
+
+ # By default, sparc64-*-linux is configured with -mcpu=v9. However,
+ # according to https://sourceware.org/ml/libc-alpha/2005-12/msg00027.html,
+ # "There is no Linux sparc64 port that runs on non-UltraSPARC-I+ ISA CPUs."
+ # There is a patch that would change the default to -mcpu=ultrasparc for
+ # sparc64-*-linux configuration: https://patchwork.ozlabs.org/patch/409424/
+ # but that patch has not been integrated (yet). One concern raised about
+ # this patch was that -mcpu=ultrasparc can suboptimally schedule instructions
+ # for newer SPARC CPUs. So, override to -mcpu=ultrasparc and warn the user.
+ if [ "${CT_KERNEL}" = "linux" -a "${CT_ARCH_64}" = "y" -a -z "${CT_ARCH_CPU}" ]; then
+ CT_DoLog WARN "Setting CPU to UltraSPARC-I for sparc64-linux. Set CT_ARCH_CPU if a different CPU is desired."
+ CT_ARCH_WITH_CPU="--with-cpu=ultrasparc"
+ fi
}