# Cross gcc for M68K/Coldfire dedicated to the Rockbox Project # ============================================================= # Primary target is the iRiver iHp-xxx models which have a MCF 5249 Coldfire V2 # # Get sources: # ------------ # gcc-3.3.5.tar.bz2 # Yes, we know that there are newer versions of the compiler (3.4.3 when I'm writing this) # but the 3.3.x version creates much more compact code than 3.4.x, and that is crucial to # build the ROM version of Rockbox, otherwise it won't fit in the flash ROM. # Setup sources: # -------------- tar xvjf gcc-3.3.5.tar.bz2 tar xvzf newlib-1.12.0.tar.gz cd gcc-3.3.5 ln -s ../newlib-1.12.0/newlib . # Coldfire Patches: # ----------------- # http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/gcc-3/ patch -b -z.targets -p1 -i ../gcc-3.3.2-coldfire-targets.patch patch -b -z.frame -p1 -i ../gcc-3.3.2-coldfire-frame.patch patch -b -z.omitfrmptr -p1 -i ../gcc-3.3.2-coldfire-omitfrmptr.patch cd .. mv gcc-3.3.5 gcc-3.3.5-coldfire # Setup build environment: # ------------------------ mkdir -p build/m68k-elf/gcc cd build/m68k-elf/gcc/ # Configure for elf-m68k restricted to the coldfire CPU: # ------------------------------------------------------ # Warning: you must have the m68k-elf-binutils allready installed ! CFLAGS="-O4" ../../../gcc-3.3.5-coldfire/configure --prefix=/opt/m68k --target=m68k-elf --enable-languages=c --with-cpu=m5200 make # Compiling and linking a simple application: # # m68k-elf-gcc [-m5200] -o hello hello.c # # Compiling a source file: # # m68k-elf-gcc [-m5200] -c -o hello.o hello.c