This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:On Monday 19 October 2009 22:51:46 Allen Curtis wrote:[--SNIP--]I would like to build a toolchain for the Cortex M3. The sample
configurations include a Cortex A8. Is it as simple as changing the A8
references in .config to M3?If all goes well, you should set the following:
CT_ARCH_ARCH: armv7-m (I'm not so sure about that one, if it fails,
leave the field empty)
CT_ARCH_CPU : cortex-m3
CT_ARCH_TUNE: cortex-m3
OK, I just tested, it does not work. Error message is: cc1: error: target CPU does not support ARM mode
Both gcc and glibc complain, although the gcc build does not stop, and
happily goes on, even if the newly-built gcc is broken. Then glibc breaks
becasue the compiler does not support ARM mode...
So we have to find a way to convince gcc that indeed the target CPU is a
Cortex-M3, so that it is in THUMB2 mode (./configure --with- mode=thumb),
and then to convince glibc that, yes, the compiler is working (using
CT_LIBC_GLIBC_EXTRA_CFLAGS=-mthumb). Or something along the lines...
We'd also need to tweak off thumb-interworking: interworking is irelevant
as the CPU has no ARM mode, and therefore can not switch THUMB <-> ARM.
Well... It still breaks... I will look into that later, now is time to got to bed... In the meantime, dig the archives...
#!/bin/bash # # @brief Build cross compiler for ARM Cortex M3 processor # # Builds a bare-metal cross GNU toolchain targetting the ARM Cortex M3 # microprocessor in EABI mode and using the newlib embedded C library. # # @note The newlib C library is checked out from CVS, so for a # deterministic build you must fix this. I tested toolchains around # July 12th 2008. Also, it means the cvs checkout asks for a password; # use 'anoncvs'. # # @note This script overrides newlib's autoconf 2.59 version dependency # to 2.61. # # @version 2008-07-12 # @author Leon Woestenberg <leon@sidebranch.com> # @see http://www.sidebranch.com/ # @note This script was tested on a Ubuntu Linux 8.04 x86 host. # # @note You need to pre-install some Ubuntu packages on your host: # sudo apt-get install flex bison autoconf texinfo # and for GDB: # sudo apt-get install libncurses5-dev
#TOOLCHAIN_TARGET=arm-elf TOOLCHAIN_TARGET=arm-sidebranch-eabi
mkdir -p ${TOOLCHAIN_PATH} touch ${TOOLCHAIN_PATH}/need_write_access_here if [ ! ?$ -eq 0 ]; then echo "Need ${TOOLCHAIN_PATH} directory with write access." exit 1 fi rm -f ${TOOLCHAIN_PATH}/need_write_access_here
if [ ! -d ${DOWNLOAD_DIR} ]; then mkdir ${DOWNLOAD_DIR} fi
cd ${DOWNLOAD_DIR} if [ ! -f ${DOWNLOAD_DIR}/binutils-2.18.50.0.7.tar.bz2 ]; then wget http://www.kernel.org/pub/linux/devel/binutils/binutils-2.18.50.0.7.tar.bz2 fi if [ ! -f ${DOWNLOAD_DIR}/gdb-6.8.tar.bz2 ]; then wget http://ftp.gnu.org/pub/gnu/gdb/gdb-6.8.tar.bz2 fi if [ ! -f ${DOWNLOAD_DIR}/gcc-4.3.1.tar.bz2 ]; then wget http://ftp.gnu.org/pub/gnu/gcc/gcc-4.3.1/gcc-4.3.1.tar.bz2 fi if [ ! -f ${DOWNLOAD_DIR}/gmp-4.2.2.tar.bz2 ]; then wget http://ftp.sunet.se/pub/gnu/gmp/gmp-4.2.2.tar.bz2 fi if [ ! -f ${DOWNLOAD_DIR}/mpfr-2.3.1.tar.bz2 ]; then wget http://www.mpfr.org/mpfr-current/mpfr-2.3.1.tar.bz2 fi
cd ${CORTEX_TOPDIR} if [ ! -f .gcc-full ]; then cd gcc-4.3.1/build #make -j3 CFLAGS="-mcpu=cortex-m3 -mthumb" all 2>&1 | tee make-full.log make -j3 all 2>&1 | tee make-full.log make install 2>&1 | tee install-full.log cd ${CORTEX_TOPDIR} touch .gcc-full fi
cd ${CORTEX_TOPDIR} if [ ! -f .gdb ]; then rm -rf gdb-6.8 tar xjf ${DOWNLOAD_DIR}/gdb-6.8.tar.bz2 cd gdb-6.8 mkdir build cd build ../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} make -j3 2>&1 | tee make.log make install 2>&1 | tee install.log cd ${CORTEX_TOPDIR} touch .gdb fi
-- For unsubscribe information see http://sourceware.org/lists.html#faq
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |