[Clfs-support] building a toolchain for ARM

Michele Bucca michele.bucca at gmail.com
Mon May 7 12:35:50 PDT 2018


Hello

I'm trying to build a host-x-host toolchain for arm. I'm using the
CLFS-3.0.0-SYSVINIT book, clfs-embedded and the standard LFS book as
guide. I plan to install it into a special directory:
/data/data/org.connectbot/files/tools.

The corss-tools were compiled successfully, they work as expected.
I've used them to build the host-x-host toolchain and it compiles with
no problems. Now when I try to compile a standard "Hello Wolrd"
program wjth it (the host-x-host toolchain) it prints this error:

/home/michele/tmp/hello.arm.o: In function `_fini':
/home/michele/lfs/sources/glibc-2.25/csu/../sysdeps/arm/crti.S:95:
multiple definition of `_fini'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/../../../crti.o:/home/michele/lfs/sources/glibc-2.25/csu/../sysdeps/arm/crti.S:95:
first defined here
/home/michele/tmp/hello.arm.o: In function `__data_start':
:(.data+0x0): multiple definition of `__data_start'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/../../../crt1.o:init.c:(.data+0x0):
first defined here
/home/michele/tmp/hello.arm.o: In function `__data_start':
:(.data+0x4): multiple definition of `__dso_handle'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/crtbegin.o:(.data+0x0):
first defined here
/home/michele/tmp/hello.arm.o:(.rodata+0x0): multiple definition of
`_IO_stdin_used'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/../../../crt1.o:(.rodata.cst4+0x0):
first defined here
/home/michele/tmp/hello.arm.o: In function `_start':
/home/michele/lfs/sources/glibc-2.25/csu/../sysdeps/arm/start.S:79:
multiple definition of `_start'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/../../../crt1.o:init.c:(.text+0x0):
first defined here
/home/michele/tmp/hello.arm.o: In function `main':
:(.text+0x128): multiple definition of `main'
/tmp/ccD3GKa8.o:hello.c:(.text+0x0): first defined here
/home/michele/tmp/hello.arm.o: In function `_init':
/home/michele/lfs/sources/glibc-2.25/csu/../sysdeps/arm/crti.S:83:
multiple definition of `_init'
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/../../../crti.o:/home/michele/lfs/sources/glibc-2.25/csu/../sysdeps/arm/crti.S:64:
first defined here
/data/data/org.connectbot/files/tools/lib/gcc/arm-linux-gnueabi/6.3.0/crtend.o:(.tm_clone_table+0x0):
multiple definition of `__TMC_END__'
/home/michele/tmp/hello.arm.o::(.data+0x8): first defined here
collect2: error: ld returned 1 exit status

binutils config options:

../binutils-2.27/configure --build=x86_64-cross-linux-gnu
--host=arm-linux-gnueabi --target=arm-linux-gnueabi
--with-lib-path=/data/data/org.connectbot/files/tools/lib
--disable-nls --disable-shared --disable-multilib
--prefix=/data/data/org.connectbot/files/tools/

GCC config options:

../gcc-6.3.0_mod/configure
--prefix=/data/data/org.connectbot/files/tools
--build=x86_64-cross-linux-gnu --host=arm-linux-gnueabi
--target=arm-linux-gnueabi
--with-local-prefix=/data/data/org.connectbot/files/tools
--disable-multilib --disable-nls --enable-languages=c,c++
--disable-libstdcxx-pch
--with-native-system-header-dir=/data/data/org.connectbot/files/tools/include
--disable-libssp --enable-checking=release --enable-libstdcxx-time

corss Binutils

../binutils-2.27/configure --prefix=/data/cross-tools
--target=arm-linux-gnueabi --with-sysroot=/
--with-lib-path=/data/data/org.connectbot/files/tools/lib
--disable-nls --disable-static --disable-multilib --disable-werror


cross GCC:

../gcc-6.3.0_mod/configure --prefix=/data/cross-tools
--build=x86_64-cross-linux-gnu --host=x86_64-cross-linux-gnu
--target=arm-linux-gnueabi
--with-local-prefix=/data/data/org.connectbot/files/tools
--with-native-system-header-dir=/data/data/org.connectbot/files/tools/include
--disable-nls --disable-static --enable-threads=posix
--enable-languages=c,c++ --enable-checking=release
--enable-libstdcxx-time --disable-multilib --with-arch=armv6
--with-float=soft --with-sysroot=/

any suggestions?



More information about the Clfs-support mailing list