[Clfs-support] Assembler error when making target 'all-target-libgcc' with the 'thumb' ARM mode

Angel Ivan Castell Rovira al004140 at gmail.com
Thu Mar 31 08:10:01 PDT 2011


Hello forum!

Because the 'cat /proc/cpuinfo' on my ARM ARM920T (Samsung S3C2440) shows
the 'thumb' feature available,

$ cat /proc/cpuinfo
Processor    : ARM920T rev 0 (v4l)
BogoMIPS    : 199.47
Features    : swp half thumb
CPU implementer    : 0x41
CPU architecture: 4T
CPU variant    : 0x1
CPU part    : 0x920
CPU revision    : 0

Hardware    : BDC2440
Revision    : 0000
Serial        : 0000000000000000

I decided to build a cross-compiler for that processor enabling that "thumb"
feature. So I modified this variable:

$ export CLFS_ARM_MODE="thumb"

in my environment to generate the cross-compiler. The rest of the CLFS_*
environment variables is this:

$ env|grep CLFS
CLFS_HOST=i486-cross-linux-gnu
CLFS_TARGET=armv4-linux-uclibc
CLFS_ARM_ARCH=armv4t
CLFS_ARM_MODE=thumb
CLFS=/home/clfs
CLFS_ARCH=arm
CLFS_ABI=apcs-gnu
CLFS_ENDIAN=little
CLFS_FLOAT=soft

But the assembler is generating an error when making target
'all-target-libgcc' in the step to cross-compile the GCC Compiler with
Static libgcc and no Threads.

More information to track this problem:

Version of the book being used: CLFS Embedded GIT-0.0.1-20110323
Host distribution: [Ubuntu 9.04 _Jaunty Jackalope_ - Release i386
(20090420.1)]

Following the CLFS documentation, all the steps previous to the
"Installation of Cross GCC Compiler with Static libgcc and no Threads" were
successfully completed. Now I continue including the steps to reproduce the
problem:

$ tar xvfj gcc-4.5.2.tar.bz2
$ mkdir gcc-static-build
$ cd gcc-static-build
$ AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" ../gcc-4.5.2/configure
\
        --prefix=${CLFS}/cross-tools \
        --build=${CLFS_HOST} \
        --host=${CLFS_HOST} \
        --target=${CLFS_TARGET} \
        --with-sysroot=${CLFS} \
        --disable-nls \
        --disable-shared \
        --with-mpfr=${CLFS}/cross-tools \
        --with-gmp=${CLFS}/cross-tools \
        --with-mpc=${CLFS}/cross-tools \
        --without-headers \
        --with-newlib \
        --disable-decimal-float \
        --disable-libgomp \
        --disable-libmudflap \
        --disable-libssp \
        --disable-threads \
        --enable-languages=c \
        --disable-multilib \
        --with-abi=${CLFS_ABI} \
        --with-arch=${CLFS_ARM_ARCH} \
        --with-mode=${CLFS_ARM_MODE} \
        --with-float=${CLFS_FLOAT} \
        --with-fpu=${CLFS_FPU}
[ok]

$ make all-gcc
[ok]

$ make all-target-libgcc
[...]
/home/clfs/sources/gcc-static-build/./gcc/xgcc
-B/home/clfs/sources/gcc-static-build/./gcc/
-B/home/clfs/cross-tools/armv4-linux-uclibc/bin/
-B/home/clfs/cross-tools/armv4-linux-uclibc/lib/ -isystem
/home/clfs/cross-tools/armv4-linux-uclibc/include -isystem
/home/clfs/cross-tools/armv4-linux-uclibc/sys-include    -g -O2 -O2  -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include  -fomit-frame-pointer -fPIC -Wno-missing-prototypes -g
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -I. -I. -I../.././gcc
-I../../../gcc-4.5.2/libgcc -I../../../gcc-4.5.2/libgcc/.
-I../../../gcc-4.5.2/libgcc/../gcc -I../../../gcc-4.5.2/libgcc/../include
-DHAVE_CC_TLS  -o _clear_cache.o -MT _clear_cache.o -MD -MP -MF
_clear_cache.dep -DL_clear_cache -c
../../../gcc-4.5.2/libgcc/../gcc/libgcc2.c \

/tmp/ccG53RGB.s: Assembler messages:
/tmp/ccG53RGB.s:29: Error: invalid swi expression
/tmp/ccG53RGB.s:29: Error: value of 10420226 too large for field of 2 bytes
at 2
make[1]: *** [_clear_cache.o] Error 1
make[1]: Leaving directory
`/home/clfs/sources/gcc-static-build/armv4-linux-uclibc/libgcc'
make: *** [all-target-libgcc] Error 2

The assembler is generating the nasty error you just have seen. That error
is fixed using mode "arm" instead of "thumb":

$ export CLFS_ARM_MODE="arm"

Using "arm", the target 'all-target-libgcc' ends ok, but I would like to get
the cross-toolchain with that "thumb" feature enabled.

Hope you can give me some advice based on your own experience.

Thanks a lot in advance!

Best regards,
  --  Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20110331/57e9f600/attachment.html>


More information about the Clfs-support mailing list