[RFC PATCH] add sparc support to CT-NG
Sam Ravnborg
sam@ravnborg.org
Wed Dec 29 20:59:00 GMT 2010
I needed to build a new set of sparc toolchains.
So I took a look at adding sparc support to crosstool-ng.
As I have very limited experience in building toolchains
my initial attemts failed but I ended up with the
following simple patch.
With this I have succeeded building a sparc + sparc64 toolchain.
I will resumit after addressing any commants.
Note: Menuconfig ask for "Emit assembly for CPU"
It looked worg to ask for a string - but I have not tried
to find a way to control it.
Note2: I know Konrad Eisele has done some work to add support
for sparc to crosstool-ng too (with focus on the leon variants).
But I failed to locate any pathces - he may have something
that is preferred over the following set of simple patches.
Testing so far is only that I can partially build a kernel
with both toolchains - they are still building...
I will test the sparc kernel later (the 32 bit version).
Sam
diff -r 8bcae97e8fd5 config/arch/sparc.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/config/arch/sparc.in Wed Dec 29 21:49:45 2010 +0100
@@ -0,0 +1,12 @@
+# MIPS specific config options
+
+config ARCH_sparc
+ select ARCH_SUPPORTS_32
+ select ARCH_SUPPORTS_64
+ select ARCH_DEFAULT_32
+ select ARCH_USE_MMU
+ select ARCH_SUPPORT_CPU
+ help
+ The SUN SPARC architecture, as defined by:
+ 32 bit: http://www.sparc.org/standards/V8.pdf
+ 64 bit: http://www.sparc.org/standards/SPARCV9.pdf
diff -r 8bcae97e8fd5 config/arch/sparc.in.2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/config/arch/sparc.in.2 Wed Dec 29 21:49:45 2010 +0100
@@ -0,0 +1,33 @@
+# SPARC specific configuration file
+
+choice
+ bool
+ prompt "SPARC Architecture"
+
+config ARCH_SPARC_V7
+ bool
+ depends on ARCH_32
+ prompt "V7"
+ help
+ cypress
+
+config ARCH_SPARC_V8
+ bool
+ depends on ARCH_32
+ prompt "V8"
+ help
+ supersparc, hypersparc
+
+config ARCH_SPARC_V9
+ bool
+ depends on ARCH_64
+ prompt "V9"
+ help
+ ultrasparc, ultrasparc3, niagara, niagara2
+
+endchoice
+
+config ARCH_CPU
+ default "v7" if ARCH_SPARC_V7
+ default "v8" if ARCH_SPARC_V8
+ default "v9" if ARCH_SPARC_V9
diff -r 8bcae97e8fd5 scripts/build/arch/sparc.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/build/arch/sparc.sh Wed Dec 29 21:49:45 2010 +0100
@@ -0,0 +1,10 @@
+# Compute sparc-specific values
+CT_DoArchTupleValues() {
+ # That's the only thing to override
+ if [ "${CT_ARCH_64}" = "y" ]; then
+ CT_TARGET_ARCH="${CT_ARCH}64"
+ else
+ CT_TARGET_ARCH="${CT_ARCH}"
+ fi
+
+}
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list