Changes between Version 6 and Version 7 of ARM_QEMU
- Timestamp:
- Feb 5, 2008 8:40:41 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ARM_QEMU
v6 v7 33 33 Download latest toolchain: 34 34 * binutils: http://ftp.gnu.org/gnu/binutils/ 35 * linux: http://www.kernel.org 35 36 * gcc: http://ftp.gnu.org/gnu/gcc/ 36 37 * newlib: ftp://sources.redhat.com/pub/newlib/index.html … … 40 41 $ cd /arm/setup/download 41 42 $ wget -c http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2 43 $ wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2 42 44 $ wget -c http://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2 43 45 $ wget -c ftp://sources.redhat.com/pub/newlib/newlib-1.16.0.tar.gz … … 62 64 $ cd /arm/setup/srcs 63 65 $ tar xjf ../download/binutils-2.18.tar.bz2 66 $ tar xjf ../download/linux-2.6.24.tar.bz2 64 67 $ tar xjf ../download/gcc-3.4.6.tar.bz2 65 68 $ tar xzf ../download/newlib-1.16.0.tar.gz … … 80 83 ''(if you're wondering, that will take 5 minutes on a Core2Duo 2GHz)'' 81 84 85 ==== Prepare Linux Kernel Header Files ==== 86 87 You need to have ''ncurses'' development package to do this. To install ncurses development package on Debian: 88 {{{ 89 $ sudo apt-get install ncurses-dev 90 }}} 91 92 or on RedHat: 93 {{{ 94 $ yum install ncurses-devel 95 }}} 96 97 Configure Linux: 98 {{{ 99 $ cd /arm/setup/srcs 100 $ cd linux-2.6.24/ 101 $ make menuconfig ARCH=arm 102 }}} 103 (Note: don't forget the ''ARCH=arm'' part above) 104 105 We don't need need to build the kernel now. 106 107 Now lets fix include directories: 108 {{{ 109 mkdir -p /arm/arm-elf/include 110 cd /arm/arm-elf/include 111 ln -sd /arm/setup/srcs/linux-2.6.24/include/asm-arm asm 112 ln -sd /arm/setup/srcs/linux-2.6.24/include/linux linux 113 cd .. 114 ln -sd include sys-linux 115 }}} 116 82 117 ==== Update binutils Path ==== 83 118 … … 88 123 $ export PATH=/arm/bin:$PATH 89 124 }}} 125 90 126 91 127 … … 103 139 $ cd /arm/setup/objs/gcc-arm 104 140 $ ../../srcs/gcc-3.4.6/configure --target=arm-elf --prefix=/arm --enable-threads \ 105 --with-cpu=arm9--enable-languages=c,c++ \106 --disable-nls --with-newlib --disable-shared \107 --with-float=soft141 --enable-languages=c,c++ \ 142 --disable-nls --with-newlib --disable-shared \ 143 --with-fpu=-softfpa --with-float=soft 108 144 $ make 109 145 $ make install … … 119 155 $ cd /your/pjproject/directory 120 156 $ make distclean 121 $ ./aconfigure --host=arm-elf --disable-floating-point --disable-sound CFLAGS='-msoft-float' 157 $ ./aconfigure --host=arm-elf --disable-floating-point \ 158 --disable-sound \ 159 CFLAGS='-I/arm/arm-elf/include -msoft-float -D_POSIX_SOURCE' 122 160 $ make dep 123 161 $ make … … 131 169 You may get error about ''configure not being able to create executable'', and {{{config.log}}} reveals error message similar to: 132 170 133 '' ERROR: foo uses hardware FP, whereas bar uses software FP''171 ''"/arm/lib/gcc/arm-elf/3.4.6/../../../../arm-elf/bin/ld: ERROR: /arm/lib/gcc/arm-elf/3.4.6/crtn.o uses hardware FP, whereas a.out uses software FP"'' 134 172 135 I think, this error was caused by lack of {{{--with-float=soft}}} when configuring gcc.173 I '''think''', it's because gcc was compiled without {{{--with-fpu=-softfpa}}} and {{{--with-float=soft}}} options above. 136 174 175 === Conflicting Types === 137 176 177 Something like: 178 ''/arm/lib/gcc/arm-elf/3.4.6/../../../../arm-elf/include/linux/types.h:19: error: conflicting types for 'dev_t' '' 179 ''/arm/lib/gcc/arm-elf/3.4.6/../../../../arm-elf/include/sys/types.h:163: error: previous declaration of 'dev_t' was here'' 180 181 == References == 182 183 * [http://en.wikipedia.org/wiki/ARM_architecture ARM architecture (Wikipedia)] 184 * [http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html ARM cross-compiling howto - K's cluttered loft] 185 * [http://www.schnozzle.org/~coldwell/toolchain/ Building a GNU/Linux ARM Toolchain] 186 * [http://gcc.gnu.org/install/index.html Installing GCC]