building for Cortex M3

View: New views
20 Messages — Rating Filter:   Alert me  

building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

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?

Actually, I am a little surprised that this isn't a standard  
configuration considering the number of popular processor based on  
this processor.

Thanks
Allen


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Allen,
All,

On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
> 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?

The Cortex-M3 is a Thumb2-only processor. I'm not so sure how binutils, gcc
and the C libraries handle this case. Search the archives, there has been a
thread on the subject some time ago.

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

Do it within the 'menuconfig', it's easier than editing the .config file.

> Actually, I am a little surprised that this isn't a standard  
> configuration considering the number of popular processor based on  
> this processor.

As I have no way to test such a toolchain, I don't provide a sample for it.
If you manage to make it work, then I would be glad you submit your .config
for inclusion.

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Allen,
All,

On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
> > 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?
[--SNIP--]
> 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...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>> 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?
> [--SNIP--]
>> 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...
>

Well, in the archives there is a sample script file for building a  
Cortex-M3. I have a hardware platform to test the configuration.

#!/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@...>
# @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

set -e

CORTEX_TOPDIR=`pwd`

DOWNLOAD_DIR=${CORTEX_TOPDIR}/downloads

TOOLCHAIN_PATH=/opt/stm32

#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 .binutils ]; then
rm -rf binutils-2.18.50.0.7
tar xjf ${DOWNLOAD_DIR}/binutils-2.18.50.0.7.tar.bz2
cd binutils-2.18.50.0.7
mkdir build
cd build
../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} \
--enable-interwork --disable-multilib --with-gnu-as --with-gnu-ld --
disable-nls \
2>&1 | tee configure.log
make -j3 all 2>&1 | tee make.log
make install 2>&1 | tee install.log
cd $CORTEX_TOPDIR
touch .binutils
fi

export PATH=${TOOLCHAIN_PATH}/bin:$PATH

cd ${CORTEX_TOPDIR}
if [ ! -f .gcc ]; then
rm -rf gcc-4.3.1
tar xjf ${DOWNLOAD_DIR}/gcc-4.3.1.tar.bz2
cd gcc-4.3.1
tar xjf ${DOWNLOAD_DIR}/gmp-4.2.2.tar.bz2
tar xjf ${DOWNLOAD_DIR}/mpfr-2.3.1.tar.bz2
ln -snf gmp-4.2.2 gmp
ln -snf mpfr-2.3.1 mpfr
cd libstdc++-v3
# uncomment AC_LIBTOOL_DLOPEN
sed -i 's@^AC_LIBTOOL_DLOPEN.*@# AC_LIBTOOL_DLOPEN@' configure.ac
autoconf
cd ..
mkdir build
cd build
../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} \
--with-cpu=cortex-m3 --with-mode=thumb \
--enable-interwork --disable-multilib \
--enable-languages="c,c++" --with-newlib --without-headers \
--disable-shared --with-gnu-as --with-gnu-ld \
2>&1 | tee configure.log
make -j3 all-gcc 2>&1 | tee make.log
make install-gcc 2>&1 | tee install.log
cd ${TOOLCHAIN_PATH}/bin
# hack: newlib argz build needs arm-*-{eabi|elf}-cc, not arm-*-{eabi|
elf}-gcc
ln -snf ${TOOLCHAIN_TARGET}-gcc ${TOOLCHAIN_TARGET}-cc
cd ${CORTEX_TOPDIR}
touch .gcc
fi

cd ${CORTEX_TOPDIR}
if [ ! -f .newlib ]; then
rm -rf newlib
mkdir newlib
cd newlib
cvs -z 9 -d :pserver:anoncvs@...:/cvs/src login
cvs -z 9 -d :pserver:anoncvs@...:/cvs/src co newlib
cd src
# hack: disable libgloss for the target, presumably not buildable for  
armv7t
# (this no longer seems necessary with latest newlib snapshots,  
commented out)
#sed -i 's@.*noconfigdirs=\"\$noconfigdirs target-libffi target-
qthreads\".*@noconfigdirs="\$noconfigdirs target-libffi target-
qthreads target-libgloss\"@' \
#configure.ac
# hack: allow autoconf version 2.61 instead of 2.59
sed -i 's@\(.*_GCC_AUTOCONF_VERSION.*\)2.59\(.*\)@\12.61\2@' config/
override.m4
autoconf
mkdir build
cd build
# note: this needs arm-*-{eabi|elf}-cc to exist or link to arm-*-{eabi|
elf}-gcc
../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} \
--enable-interwork \
--disable-newlib-supplied-syscalls --with-gnu-ld --with-gnu-as --
disable-shared \
2>&1 | tee configure.log

#make -j3 CFLAGS_FOR_TARGET="-ffunction-sections -fdata-sections -
DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -Os -fomit-frame-pointer -
mcpu=cortex-m3 -mthumb -D__thumb2__ -D__BUFSIZ__=256" \
#CCASFLAGS="-mcpu=cortex-m3 -mthumb -D__thumb2__" \
make -j3 CFLAGS_FOR_TARGET="-ffunction-sections -fdata-sections -
DPREFER_SIZE_OVER_SPEED -D__OPTIMIZE_SIZE__ -Os -fomit-frame-pointer -
D__BUFSIZ__=256" \
2>&1 | tee make.log
make install 2>&1 | tee install.log
cd ${CORTEX_TOPDIR}
touch .newlib
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


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>> 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?
> [--SNIP--]
>> 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
>

I have gotten past these problems.

[INFO ]  
=================================================================
[INFO ]  Installing C library headers
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[INFO ]  Installing C library headers: done in 31.49s (at 08:11)
[INFO ]  
=================================================================
[INFO ]  Installing C library start files
[EXTRA]    Configuring C library
[WARN ]    Removing "-pipe" for use with glibc>=2.6
[EXTRA]    Building C library start files
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o] Error 1
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/libc-start.o] Error 1
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ERROR]    Build failed in step 'Installing C library start files'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/build/libc/glibc.sh' at line # 341 in function  
'do_libc_start_files'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/crosstool-NG.sh' at line # 544 in function 'main'
[ERROR]    Look at '/home/acurtis/x-tools/arm-cortex_m3-linux-gnueabi/
build.log' for more info on this error.
[ERROR]  (elapsed: 8:32.47)
[08:33] / make: *** [build] Error 2

> 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...
>

Here is my configuration file.

#
# Automatically generated make config: don't edit
# crosstool-NG version: hg_default@1562_fdf936326ccd
# Sun Oct  4 12:44:11 2009
#

#
# Paths and misc options
#

#
# crosstool-NG behavior
#
# CT_OBSOLETE is not set
CT_EXPERIMENTAL=y
# CT_DEBUG_CT is not set

#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${HOME}/src"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
CT_INSTALL_DIR="${CT_PREFIX_DIR}"
CT_REMOVE_DOCS=y
CT_INSTALL_DIR_RO=y

#
# Downloading
#
# CT_FORBID_DOWNLOAD is not set
# CT_FORCE_DOWNLOAD is not set
# CT_USE_MIRROR is not set
CT_CONNECT_TIMEOUT=10
# CT_ONLY_DOWNLOAD is not set

#
# Extracting
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
CT_PATCH_BUNDLED=y
# CT_PATCH_LOCAL is not set
# CT_PATCH_BUNDLED_LOCAL is not set
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
CT_PATCH_ORDER="bundled"
# CT_PATCH_SINGLE is not set
# CT_PATCH_USE_LOCAL is not set

#
# Build behavior
#
CT_PARALLEL_JOBS=4
CT_LOAD=0
CT_NICE=0
CT_USE_PIPES=y
# CT_CONFIG_SHELL_SH is not set
# CT_CONFIG_SHELL_ASH is not set
CT_CONFIG_SHELL_BASH=y
# CT_CONFIG_SHELL_CUSTOM is not set
CT_CONFIG_SHELL="bash"

#
# Logging
#
# CT_LOG_ERROR is not set
# CT_LOG_WARN is not set
# CT_LOG_INFO is not set
CT_LOG_EXTRA=y
# CT_LOG_DEBUG is not set
# CT_LOG_SEE_TOOLS_WARN is not set
CT_LOG_PROGRESS_BAR=y
CT_LOG_TO_FILE=y
CT_LOG_FILE_COMPRESS=y

#
# Target options
#
CT_ARCH="arm"
# CT_ARCH_64 is not set
# CT_ARCH_SUPPORTS_BOTH_MMU is not set
CT_ARCH_SUPPORTS_BOTH_ENDIAN=y
CT_ARCH_SUPPORT_ARCH=y
# CT_ARCH_SUPPORT_ABI is not set
CT_ARCH_SUPPORT_CPU=y
CT_ARCH_SUPPORT_TUNE=y
CT_ARCH_SUPPORT_FPU=y
# CT_ARCH_DEFAULT_HAS_MMU is not set
# CT_ARCH_DEFAULT_BE is not set
CT_ARCH_DEFAULT_LE=y
CT_ARCH_ARCH="armv7-m"
CT_ARCH_CPU="cortex-m3"
CT_ARCH_TUNE="cortex-m3"
CT_ARCH_FPU=""
# CT_ARCH_BE is not set
CT_ARCH_LE=y
# CT_ARCH_FLOAT_HW is not set
CT_ARCH_FLOAT_SW=y
CT_TARGET_CFLAGS=""
CT_TARGET_LDFLAGS=""

#
# General target options
#
# CT_ARCH_alpha is not set
CT_ARCH_arm=y
# CT_ARCH_avr32 is not set
# CT_ARCH_ia64 is not set
# CT_ARCH_mips is not set
# CT_ARCH_powerpc is not set
# CT_ARCH_powerpc64 is not set
# CT_ARCH_sh is not set
# CT_ARCH_x86 is not set
# CT_ARCH_x86_64 is not set
CT_ARCH_ARM_EABI=y
CT_ARCH_USE_MMU=y

#
# Target optimisations
#

#
# Toolchain options
#

#
# General toolchain options
#
CT_USE_SYSROOT=y
CT_SYSROOT_DIR_PREFIX=""

#
# Tuple completion and aliasing
#
CT_TARGET_VENDOR="cortex_m3"
CT_TARGET_ALIAS_SED_EXPR=""
CT_TARGET_ALIAS=""

#
# Toolchain type
#
# CT_NATIVE is not set
CT_CROSS=y
# CT_CROSS_NATIVE is not set
# CT_CANADIAN is not set
CT_TOOLCHAIN_TYPE="cross"

#
# Build system
#
CT_BUILD=""
CT_BUILD_PREFIX=""
CT_BUILD_SUFFIX=""

#
# Operating System
#
# CT_BARE_METAL is not set
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="2.6.31.1"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_LINUX_INSTALL=y
CT_KERNEL_LINUX_INSTALL_CHECK=y
CT_KERNEL_V_2_6_31_1=y
# CT_KERNEL_V_2_6_31 is not set
# CT_KERNEL_V_3_6_30_8 is not set
# CT_KERNEL_V_3_6_30_7 is not set
# CT_KERNEL_V_2_6_30_6 is not set
# CT_KERNEL_V_2_6_30_5 is not set
# CT_KERNEL_V_2_6_30_4 is not set
# CT_KERNEL_V_2_6_30_3 is not set
# CT_KERNEL_V_2_6_30_2 is not set
# CT_KERNEL_V_2_6_30_1 is not set
# CT_KERNEL_V_2_6_30 is not set
# CT_KERNEL_V_2_6_29_6 is not set
# CT_KERNEL_V_2_6_28_10 is not set
# CT_KERNEL_V_2_6_27_35 is not set
# CT_KERNEL_V_2_6_26_8 is not set
# CT_KERNEL_V_2_6_25_20 is not set
# CT_KERNEL_V_2_6_24_7 is not set
# CT_KERNEL_V_2_6_23_17 is not set
# CT_KERNEL_V_2_6_22_19 is not set
# CT_KERNEL_V_2_6_21_7 is not set
# CT_KERNEL_V_2_6_20_21 is not set
# CT_KERNEL_V_2_6_19_7 is not set
# CT_KERNEL_V_2_6_18_8 is not set
# CT_KERNEL_V_select is not set
CT_KERNEL_LINUX_VERBOSITY_0=y
# CT_KERNEL_LINUX_VERBOSITY_1 is not set
# CT_KERNEL_LINUX_VERBOSITY_2 is not set
CT_KERNEL_LINUX_VERBOSE_LEVEL=0
# CT_KERNEL_LINUX_USE_CUSTOM_HEADERS is not set

#
# Common kernel options
#
CT_SHARED_LIBS=y

#
# Binary utilities
#
CT_ARCH_BINFMT_ELF=y
# CT_ARCH_BINFMT_FLAT is not set

#
# GNU binutils
#
CT_BINUTILS_VERSION="2.19.1"
# CT_BINUTILS_V_2_19_51_0_2 is not set
# CT_BINUTILS_V_2_19_51_0_1 is not set
# CT_BINUTILS_V_2_19_50_0_1 is not set
CT_BINUTILS_V_2_19_1=y
# CT_BINUTILS_V_2_19 is not set
# CT_BINUTILS_V_2_18_93 is not set
# CT_BINUTILS_V_2_18_92 is not set
# CT_BINUTILS_V_2_18_91 is not set
# CT_BINUTILS_V_2_18_90 is not set
# CT_BINUTILS_V_2_18_50_0_9 is not set
# CT_BINUTILS_V_2_18_50_0_8 is not set
# CT_BINUTILS_V_2_18_50_0_7 is not set
# CT_BINUTILS_V_2_18_50_0_6 is not set
# CT_BINUTILS_V_2_18_50_0_4 is not set
# CT_BINUTILS_V_2_18 is not set
# CT_BINUTILS_V_2_17 is not set
# CT_BINUTILS_V_2_16_1 is not set
# CT_BINUTILS_V_2_15 is not set
# CT_BINUTILS_V_2_14 is not set
CT_BINUTILS_EXTRA_CONFIG=""
CT_BINUTILS_FOR_TARGET=y
CT_BINUTILS_FOR_TARGET_IBERTY=y
CT_BINUTILS_FOR_TARGET_BFD=y

#
# C compiler
#
CT_CC="gcc"
CT_CC_VERSION="4.4.0"
CT_CC_gcc=y
# CT_CC_V_4_4_1 is not set
CT_CC_V_4_4_0=y
# CT_CC_V_4_3_4 is not set
# CT_CC_V_4_3_3 is not set
# CT_CC_V_4_3_2 is not set
# CT_CC_V_4_3_1 is not set
# CT_CC_V_4_3_0 is not set
# CT_CC_V_4_2_4 is not set
# CT_CC_V_4_2_3 is not set
# CT_CC_V_4_2_2 is not set
# CT_CC_V_4_2_1 is not set
# CT_CC_V_4_2_0 is not set
# CT_CC_V_4_1_2 is not set
# CT_CC_V_4_1_1 is not set
# CT_CC_V_4_1_0 is not set
# CT_CC_V_4_0_4 is not set
# CT_CC_V_4_0_3 is not set
# CT_CC_V_4_0_2 is not set
# CT_CC_V_4_0_1 is not set
# CT_CC_V_4_0_0 is not set
# CT_CC_V_3_4_6 is not set
# CT_CC_V_3_3_6 is not set
# CT_CC_V_3_2_3 is not set
CT_CC_GCC_4_3_or_later=y
CT_CC_GCC_4_4_or_later=y
CT_CC_CXA_ATEXIT=y
CT_CC_SJLJ_EXCEPTIONS_CONFIGURE=y
# CT_CC_SJLJ_EXCEPTIONS_USE is not set
# CT_CC_SJLJ_EXCEPTIONS_DONT_USE is not set
CT_CC_ENABLE_CXX_FLAGS=""
CT_CC_CORE_EXTRA_CONFIG="--with-mode=thumb"
CT_CC_EXTRA_CONFIG="-mthumb"
CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
CT_CC_BUGURL=""
CT_CC_SUPPORT_CXX=y
CT_CC_SUPPORT_FORTRAN=y
CT_CC_SUPPORT_JAVA=y
CT_CC_SUPPORT_ADA=y
CT_CC_SUPPORT_OBJC=y
CT_CC_SUPPORT_OBJCXX=y

#
# Additional supported languages:
#
CT_CC_LANG_CXX=y
# CT_CC_LANG_FORTRAN is not set
# CT_CC_LANG_JAVA is not set
# CT_CC_LANG_ADA is not set
# CT_CC_LANG_OBJC is not set
# CT_CC_LANG_OBJCXX is not set
CT_CC_LANG_OTHERS=""
CT_LIBC="glibc"

#
# C-library
#
CT_LIBC_VERSION="2.9"
# CT_LIBC_eglibc is not set
CT_LIBC_glibc=y
# CT_LIBC_newlib is not set
# CT_LIBC_uClibc is not set
CT_LIBC_V_2_9=y
# CT_LIBC_V_2_8 is not set
# CT_LIBC_V_2_7 is not set
# CT_LIBC_V_2_6_1 is not set
# CT_LIBC_V_2_6 is not set
# CT_LIBC_V_2_5_1 is not set
# CT_LIBC_V_2_5 is not set
# CT_LIBC_V_2_3_6 is not set
CT_LIBC_GLIBC_2_8_or_later=y
# CT_LIBC_GLIBC_TARBALL is not set
CT_LIBC_GLIBC_CVS=y
CT_LIBC_GLIBC_CVS_date="2009-05-27"

#
# glibc/eglibc common options
#
CT_LIBC_GLIBC_EXTRA_CONFIG=""
CT_LIBC_GLIBC_CONFIGPARMS=""
CT_LIBC_GLIBC_EXTRA_CFLAGS=""
CT_LIBC_EXTRA_CC_ARGS=""
CT_LIBC_GLIBC_USE_PORTS=y
CT_LIBC_ADDONS_LIST=""

#
# WARNING!!!
#

#
# For glibc >= 2.8, addons are only available via a CVS checkout.
#

#
# Be sure to review the associated options, above.
#
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
CT_LIBC_GLIBC_MIN_KERNEL="2.6.31.1"

#
# Common C library options
#
CT_LIBC_SUPPORT_NPTL=y
CT_LIBC_SUPPORT_LINUXTHREADS=y
CT_THREADS="nptl"
CT_THREADS_NPTL=y
# CT_THREADS_LINUXTHREADS is not set
# CT_THREADS_NONE is not set

#
# Debug facilities
#
CT_DEBUG_dmalloc=y
CT_DMALLOC_V_5_5_2=y
# CT_DMALLOC_V_5_4_3 is not set
CT_DMALLOC_VERSION="5.5.2"
CT_DEBUG_duma=y
CT_DUMA_A=y
CT_DUMA_SO=y
CT_DUMA_V_2_5_15=y
# CT_DUMA_V_2_5_14 is not set
# CT_DUMA_V_2_5_12 is not set
# CT_DUMA_V_2_5_8 is not set
# CT_DUMA_V_2_5_1 is not set
CT_DUMA_VERSION="2_5_15"
CT_DEBUG_gdb=y
CT_GDB_CROSS=y
# CT_GDB_CROSS_STATIC is not set
CT_GDB_NATIVE=y
# CT_GDB_NATIVE_STATIC is not set
CT_GDB_NATIVE_USE_GMP_MPFR=y
CT_GDB_GDBSERVER=y
CT_GDB_GDBSERVER_STATIC=y
CT_GDB_V_6_8=y
# CT_GDB_V_6_7_1 is not set
# CT_GDB_V_6_7 is not set
# CT_GDB_V_6_6 is not set
# CT_GDB_V_6_5 is not set
# CT_GDB_V_6_4 is not set
# CT_GDB_V_snapshot is not set
CT_GDB_VERSION="6.8"

#
# Native gdb needs a native ncurses library
#
CT_NCURSES_V_5_7=y
# CT_NCURSES_V_5_6 is not set
CT_NCURSES_VERSION="5.7"
CT_DEBUG_ltrace=y
CT_LTRACE_V_0_5_2=y
# CT_LTRACE_V_0_5_1 is not set
# CT_LTRACE_V_0_5 is not set
# CT_LTRACE_V_0_4 is not set
CT_LTRACE_VERSION="0.5.2"
CT_DEBUG_strace=y
CT_STRACE_V_4_5_18=y
# CT_STRACE_V_4_5_17 is not set
# CT_STRACE_V_4_5_16 is not set
# CT_STRACE_V_4_5_15 is not set
# CT_STRACE_V_4_5_14 is not set
# CT_STRACE_V_4_5 is not set
CT_STRACE_VERSION="4.5.18"

#
# Tools facilities
#
CT_TOOL_libelf=y
# CT_LIBELF_V_0_8_12 is not set
CT_LIBELF_V_0_8_11=y
# CT_LIBELF_V_0_8_10 is not set
CT_LIBELF_VERSION="0.8.11"
CT_TOOL_sstrip=y
CT_SSTRIP_BUILDROOT=y
# CT_SSTRIP_ELFKICKERS is not set
CT_SSTRIP_FROM="buildroot"

#
# Companion libraries
#
CT_WRAPPER_NEEDED=y
CT_GMP_MPFR=y
CT_GMP_V_4_3_1=y
# CT_GMP_V_4_3_0 is not set
# CT_GMP_V_4_2_4 is not set
# CT_GMP_V_4_2_2 is not set
CT_GMP_VERSION="4.3.1"
CT_MPFR_V_2_4_1=y
# CT_MPFR_V_2_4_0 is not set
# CT_MPFR_V_2_3_2 is not set
# CT_MPFR_V_2_3_1 is not set
CT_MPFR_VERSION="2.4.1"
CT_PPL_CLOOG_MPC=y
CT_PPL_V_0_10_2=y
CT_PPL_VERSION="0.10.2"
CT_CLOOG_V_0_15_7=y
# CT_CLOOG_V_0_15_6 is not set
# CT_CLOOG_V_0_15_5 is not set
# CT_CLOOG_V_0_15_4 is not set
# CT_CLOOG_V_0_15_3 is not set
CT_CLOOG_VERSION="0.15.7"
CT_MPC_V_0_7=y
# CT_MPC_V_0_6 is not set
CT_MPC_VERSION="0.7"

#
# Companion libraries common options
#
# CT_COMP_LIBS_CHECK is not set
CT_COMP_LIBS_TARGET=y
CT_TOOLS_WRAPPER_SCRIPT=y
# CT_TOOLS_WRAPPER_EXEC is not set
CT_TOOLS_WRAPPER="script"


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Allen,
> All,
>
> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>> 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?
> [--SNIP--]
>> 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
>

I removed CT_ARCH_ARCH="armv7-m" and left the CPU and TUNE options.  
This fixed the previous compile problem.

Here is the latest error:

[ALL  ]    /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/
build/gcc-core-static/bin/arm-cortex_m3-linux-gnueabi-gcc      
version.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-
strings -fmerge-all-constants -mcpu=cortex-m3 -mlittle-endian -msoft-
float -mtune=cortex-m3 -Wstrict-prototypes      -I../include -I/home/
acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-
startfiles/csu -I/home/acurtis/work/targets/arm-cortex_m3-linux-
gnueabi/build/build-libc-startfiles -I../ports/sysdeps/arm/elf -I../
ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../ports/sysdeps/unix/
sysv/linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../
ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -
I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/
sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/
unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/
sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -
I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/
unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi -
I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/
wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -
I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../
nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/acurtis/
work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/
arm-cortex_m3-linux-gnueabi/4.4.0/include -isystem /home/acurtis/work/
targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-
cortex_m3-linux-gnueabi/4.4.0/include-fixed -isystem /home/acurtis/x-
tools/arm-cortex_m3-linux-gnueabi/arm-cortex_m3-linux-gnueabi//sys-
root/usr/include -D_LIBC_REENTRANT -include ../include/libc-
symbols.h        -DHAVE_INITFINI -o /home/acurtis/work/targets/arm-
cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o -MD -
MP -MF /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/
build-libc-startfiles/csu/version.o.dt -MT /home/acurtis/work/targets/
arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S: Assembler messages:
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:51: Error: lo register  
required -- `sub pc,r0,#31'
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:54: Error: invalid base  
register for register offset -- `ldr r2,[pc,r2]'
[ALL  ]    ../ports/sysdeps/unix/arm/sysdep.S:56: Error: unshifted  
register required -- `mvn r0,#0'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    /tmp/ccz4hkoK.s: Assembler messages:
[ALL  ]    /tmp/ccz4hkoK.s:152: Error: only SUBS PC, LR, #const  
allowed -- `add pc,r3,#(0xffff0fc0-0xffff0fff)'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/libc-start.o] Error 1
[ALL  ]    make[3]: Leaving directory `/home/acurtis/work/targets/src/
glibc-cvs-2.9/csu'
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[2]: Leaving directory `/home/acurtis/work/targets/src/
glibc-cvs-2.9'
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[1]: Leaving directory `/home/acurtis/work/targets/arm-
cortex_m3-linux-gnueabi/build/build-libc-startfiles'
[ERROR]    Build failed in step 'Installing C library start files'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/build/libc/glibc.sh' at line # 341 in function  
'do_libc_start_files'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/crosstool-NG.sh' at line # 544 in function 'main'
[ERROR]    Look at '/home/acurtis/x-tools/arm-cortex_m3-linux-gnueabi/
build.log' for more info on this error.
[ERROR]  (elapsed: 8:30.46)

I did some Googling and couldn't find anything that addressed this  
issue. If you do, let me know how to be more effective with the  
searches.

Thanks
Allen

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Marc Kleine-Budde :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yann E. MORIN wrote:

> Allen,
> All,
>
> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>> 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?
>
> The Cortex-M3 is a Thumb2-only processor. I'm not so sure how binutils, gcc
> and the C libraries handle this case. Search the archives, there has been a
> thread on the subject some time ago.
>
> 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

the cortex-m3 is a MMU-less CPU, you probably want to use newlib with it.

cheers, Marc

- --
Pengutronix e.K.                         | Marc Kleine-Budde           |
Linux Solutions for Science and Industry | Phone: +49-231-2826-924     |
Vertretung West/Dortmund                 | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686         | http://www.pengutronix.de   |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrdcY8ACgkQjTAFq1RaXHOQOwCfYwJZI8/IwgdDANzlCEGTF8uw
JPgAnj9Ax3S9GB+OdUG/KMozUe8iKoJA
=PDsO
-----END PGP SIGNATURE-----

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Leon Woestenberg-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Allen, Yann and all,

On Tue, Oct 20, 2009 at 12:43 AM, Allen Curtis
<ajcurtis@...> wrote:

>> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>>> I would like to build a toolchain for the Cortex M3. The sample
>
> Well, in the archives there is a sample script file for building a
> Cortex-M3. I have a hardware platform to test the configuration.
>
> # @brief Build cross compiler for ARM Cortex M3 processor
> # @version 2008-07-12
> # @author Leon Woestenberg <leon@...>
> # @see http://www.sidebranch.com/
> # @note This script was tested on a Ubuntu Linux 8.04 x86 host.

My script (above) has been updated in the mean-time, to deal with
changes on more modern host GCC compilers that recently got updated in
Ubuntu 9.04.

I never got around to merge it into crossgcc-ng.

I'll try to remember to post an updated script, but please email me if
I forget and you could use it.

Regards,
--
Leon

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Yann,

>
> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>> 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?
> [--SNIP--]
>> 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...
>

Well, I took a shot on the glibc build problem and added -mthumb to  
the CFLAGS. It got past that problem and on to another in the same file.

[ALL  ]    /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/
build/gcc-core-static/bin/arm-cortex_m3-linux-gnueabi-gcc      
version.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline -Wwrite-
strings -fmerge-all-constants -mcpu=cortex-m3 -mlittle-endian -msoft-
float -mthumb -mtune=cortex-m3 -Wstrict-prototypes      -I../include -
I/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-
libc-startfiles/csu -I/home/acurtis/work/targets/arm-cortex_m3-linux-
gnueabi/build/build-libc-startfiles -I../ports/sysdeps/arm/elf -I../
ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../ports/sysdeps/unix/
sysv/linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../
ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -
I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/
sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/
unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/
sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -
I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/
unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi -
I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/
wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -
I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../
nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/acurtis/
work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/
arm-cortex_m3-linux-gnueabi/4.4.0/include -isystem /home/acurtis/work/
targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-
cortex_m3-linux-gnueabi/4.4.0/include-fixed -isystem /home/acurtis/x-
tools/arm-cortex_m3-linux-gnueabi/arm-cortex_m3-linux-gnueabi//sys-
root/usr/include -D_LIBC_REENTRANT -include ../include/libc-
symbols.h        -DHAVE_INITFINI -o /home/acurtis/work/targets/arm-
cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o -MD -
MP -MF /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/
build-libc-startfiles/csu/version.o.dt -MT /home/acurtis/work/targets/
arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    /tmp/ccXKHoQe.s: Assembler messages:
[ALL  ]    /tmp/ccXKHoQe.s:152: Error: only SUBS PC, LR, #const  
allowed -- `add pc,r3,#(0xffff0fc0-0xffff0fff)'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/libc-start.o] Error 1
[ALL  ]    make[3]: Leaving directory `/home/acurtis/work/targets/src/
glibc-cvs-2.9/csu'
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[2]: Leaving directory `/home/acurtis/work/targets/src/
glibc-cvs-2.9'
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[1]: Leaving directory `/home/acurtis/work/targets/arm-
cortex_m3-linux-gnueabi/build/build-libc-startfiles'
[ERROR]    Build failed in step 'Installing C library start files'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/build/libc/glibc.sh' at line # 341 in function  
'do_libc_start_files'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/crosstool-NG.sh' at line # 544 in function 'main'

Any Ideas???

- Allen

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Bugzilla from raj.khem@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 20, 2009 at 9:47 AM, Allen Curtis
<ajcurtis@...> wrote:

> Hello Yann,
>
>>
>> On Monday 19 October 2009 23:10:11 Yann E. MORIN wrote:
>>>
>>> On Monday 19 October 2009 22:51:46 Allen Curtis wrote:
>>>>
>>>> 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?
>>
>> [--SNIP--]
>>>
>>> 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...
>>
>
> Well, I took a shot on the glibc build problem and added -mthumb to the
> CFLAGS. It got past that problem and on to another in the same file.
>
> [ALL  ]
>  /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/bin/arm-cortex_m3-linux-gnueabi-gcc
>     version.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline
> -Wwrite-strings -fmerge-all-constants -mcpu=cortex-m3 -mlittle-endian
> -msoft-float -mthumb -mtune=cortex-m3 -Wstrict-prototypes      -I../include
> -I/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu
> -I/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles
> -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/eabi/nptl
> -I../ports/sysdeps/unix/sysv/linux/arm/eabi
> -I../ports/sysdeps/unix/sysv/linux/arm/nptl
> -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux
> -I../nptl/sysdeps/pthread -I../sysdeps/pthread
> -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux
> -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman
> -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv
> -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv
> -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix
> -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/eabi
> -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32
> -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754
> -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I..
> -I../libio -I. -nostdinc -isystem
> /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-cortex_m3-linux-gnueabi/4.4.0/include
> -isystem
> /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-cortex_m3-linux-gnueabi/4.4.0/include-fixed
> -isystem
> /home/acurtis/x-tools/arm-cortex_m3-linux-gnueabi/arm-cortex_m3-linux-gnueabi//sys-root/usr/include
> -D_LIBC_REENTRANT -include ../include/libc-symbols.h        -DHAVE_INITFINI
> -o
> /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o
> -MD -MP -MF
> /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o.dt
> -MT
> /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/version.o
> [ERROR]    make[3]: ***
> [/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o]
> Error 1
> [ALL  ]    make[3]: *** Waiting for unfinished jobs....
> [ALL  ]    /tmp/ccXKHoQe.s: Assembler messages:
> [ALL  ]    /tmp/ccXKHoQe.s:152: Error: only SUBS PC, LR, #const allowed --
> `add pc,r3,#(0xffff0fc0-0xffff0fff)'
> [ERROR]    make[3]: ***
> [/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/libc-start.o]
> Error 1
> [ALL  ]    make[3]: Leaving directory
> `/home/acurtis/work/targets/src/glibc-cvs-2.9/csu'
> [ERROR]    make[2]: *** [csu/subdir_lib] Error 2
> [ALL  ]    make[2]: Leaving directory
> `/home/acurtis/work/targets/src/glibc-cvs-2.9'
> [ERROR]    make[1]: *** [csu/subdir_lib] Error 2
> [ALL  ]    make[1]: Leaving directory
> `/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles'
> [ERROR]    Build failed in step 'Installing C library start files'
> [ERROR]    Error happened in
> '/opt/crosstool-ng/lib/ct-ng-1.5.0/scripts/functions' in function
> 'CT_DoExecLog' (line unknown, sorry)
> [ERROR]          called from
> '/opt/crosstool-ng/lib/ct-ng-1.5.0/scripts/build/libc/glibc.sh' at line #
> 341 in function 'do_libc_start_files'
> [ERROR]          called from
> '/opt/crosstool-ng/lib/ct-ng-1.5.0/scripts/crosstool-NG.sh' at line # 544 in
> function 'main'
>
> Any Ideas???

try eglibc. It compiles and works when compiled in pure thumb2. I am
not sure about glibc.

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>>
>>> [--SNIP--]
>>>>
>>>> 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...
>>>
>>
>> Well, I took a shot on the glibc build problem and added -mthumb to  
>> the
>> CFLAGS. It got past that problem and on to another in the same file.
>>
>

--SNIP--

> try eglibc. It compiles and works when compiled in pure thumb2. I am
> not sure about glibc.

Perhaps this is still a compiler issue? eglibc fails in the same manor.

[ALL  ]    /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/
build/gcc-core-static/bin/arm-cortex_m3-linux-gnueabi-gcc ../eglibc-
ports-2_10/sysdeps/unix/sysv/linux/arm/sysdep.S -c  -I../include -I/
home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/build-libc-
startfiles/csu -I/home/acurtis/work/targets/arm-cortex_m3-linux-
gnueabi/build/build-libc-startfiles -I../eglibc-ports-2_10/sysdeps/arm/
elf -I../ports/sysdeps/arm/elf -I../eglibc-ports-2_10/sysdeps/unix/
sysv/linux/arm/eabi/nptl -I../eglibc-ports-2_10/sysdeps/unix/sysv/
linux/arm/eabi -I../ports/sysdeps/unix/sysv/linux/arm/eabi/nptl -I../
ports/sysdeps/unix/sysv/linux/arm/eabi -I../eglibc-ports-2_10/sysdeps/
unix/sysv/linux/arm/nptl -I../eglibc-ports-2_10/sysdeps/unix/sysv/
linux/arm -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/
sysdeps/unix/sysv/linux/arm -I../eglibc-ports-2_10/sysdeps/unix/sysv/
linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../
sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/
sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/
mman -I../sysdeps/unix/inet -I../eglibc-ports-2_10/sysdeps/unix/sysv -
I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/
unix/sysv -I../eglibc-ports-2_10/sysdeps/unix/arm -I../ports/sysdeps/
unix/arm -I../eglibc-ports-2_10/sysdeps/unix -I../nptl/sysdeps/unix -
I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../
eglibc-ports-2_10/sysdeps/arm/eabi -I../ports/sysdeps/arm/eabi -I../
eglibc-ports-2_10/sysdeps/arm/fpu -I../ports/sysdeps/arm/fpu -I../
eglibc-ports-2_10/sysdeps/arm/nptl -I../eglibc-ports-2_10/sysdeps/arm -
I../sysdeps/wordsize-32 -I../sysdeps/ie
ee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../ports/sysdeps/arm/nptl -
I../ports/sysdeps/arm -I../sysdeps/ieee754 -I../sysdeps/generic/elf -
I../sysdeps/generic
-I../eglibc-ports-2_10 -I../nptl -I../ports  -I.. -I../libio -I. -
nostdinc -isystem /home/acurtis/work/targets/arm-cortex_m3-linux-
gnueabi/build/gcc-core-stati
c/lib/gcc/arm-cortex_m3-linux-gnueabi/4.4.0/include -isystem /home/
acurtis/work/targets/arm-cortex_m3-linux-gnueabi/build/gcc-core-static/
lib/gcc/arm-cortex_m3
-linux-gnueabi/4.4.0/include-fixed -isystem /home/acurtis/x-tools/arm-
cortex_m3-linux-gnueabi/arm-cortex_m3-linux-gnueabi//sys-root/usr/
include -D_LIBC_REENTRA
NT -include ../include/libc-symbols.h       -DHAVE_INITFINI -
DASSEMBLER  -I/home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/
build/build-libc-startfiles/c
su/.  -Wa,--noexecstack   -o /home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o -MD -MP -MF /
home/acurtis/work/tar
gets/arm-cortex_m3-linux-gnueabi/build/build-libc-startfiles/csu/
sysdep.o.dt -MT /home/acurtis/work/targets/arm-cortex_m3-linux-gnueabi/
build/build-libc-startf
iles/csu/sysdep.o
[ALL  ]    ../eglibc-ports-2_10/sysdeps/unix/arm/sysdep.S: Assembler  
messages:
[ALL  ]    ../eglibc-ports-2_10/sysdeps/unix/arm/sysdep.S:51: Error:  
lo register required -- `sub pc,r0,#31'
[ALL  ]    ../eglibc-ports-2_10/sysdeps/unix/arm/sysdep.S:54: Error:  
invalid base register for register offset -- `ldr r2,[pc,r2]'
[ALL  ]    ../eglibc-ports-2_10/sysdeps/unix/arm/sysdep.S:56: Error:  
unshifted register required -- `mvn r0,#0'
[ERROR]    make[3]: *** [/home/acurtis/work/targets/arm-cortex_m3-
linux-gnueabi/build/build-libc-startfiles/csu/sysdep.o] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    make[3]: Leaving directory `/home/acurtis/work/targets/src/
eglibc-2_10/csu'
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[2]: Leaving directory `/home/acurtis/work/targets/src/
eglibc-2_10'
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ALL  ]    make[1]: Leaving directory `/home/acurtis/work/targets/arm-
cortex_m3-linux-gnueabi/build/build-libc-startfiles'
[ERROR]    Build failed in step 'Installing C library headers / start  
files'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/build/libc/eglibc.sh' at line # 188 in function  
'do_libc_start_files'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.5.0/
scripts/crosstool-NG.sh' at line # 544 in function 'main'


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leon, Allen,
All,

On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:

> On Tue, Oct 20, 2009 at 12:43 AM, Allen Curtis
> <ajcurtis@...> wrote:
> > Well, in the archives there is a sample script file for building a
> > Cortex-M3. I have a hardware platform to test the configuration.
> > # @brief Build cross compiler for ARM Cortex M3 processor
> > # @version 2008-07-12
> > # @author Leon Woestenberg <leon@...>
> > # @see http://www.sidebranch.com/
> > # @note This script was tested on a Ubuntu Linux 8.04 x86 host.
> My script (above) has been updated in the mean-time, to deal with
> changes on more modern host GCC compilers that recently got updated in
> Ubuntu 9.04.
> I never got around to merge it into crossgcc-ng.
> I'll try to remember to post an updated script, but please email me if
> I forget and you could use it.

Yes, please. I would be very glad to look at the updated version. Now that
we have basic support for newlib, it should be easier to add support
for this.

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Yann E. MORIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Marc!
Hello All!

On Tuesday 20 October 2009 10:15:12 Marc Kleine-Budde wrote:
> the cortex-m3 is a MMU-less CPU, you probably want to use newlib with it.

Yes, I'd forgotten that, besides being Thumb2-only, Cortex-M3 was also
MMU-less.

So we need to expose the MMU config option for ARM as well. OK...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Leon Woestenberg-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

On Tue, Oct 20, 2009 at 11:18 PM, Yann E. MORIN
<yann.morin.1998@...> wrote:
> On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:
>>
>> I'll try to remember to post an updated script, but please email me if
>> I forget and you could use it.
>
> Yes, please. I would be very glad to look at the updated version. Now that
> we have basic support for newlib, it should be easier to add support
> for this.
>
Sure, find it attached.



Regards,
--
Leon

www.sidebranch.com


--
For unsubscribe information see http://sourceware.org/lists.html#faq

build_432.sh (8K) Download Attachment

Re: building for Cortex M3

by Marc Kleine-Budde :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yann E. MORIN wrote:

> Hello Marc!
> Hello All!
>
> On Tuesday 20 October 2009 10:15:12 Marc Kleine-Budde wrote:
>> the cortex-m3 is a MMU-less CPU, you probably want to use newlib with it.
>
> Yes, I'd forgotten that, besides being Thumb2-only, Cortex-M3 was also
> MMU-less.
>
> So we need to expose the MMU config option for ARM as well. OK...

that means use uclibc for uclinux or newlib

IMHO don't put too many options in kconfig.

cheers, Marc

- --
Pengutronix e.K.                         | Marc Kleine-Budde           |
Linux Solutions for Science and Industry | Phone: +49-231-2826-924     |
Vertretung West/Dortmund                 | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686         | http://www.pengutronix.de   |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkreNDQACgkQjTAFq1RaXHP0RwCfTp94VDqO8hUXzcxihoYcZmdR
RzkAl2NqDr/9vBDnkk24X+55ihnkb1Q=
=06G3
-----END PGP SIGNATURE-----

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leon and Yann,

>
> On Tue, Oct 20, 2009 at 11:18 PM, Yann E. MORIN
> <yann.morin.1998@...> wrote:
>> On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:
>>>
>>> I'll try to remember to post an updated script, but please email  
>>> me if
>>> I forget and you could use it.
>>
>> Yes, please. I would be very glad to look at the updated version.  
>> Now that
>> we have basic support for newlib, it should be easier to add support
>> for this.
>>
> Sure, find it attached.
>
>

I have not had a chance to test the script but this http://eluaproject.dreamhosters.com/?p=Building_GCC_for_Cortex 
  worked.

I used the binutils and gcc sources downloaded by the crosstool-ng in  
place of the versions mentioned but it did build.

Regards,
Allen


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 20, 2009, at 3:05 PM, Marc Kleine-Budde wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Yann E. MORIN wrote:
>> Hello Marc!
>> Hello All!
>>
>> On Tuesday 20 October 2009 10:15:12 Marc Kleine-Budde wrote:
>>> the cortex-m3 is a MMU-less CPU, you probably want to use newlib  
>>> with it.
>>
>> Yes, I'd forgotten that, besides being Thumb2-only, Cortex-M3 was  
>> also
>> MMU-less.
>>
>> So we need to expose the MMU config option for ARM as well. OK...
>
> that means use uclibc for uclinux or newlib
>

Use uclibc for Linux. newlib for baremetal.

> IMHO don't put too many options in kconfig.
>
> cheers, Marc
>
> - --
> Pengutronix e.K.                         | Marc Kleine-
> Budde           |
> Linux Solutions for Science and Industry | Phone:  
> +49-231-2826-924     |
> Vertretung West/Dortmund                 | Fax:    
> +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686         | http://
> www.pengutronix.de   |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEUEARECAAYFAkreNDQACgkQjTAFq1RaXHP0RwCfTp94VDqO8hUXzcxihoYcZmdR
> RzkAl2NqDr/9vBDnkk24X+55ihnkb1Q=
> =06G3
> -----END PGP SIGNATURE-----


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 20, 2009, at 2:49 PM, Leon Woestenberg wrote:

> Hello,
>
> On Tue, Oct 20, 2009 at 11:18 PM, Yann E. MORIN
> <yann.morin.1998@...> wrote:
>> On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:
>>>
>>> I'll try to remember to post an updated script, but please email  
>>> me if
>>> I forget and you could use it.
>>
>> Yes, please. I would be very glad to look at the updated version.  
>> Now that
>> we have basic support for newlib, it should be easier to add support
>> for this.
>>
> Sure, find it attached.
>

Do you have a version that build C++ support as well?


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Allen Curtis-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 20, 2009, at 2:49 PM, Leon Woestenberg wrote:

> Hello,
>
> On Tue, Oct 20, 2009 at 11:18 PM, Yann E. MORIN
> <yann.morin.1998@...> wrote:
>> On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:
>>>
>>> I'll try to remember to post an updated script, but please email  
>>> me if
>>> I forget and you could use it.
>>
>> Yes, please. I would be very glad to look at the updated version.  
>> Now that
>> we have basic support for newlib, it should be easier to add support
>> for this.
>>
> Sure, find it attached.
>
>

Leon,

I used your script to build a Cortex-M3 compiler. Unfortunately it  
will not link. I am getting the following errors.

acurtis@ac2vmserver:~/tmp$ arm-sidebranch-eabi-gcc hello.c -o hello_c/
opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-
eabi/lib/thumb/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x14): undefined reference to `_exit'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xe): undefined reference to `_sbrk'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-writer.o): In function  
`_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-closer.o): In function  
`_close_r':
closer.c:(.text._close_r+0xe): undefined reference to `_close'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-lseekr.o): In function  
`_lseek_r':
lseekr.c:(.text._lseek_r+0x12): undefined reference to `_lseek'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x12): undefined reference to `_read'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-fstatr.o): In function  
`_fstat_r':
fstatr.c:(.text._fstat_r+0x10): undefined reference to `_fstat'
/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-
sidebranch-eabi/lib/thumb/libc.a(lib_a-isattyr.o): In function  
`_isatty_r':
isattyr.c:(.text._isatty_r+0xe): undefined reference to `_isatty'
collect2: ld returned 1 exit status

Could this because NewLib syscalls have been disabled?

../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} \
--enable-interwork \
--disable-newlib-supplied-syscalls --with-gnu-ld --with-gnu-as --
disable-shared \
2>&1 | tee configure.log

Thanks
Allen


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: building for Cortex M3

by Bugzilla from raj.khem@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 26, 2009 at 4:00 PM, Allen Curtis
<ajcurtis@...> wrote:

> On Oct 20, 2009, at 2:49 PM, Leon Woestenberg wrote:
>
>> Hello,
>>
>> On Tue, Oct 20, 2009 at 11:18 PM, Yann E. MORIN
>> <yann.morin.1998@...> wrote:
>>>
>>> On Tuesday 20 October 2009 12:19:03 Leon Woestenberg wrote:
>>>>
>>>> I'll try to remember to post an updated script, but please email me if
>>>> I forget and you could use it.
>>>
>>> Yes, please. I would be very glad to look at the updated version. Now
>>> that
>>> we have basic support for newlib, it should be easier to add support
>>> for this.
>>>
>> Sure, find it attached.
>>
>>
>
> Leon,
>
> I used your script to build a Cortex-M3 compiler. Unfortunately it will not
> link. I am getting the following errors.
>
> acurtis@ac2vmserver:~/tmp$ arm-sidebranch-eabi-gcc hello.c -o
> hello_c/opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-exit.o):
> In function `exit':
> exit.c:(.text.exit+0x14): undefined reference to `_exit'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-sbrkr.o):
> In function `_sbrk_r':
> sbrkr.c:(.text._sbrk_r+0xe): undefined reference to `_sbrk'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-writer.o):
> In function `_write_r':
> writer.c:(.text._write_r+0x12): undefined reference to `_write'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-closer.o):
> In function `_close_r':
> closer.c:(.text._close_r+0xe): undefined reference to `_close'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-lseekr.o):
> In function `_lseek_r':
> lseekr.c:(.text._lseek_r+0x12): undefined reference to `_lseek'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-readr.o):
> In function `_read_r':
> readr.c:(.text._read_r+0x12): undefined reference to `_read'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-fstatr.o):
> In function `_fstat_r':
> fstatr.c:(.text._fstat_r+0x10): undefined reference to `_fstat'
> /opt/stm32/lib/gcc/arm-sidebranch-eabi/4.3.3/../../../../arm-sidebranch-eabi/lib/thumb/libc.a(lib_a-isattyr.o):
> In function `_isatty_r':
> isattyr.c:(.text._isatty_r+0xe): undefined reference to `_isatty'
> collect2: ld returned 1 exit status
>
> Could this because NewLib syscalls have been disabled?

you need to have some sort of low level IO library implementation.

>
> ../configure --target=${TOOLCHAIN_TARGET} --prefix=${TOOLCHAIN_PATH} \
> --enable-interwork \
> --disable-newlib-supplied-syscalls --with-gnu-ld --with-gnu-as
> --disable-shared \
> 2>&1 | tee configure.log
>
> Thanks
> Allen
>
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq