Changes between Version 6 and Version 7 of ARM_QEMU


Ignore:
Timestamp:
Feb 5, 2008 8:40:41 PM (12 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ARM_QEMU

    v6 v7  
    3333Download latest toolchain: 
    3434 * binutils: http://ftp.gnu.org/gnu/binutils/ 
     35 * linux: http://www.kernel.org 
    3536 * gcc: http://ftp.gnu.org/gnu/gcc/ 
    3637 * newlib: ftp://sources.redhat.com/pub/newlib/index.html 
     
    4041  $ cd /arm/setup/download 
    4142  $ 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 
    4244  $ wget -c http://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2 
    4345  $ wget -c ftp://sources.redhat.com/pub/newlib/newlib-1.16.0.tar.gz 
     
    6264  $ cd /arm/setup/srcs 
    6365  $ tar xjf ../download/binutils-2.18.tar.bz2 
     66  $ tar xjf ../download/linux-2.6.24.tar.bz2 
    6467  $ tar xjf ../download/gcc-3.4.6.tar.bz2 
    6568  $ tar xzf ../download/newlib-1.16.0.tar.gz 
     
    8083''(if you're wondering, that will take 5 minutes on a Core2Duo 2GHz)'' 
    8184 
     85==== Prepare Linux Kernel Header Files ==== 
     86 
     87You 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 
     92or on RedHat: 
     93{{{ 
     94  $ yum install ncurses-devel 
     95}}} 
     96 
     97Configure 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 
     105We don't need need to build the kernel now. 
     106 
     107Now lets fix include directories: 
     108{{{ 
     109mkdir -p /arm/arm-elf/include 
     110cd /arm/arm-elf/include 
     111ln -sd /arm/setup/srcs/linux-2.6.24/include/asm-arm asm 
     112ln -sd /arm/setup/srcs/linux-2.6.24/include/linux linux 
     113cd .. 
     114ln -sd include sys-linux 
     115}}} 
     116 
    82117==== Update binutils Path ==== 
    83118 
     
    88123  $ export PATH=/arm/bin:$PATH 
    89124}}} 
     125 
    90126 
    91127 
     
    103139  $ cd /arm/setup/objs/gcc-arm 
    104140  $ ../../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=soft 
     141                                  --enable-languages=c,c++ \ 
     142                                   --disable-nls --with-newlib --disable-shared \ 
     143                                   --with-fpu=-softfpa --with-float=soft 
    108144  $ make 
    109145  $ make install 
     
    119155  $ cd /your/pjproject/directory 
    120156  $ 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' 
    122160  $ make dep 
    123161  $ make 
     
    131169You may get error about ''configure not being able to create executable'', and {{{config.log}}} reveals error message similar to: 
    132170 
    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"'' 
    134172 
    135 I think, this error was caused by lack of {{{--with-float=soft}}} when configuring gcc. 
     173I '''think''', it's because gcc was compiled without {{{--with-fpu=-softfpa}}} and {{{--with-float=soft}}} options above. 
    136174 
     175=== Conflicting Types === 
    137176 
     177Something 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]