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