Testing GIt #2
[zpugcc.git] / toolchain / readme.txt
blob03cdfc27253d6436534f9ee45122bea9a4aec412
1 Test 2
2 Test
4 For demo
5 ========
6 - Alpha release of toolchain including GDB.
7 - Alpha CD
8 - Create demo apps
9   - Eliza (requires IO)
10   - Dhrystone
11   - eCos hello world/RedBoot?
12 - Finish presentation
13 - Abel prototype
14   - Install software & compile VHDL & Simulate
15   - Upload a selection of binaries
18 Todo
19 ====
20 - Add -msim -mzeta options so correct linker files are chosen
21 - Add movdi/df. Requires careful integration w/regStack. R0:DF
22   means that the value is stored in two consequtive registers.
23 - Can --relax be made default? See CRIS target
24 - Can -fomit-frame-pointer be made default w/-O1/O2/Os/O3?
26 Codesize
27 ========
28 - Add LOADSP/STOREP
29 - Remove register allocation? Check how effective dead stack slot
30   elimination actually is.
31 - more efficient cleanup of regStack
32 - ADDPC
33 - retire BRANCH(merge intocompare instructions)
34 - LOADPC/STOREPC
35 - Make CALL PC relative
36 - Add non-relaxable 13 bit absolute relocation, useful for microcode.
38 Wishlists
39 =========
41 - Get Mingw32 toolchain up and running. Fixed in GCC 4.0? See PR 14316
43 Testsuites
44 ==========
45 - add newlib testsuite
46 - add libgloss testsuite
47 - add eCos testsuite 
48 - add GDB testsuite
50 Running the testsuite
51 =====================
52 1. Start the simulator
54 2. Run tests. E.g. to run only the execute tests...
56 make check-gcc RUNTESTFLAGS="execute.exp --target_board=zpu-remote --all"
58 Other examples:
60 - Run specific test:
62 make check-gcc RUNTESTFLAGS="compile.exp=20000804-1.c --target_board=zpu-remote --all"
68 Compiling toolchain under Linux
69 ===============================
71 1. check out ecosboard/toolchain in Eclipse
72 2. chmod +x on all the executables that was checked out. Fortunally
73 a script exists for this purpose. This is a bug that has been fixed
74 in Eclipse 3.1
76 cd ecosboard/toolchain
77 sh fixperm.sh
79 3. Build as usual
81 Compiling eCos appliaction
82 ==========================
83 1. Place eCos + zpu-elf-* in environment
85 export PATH=$PATH:`pwd`/install/bin:`pwd`/ecos-install/gnutools/arm-elf/bin:`pwd`/ecos-install/ecos-2.0/tools/bin
86 export ECOS_REPOSITORY=`pwd`/ecosboard/zpu/ecos/packages
88 2. Build eCos
90 mkdir foo
91 cd foo
92 ecosconfig new zeta default
93 ecosconfig tree
94 make
96 3. Link hello world app with eCos linker library
98 zpu-elf-gcc  -Iinstall/include hello.c -Linstall/lib  -Ttarget.ld  -nostdlib   -o hello.elf -Wall
100 Regression testing
101 ==================
102 A bit of ad-hoc regression testing until we have our nightly build up will be fine.
105 Potential optimisations
106 =======================
107 - add support for loadsp/storesp
108 - add support for loadpc
109 - fix calling convention 
110 - which operators should we add support for? Today e.g. xorsi3 is handled via
111   libcalls.
113 Building GDB
114 ============
115 - Create symbolic links into binutils inside ecosboard\zpu\toolchain\gdb
117 mkdir bfd
118 cd bfd
119 lndir ../../binutils/bfd
120 cd ..
121 mkdir include
122 cd include
123 lndir ../../binutils/include
124 cd ..
125 mkdir opcodes
126 cd opcodes
127 lndir ../../binutils/opcodes
128 cd ..
129 mkdir libiberty
130 cd libiberty
131 lndir ../../binutils/libiberty
133 mkdir gdbbuild
134 cd gdbbuild
135 ../ecosboard/zpu/toolchain/gdb/configure --target=zpu-elf --prefix=`pwd`/../install
136 make
137 make install
139 Powerful debugging tips
140 =======================
142 - The zpu-elf-gcc compiler will sometimes crash while compiling 
143 programs when entries are missing/malformed in the .md file.
144 - Grep the source code(e.g. using Eclipse).
145 - Use the debugger. From the gccbuild directory:
147 $ cd gcc
148 $ insight --args ./cc1  ../../gcctest/prehello.c -dg && cat ../../gcctest/prehello.s 
150 - Dump RTL for each pass, e.g. '-dg' dumps RTL  after register allocation.
151 - GCC will cause a segmentation fault when running, at which point the stack trace might
152 be lost. Try setting an earlier breakpoint using e.g break emit_*. Remember that 
153 Insight console has name completion using <TAB>. An example is where I had
154 defined beq, but not bne and the compiler crashed when trying to jump to bne code
155 emitter.
157 Building GCC
158 ============
159 It is highly recommended to have the build directory be outside the Eclipse 
160 project where the toolchain is hosted. This makes CVS synchronization much 
161 easier.
163 To build bintools:
165 $ mkdir build
166 $ cd build
167 $ ../ecosboard/zpu/toolchain/binutils/configure --target=zpu-elf --prefix=`pwd`/../install
168 $ make
169 $ make install
171 To build GCC:
173 $ mkdir gccbuild
174 $ cd gccbuild
175 $ export PATH=$PATH:`pwd`/../install/bin
176 $ zpu-elf-ld -v 
177 GNU ld version 2.15
178 $ ../ecosboard/zpu/toolchain/gcc/configure --target=zpu-elf --prefix=`pwd`/../install --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --disable-shared --enable-newlib -v --enable-checking=misc,tree,rtl,rtlflag,gc,gcac,fold  --disable-multilib --disable-threads --enable-sjlj-exceptions --enable-libstdcxx-allocator=malloc
179 $ make
180 $ make install