summaryrefslogtreecommitdiff
path: root/www/cross-gcc.t
diff options
context:
space:
mode:
Diffstat (limited to 'www/cross-gcc.t')
-rw-r--r--www/cross-gcc.t105
1 files changed, 0 insertions, 105 deletions
diff --git a/www/cross-gcc.t b/www/cross-gcc.t
deleted file mode 100644
index de2907d11c..0000000000
--- a/www/cross-gcc.t
+++ /dev/null
@@ -1,105 +0,0 @@
1#define _PAGE_ Building the SH1 cross compiler
2#include "head.t"
3
4<p>
5In this example I will assume that you are running Linux with the bash shell.
6We will only build the C compiler along with the assembler, linker and stuff.
7Note that the procedure is exactly the same if you are running cygwin on Windows.
8
9<h2>Download the source code</h2>
10<p>
11You will need the following archives:
12<ul>
13<li>binutils-2.11.tar.gz (find it at your closest GNU FTP site)
14<li>gcc-3.0.4.tar.gz (find it at your closest GNU FTP site)
15<li>(optional) gdb-5.1.1.tar.gz (find it at your closest GNU FTP site)
16</ul>
17<p>
18 If you want to stay out of trouble, use the versions stated above. If you
19 want to live on the edge you can try building with the latest versions.
20 However, if you use binutils-2.13 or later you will not be able to build
21 Rockbox older that CVS 2002-09-08 if you don't add the .rodata.str1.4
22 section to the .rodata section in the linker script:
23
24<pre>
25 .rodata :
26 {
27 *(.rodata)
28<b> *(.rodata.str1.4)</b>
29 } > DRAM
30</pre>
31
32<h2>Unpack the archives</h2>
33<p>
34<pre>
35 /home/linus> tar zxf binutils-2.11.tar.gz
36 /home/linus> tar zxf gcc-3.0.4.tar.gz
37 /home/linus> tar zxf gdb-5.1.1.tar.gz
38</pre>
39
40<h2>Create the directory tree</h2>
41<p>
42<pre>
43 /home/linus> mkdir build
44 /home/linus> cd build
45 /home/linus/build> mkdir binutils
46 /home/linus/build> mkdir gcc
47 /home/linus/build> mkdir gdb
48</pre>
49
50<h2>Choose location</h2>
51<p>
52Now is the time to decide where you want the tools to be installed. This is
53the directory where all binaries, libraries, man pages and stuff end up when
54you do "make install".
55<p>
56In this example I have chosen "/home/linus/sh1" as my installation directory, or <i>prefix</i> as it is called. Feel free to use any prefix, like
57/usr/local/sh1 for example.
58
59<h2>Build binutils</h2>
60<p>
61We will start with building the binutils (the assembler, linker and stuff).
62This is pretty straightforward. We will be installing the whole tool chain
63in the /home/linus/sh1 directory.
64<pre>
65 /home/linus> cd build/binutils
66 /home/linus/build/binutils> ../../binutils-2.11/configure --target=sh-elf --prefix=/home/linus/sh1
67 /home/linus/build/binutils> make
68 /home/linus/build/binutils> make install
69</pre>
70
71<h2>Build GCC</h2>
72<p>
73Now you are ready to build GCC. To do this, you must have the newly built
74binutils in the PATH.
75<pre>
76 /home/linus> export PATH=/home/linus/sh1/bin:$PATH
77 /home/linus> cd build/gcc
78 /home/linus/gcc> ../../gcc-3.0.4/configure --target=sh-elf --prefix=/home/linus/sh1 --enable-languages=c
79 /home/linus/build/gcc> make
80 /home/linus/build/gcc> make install
81</pre>
82
83<h2>Build GDB</h2>
84<p>
85If you are planning to debug your code with GDB, you have to build it as well.
86<pre>
87 /home/linus> export PATH=/home/linus/sh1/bin:$PATH
88 /home/linus> cd build/gdb
89 /home/linus/gdb> ../../gdb-5.1.1/configure --target=sh-elf --prefix=/home/linus/sh1
90 /home/linus/build/gdb> make
91 /home/linus/build/gdb> make install
92</pre>
93
94<h2>Done</h2>
95<p>
96If someone up there likes you, you now have a working tool chain for SH1.
97To compile a file with gcc:
98<pre>
99 /home/linus> sh-elf-gcc -c main.o main.c
100</pre>
101Good luck!
102<p>
103<i>Linus</i>
104
105#include "foot.t"