2

I am following CLFS book (GIT-20140613-arm version), and I have a issue when building GCC with armv7 and neon combination. Target info here.

My host is a clean Debian 8 with gawk, build-essential, texinfo and libncurses5-dev packages. More details can be found here.

I made this patch to build binutils with gcc-4.9.

Following the instructions, when it comes to compile GCC for the very first time it claims not to be possible to these arm combination.

checking for suffix of object files... configure: error: in `/mnt/clfs/sources/gcc-build/arm-linux-musleabihf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

On config.log we can see:

conftest.c:1:0: error: target CPU does not support ARM mode

I linked the complete error here.

In my research I found this question which sounds to be the same, but the OP was following a very old version of CLFS book, I managed to surpass this bug by appending --with-mode=thumb to ./configure, but then musl fails:

arm-linux-musleabihf-gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -D_XOPEN_SOURCE=700 -I./arch/arm -I./src/internal -I./include -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -fno-stack-protector -c -o crt/crt1.o crt/arm/crt1.s
crt/arm/crt1.s: Assembler messages:
crt/arm/crt1.s:6: Error: only lo regs allowed with immediate -- `mov fp,#0'
crt/arm/crt1.s:7: Error: only lo regs allowed with immediate -- `mov lr,#0'
crt/arm/crt1.s:8: Error: Thumb does not support this addressing mode -- `ldr a2,[sp],#4'
crt/arm/crt1.s:11: Error: lo register required -- `str fp,[sp,#-4]!'
crt/arm/crt1.s:12: Error: Thumb does not support this addressing mode -- `str a1,[sp,#-4]!'
crt/arm/crt1.s:13: Error: Thumb does not support this addressing mode -- `str a4,[sp,#-4]!'
Makefile:112: recipe for target 'crt/crt1.o' failed
make: *** [crt/crt1.o] Error 1

I have also tried vfp and vfpv3 combinations, and I have also tried to use Linaro GCC instead of GNU one, no luck at all.

Once I made this book successfully till the end for Raspberry Pi One (hard, vfp and armv6), but I am in trouble with the Beaglebone combination.

What am I missing? Is my environment correct? If so, what could I do to overcome this issue?

0

For BeagleBone Black, the correct environment settings is armv7-a, as we can see here and here, and we need to pick up the kernel settings from here with bb.org_defconfig, and use headers from here, and patches for gcc from here, and remember to build final gcc with --disable-libsanitizer.

I used the following command before build musl:

sed -i 's/\/dev\/null\/utmp/\/var\/run\/utmp/g;s/\/dev\/null\/wtmp/\/var\/log\/wtmp/g' include/paths.h include/utmp.h

And the following before build busybox to solve wtmp issues:

sed -i 's/\(CONFIG_\)\(.*\)\(INETD\)\(.*\)=y/# \1\2\3\4 is not set/g;s/\(CONFIG_IFPLUGD\|CONFIG_ASH_HELP\|CONFIG_FEATURE_VERBOSE\|CONFIG_UEVENT\)=y/# \1 is not set/' .config
sed -i '/utmpx\.h/,/endif/s/__UCLIBC__/LIBBB_H/' include/libbb.h

Complete package list:

wget -cO bootscripts-embedded-HEAD.tar.gz -c 'http://git.clfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz'
wget -cO gcc-5.2.0-musl-1.patch 'https://raw.githubusercontent.com/GregorR/musl-cross/master/patches/gcc-5.2.0-musl.diff'
wget -c \
    'http://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.bz2' \
    'http://busybox.net/downloads/busybox-1.24.0.tar.bz2' \
    'ftp://gcc.gnu.org/pub/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2' \
    'http://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.xz' \
    'http://sethwklein.net/iana-etc-2.30.tar.bz2' \
    'http://ftp.barfooze.de/pub/sabotage/tarballs/kernel-headers-3.12.6-5.tar.xz' \
    'https://github.com/beagleboard/linux/archive/4.1.tar.gz' \
    'ftp://ftp.denx.de/pub/u-boot/u-boot-2015.10.tar.bz2' \
    'ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz' \
    'ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.3.tar.xz' \
    'http://www.musl-libc.org/releases/musl-1.1.9.tar.gz' \
    'https://matt.ucc.asn.au/dropbear/releases/dropbear-2015.68.tar.bz2' \
    'http://www.red-bean.com/~bos/netplug/netplug-1.2.9.2.tar.bz2' \
    'http://downloads.sourceforge.net/libpng/zlib-1.2.9.tar.gz' \
    'http://patches.clfs.org/embedded-dev/iana-etc-2.30-update-2.patch' \
    'http://patches.clfs.org/embedded-dev/netplug-1.2.9.2-fixes-1.patch' \
    'http://downloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz'

That solves all issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.