Discussion:
[Clfs-support] Binutils for ARM devices
m***@gmail.com
2017-11-26 19:08:07 UTC
Permalink
Hey There

I'm trying to install binutils to my embedded linux from scratch for armel processors (ARMv5 with soft floating point).

these are the configure parameters I'm giving

../binutils-2.27/configure --host=arm-linux-musleabi --target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls --disable-multilib --prefix=/home/michele/toolchain-arm

However during the build I get this error regarding libiberty:

make[1]: ingresso nella directory "/home/michele/sources/build-binutils"
make[2]: ingresso nella directory "/home/michele/sources/build-binutils/libiberty"
if [ x"" != x ]; then \
  arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.27/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE  ../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
  arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.27/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE   ../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2  -I. -I../../binutils-2.27/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE ../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting types for 'psignal'
 psignal (int signo, char *message)
 ^~~~~~~
In file included from ../../binutils-2.27/libiberty/strsignal.c:22:0:
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous declaration of 'psignal' was here
 void psignal(int, const char *);
      ^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non riuscito
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-binutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory "/home/michele/sources/build-binutils"
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

How do I fix this problem? Can this problem be circumvented in some way?
--
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.
Angel Ivan Castell Rovira
2017-11-27 10:20:47 UTC
Permalink
I attach documentation in spanish you can follow step by step to generate
your own toolchain. Hope It helps!

=== 1. Preparar el entorno ===

Configura estas variables de entorno, esenciales para guiar todo el proceso.

export ROOTDIR="${HOME}/custom-toolchains/ARM"
export NATIVE_PREFIX="${ROOTDIR}/opt/native"
export CROSS_PREFIX="${ROOTDIR}/opt/cross"
export ABI=eabi ## Variable especifica para las CPU basadas en
ARM, opciones: oabi, eabi
export LINUX_ARCH=arm
export CPU=arm
export ARCH=armv5
export CLIB=musl${ABI}
export TARGET_TRIPLET=${CPU}-linux-${CLIB}

Los parámetros mas importanes los puedes encontrar aqui:

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#ARM-Options

=== 2. Descargar los fuentes ===

Crear este directorio:

mkdir -p ${ROOTDIR}/src
cd ${ROOTDIR}/src

Descargar todos estos fuentes:

wget http://ftpmirror.gnu.org/binutils/binutils-2.27.tar.bz2
wget http://ftpmirror.gnu.org/gcc/gcc-6.3.0/gcc-6.3.0.tar.bz2
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.6.tar.bz2
wget https://www.musl-libc.org/releases/musl-1.1.16.tar.gz
wget http://ftpmirror.gnu.org/mpfr/mpfr-3.1.5.tar.bz2
wget http://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2
wget http://ftpmirror.gnu.org/mpc/mpc-1.0.2.tar.gz

Y descomprimelos:

tar xvfj binutils-2.27.tar.bz2
tar xvfj gcc-6.3.0.tar.bz2
tar xvfz mpc-1.0.3.tar.gz
tar xvfj mpfr-3.1.5.tar.bz2
tar xvfj gmp-6.1.2.tar.bz2
tar xvfz musl-1.1.16.tar.gz
tar xvfj linux-3.12.6.tar.bz2

=== 3. Compilar binutils nativo ===

Tu PC host ya tiene instaladas unas binutils, por lo que con toda seguridad
puedes saltarte este paso. De todos modos, no hace ningún daño empezar el
proceso con las binutils mas modernas.

cd ${ROOTDIR}/src
mkdir build-binutils
cd build-binutils
../binutils-2.27/configure --prefix="${NATIVE_PREFIX}" --disable-nls
--disable-werror --disable-multilib
make
make install-strip

=== 4. Compilar el gcc nativo con sus dependencias ===

Las versiones del gcc se identifican por tres números: MAJOR.MINOR.RELEASE.
Estos tres números te ayudarán a conocer si necesitas hacer este paso o no:

* Si el MAJOR.MINOR del compilador instalado en tu PC host coincide con
el
del cross-compilador que quieres generar (por ejemplo, si tu PC host
tiene un gcc-6.2.0 y quieres generar un cross-compiler para el 6.2.3),
salta al siguiente paso del proceso, el proceso finalizará bien.

* Si el MAJOR del compilador instalado en tu PC host coincide con el del
cross-compilador que quieres generar (por ejemplo, si tu PC host tiene
un gcc-6.0.0 y quieres generar un cross-compiler para el gcc-6.3.0),
lo
recomendable es que realices este paso antes de saltar al siguiente,
aunque no es obligatorio.

* Si el MAYOR del compilador instalado en tu PC host difiere del
cross-compiler que quieres generar (), este paso es obligatorio.

Si has decidido que debes realizar este paso, ejecuta los siguientes
comandos:

cd ${ROOTDIR}/src/gcc-6.3.0
ln -s ../mpfr-3.1.5 mpfr
ln -s ../gmp-6.1.2 gmp
ln -s ../mpc-1.0.3 mpc
cd ..
mkdir build-gcc
cd build-gcc
../gcc-6.3.0/configure --prefix=${NATIVE_PREFIX} --disable-nls
--enable-languages=c --disable-multilib
make
make install-strip

Ten mucha paciencia porque es un proceso MUY costoso computacionalmente
(varias
horas en mi PC). Una vez finalizado el proceso, ajusta la variable PATH para
usar el nuevo compilador nativo:

export PATH="${NATIVE_PREFIX}/bin:${PATH}"

Confirma que estas usando el compilador recién compilado:

gcc --version
gcc (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

=== 5. Compilar las cross-binutils ===

Ahora configura binutils y lanza su compilación:

cd ${ROOTDIR}/src
mkdir build-${CPU}-binutils
cd build-${CPU}-binutils
../binutils-2.27/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --with-sysroot --disable-nls --disable-werror
--disable-multilib
make
make install-strip

La magia se produce al especificar el flag --target="arm-linux-musl" en el
script de configure, que detecta que la máquina host no es un MIPS, y como
resultado configurará la compilación para generar un cross-assembler, un
cross-linker, y el resto de cross-tools para la plataforma MIPS.

=== 6. Instalar los headers del kernel ===

Instala los headers del kernel:

cd ${ROOTDIR}/src
cd linux-3.12.6
make ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_PREFIX}/${TARGET_TRIPLET}
headers_install

=== 7. Compilar el cross-compiler (fase 1) ===

Se genera un bootstrap cross-compiler sin C library, que solo soporta
linkado
estático. Empezamos ajustando la variable de entorno PATH para poder usar
las
cross-binutils compiladas en el paso anterior:

export PATH="${CROSS_PREFIX}/bin/:$PATH"

Compila el cross-compiler 6.3.0 usando el cross-assembler recién generado:

cd ${ROOTDIR}/src
mkdir build-bootstrap-${CPU}-gcc
cd build-bootstrap-${CPU}-gcc
../gcc-6.3.0/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --disable-nls --enable-languages=c
--disable-multilib --disable-threads --disable-shared --with-float=soft
--with-arch=${ARCH}
make all-gcc install-gcc
make all-target-libgcc install-target-libgcc

Puesto que hemos especificado --target=arm-linux-musl, el script configure
busca el cross-assembler que hemos compilado en el paso anterior.

Ahora prueba a ejecutar este comando:

${TARGET_TRIPLET}-gcc --version

Este cross-compiler no es capaz de compilar programas en C del user-space,
ya
que todavía no dispone de ninguna C library para el sistema target. Sin
embargo, si posee la funcionalidad básica necesaria para poder compilar la C
library para el target.

=== 8. Compilar la librería de C ===

Utilizamos el cross-compiler generado en el paso anterior (fase 1) para
compilar la C library.

cd ${ROOTDIR}/src
mkdir build-${CLIB}
cd build-${CLIB}
CC=${TARGET_TRIPLET}-gcc CFLAGS=-Wa,-msoft-float
../musl-1.1.16/configure --prefix=${CROSS_PREFIX}/${TARGET_TRIPLET}/
--enable-optimize CROSS_COMPILE=${TARGET_TRIPLET}-
make
make install

=== 9. Compilar el cross-compiler final (fase 2) ===

Se genera el cross-compiler final, también conocido como fase 2, con su
propia
C library (compilada en el paso anterior) y soporte para linkado dinámico.

cd ${ROOTDIR}/src
mkdir build-${CPU}-gcc
cd build-${CPU}-gcc
../gcc-6.3.0/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --disable-nls --enable-languages=c,c++
--disable-multilib --enable-threads --enable-shared --with-float=soft
--with-arch=${ARCH} --enable-target-optspace --disable-libgomp
--disable-libmudflap --without-isl --without-cloog --disable-decimal-float
--disable-libssp --disable-libsanitizer --enable-lto
--with-host-libstdcxx=-lstdc++
make
make install-strip




El 26/11/2017 20:08, <***@gmail.com> escribió:




Hey There

I'm trying to install binutils to my embedded linux from scratch for armel
processors (ARMv5 with soft floating point).

these are the configure parameters I'm giving

../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm

However during the build I get this error regarding libiberty:

make[1]: ingresso nella directory "/home/michele/sources/build-binutils"
make[2]: ingresso nella directory "/home/michele/sources/build-
binutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include
-W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic
-D_GNU_SOURCE ../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting types
for 'psignal'
psignal (int signo, char *message)
^~~~~~~
In file included from ../../binutils-2.27/libiberty/strsignal.c:22:0:
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non riuscito
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-
binutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non
riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory "/home/michele/sources/build-binutils"
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

How do I fix this problem? Can this problem be circumvented in some way?
--
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.
Michele Bucca
2017-11-27 11:15:08 UTC
Permalink
Post by Angel Ivan Castell Rovira
I attach documentation in spanish you can follow step by step to generate
your own toolchain. Hope It helps!
=== 1. Preparar el entorno ===
Configura estas variables de entorno, esenciales para guiar todo el proceso.
export ROOTDIR="${HOME}/custom-toolchains/ARM"
export NATIVE_PREFIX="${ROOTDIR}/opt/native"
export CROSS_PREFIX="${ROOTDIR}/opt/cross"
export ABI=eabi ## Variable especifica para las CPU basadas en
ARM, opciones: oabi, eabi
export LINUX_ARCH=arm
export CPU=arm
export ARCH=armv5
export CLIB=musl${ABI}
export TARGET_TRIPLET=${CPU}-linux-${CLIB}
https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#ARM-Options
=== 2. Descargar los fuentes ===
mkdir -p ${ROOTDIR}/src
cd ${ROOTDIR}/src
wget http://ftpmirror.gnu.org/binutils/binutils-2.27.tar.bz2
wget http://ftpmirror.gnu.org/gcc/gcc-6.3.0/gcc-6.3.0.tar.bz2
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.6.tar.bz2
wget https://www.musl-libc.org/releases/musl-1.1.16.tar.gz
wget http://ftpmirror.gnu.org/mpfr/mpfr-3.1.5.tar.bz2
wget http://ftpmirror.gnu.org/gmp/gmp-6.1.2.tar.bz2
wget http://ftpmirror.gnu.org/mpc/mpc-1.0.2.tar.gz
tar xvfj binutils-2.27.tar.bz2
tar xvfj gcc-6.3.0.tar.bz2
tar xvfz mpc-1.0.3.tar.gz
tar xvfj mpfr-3.1.5.tar.bz2
tar xvfj gmp-6.1.2.tar.bz2
tar xvfz musl-1.1.16.tar.gz
tar xvfj linux-3.12.6.tar.bz2
=== 3. Compilar binutils nativo ===
Tu PC host ya tiene instaladas unas binutils, por lo que con toda seguridad
puedes saltarte este paso. De todos modos, no hace ningún daño empezar el
proceso con las binutils mas modernas.
cd ${ROOTDIR}/src
mkdir build-binutils
cd build-binutils
../binutils-2.27/configure --prefix="${NATIVE_PREFIX}" --disable-nls
--disable-werror --disable-multilib
make
make install-strip
=== 4. Compilar el gcc nativo con sus dependencias ===
Las versiones del gcc se identifican por tres números: MAJOR.MINOR.RELEASE.
* Si el MAJOR.MINOR del compilador instalado en tu PC host coincide
con el
del cross-compilador que quieres generar (por ejemplo, si tu PC host
tiene un gcc-6.2.0 y quieres generar un cross-compiler para el 6.2.3),
salta al siguiente paso del proceso, el proceso finalizará bien.
* Si el MAJOR del compilador instalado en tu PC host coincide con el del
cross-compilador que quieres generar (por ejemplo, si tu PC host tiene
un gcc-6.0.0 y quieres generar un cross-compiler para el gcc-6.3.0),
lo
recomendable es que realices este paso antes de saltar al siguiente,
aunque no es obligatorio.
* Si el MAYOR del compilador instalado en tu PC host difiere del
cross-compiler que quieres generar (), este paso es obligatorio.
Si has decidido que debes realizar este paso, ejecuta los siguientes
cd ${ROOTDIR}/src/gcc-6.3.0
ln -s ../mpfr-3.1.5 mpfr
ln -s ../gmp-6.1.2 gmp
ln -s ../mpc-1.0.3 mpc
cd ..
mkdir build-gcc
cd build-gcc
../gcc-6.3.0/configure --prefix=${NATIVE_PREFIX} --disable-nls
--enable-languages=c --disable-multilib
make
make install-strip
Ten mucha paciencia porque es un proceso MUY costoso computacionalmente
(varias
horas en mi PC). Una vez finalizado el proceso, ajusta la variable PATH para
export PATH="${NATIVE_PREFIX}/bin:${PATH}"
gcc --version
gcc (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
=== 5. Compilar las cross-binutils ===
cd ${ROOTDIR}/src
mkdir build-${CPU}-binutils
cd build-${CPU}-binutils
../binutils-2.27/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --with-sysroot --disable-nls --disable-werror
--disable-multilib
make
make install-strip
La magia se produce al especificar el flag --target="arm-linux-musl" en el
script de configure, que detecta que la máquina host no es un MIPS, y como
resultado configurará la compilación para generar un cross-assembler, un
cross-linker, y el resto de cross-tools para la plataforma MIPS.
=== 6. Instalar los headers del kernel ===
cd ${ROOTDIR}/src
cd linux-3.12.6
make ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_PREFIX}/${TARGET_TRIPLET}
headers_install
=== 7. Compilar el cross-compiler (fase 1) ===
Se genera un bootstrap cross-compiler sin C library, que solo soporta
linkado
estático. Empezamos ajustando la variable de entorno PATH para poder usar
las
export PATH="${CROSS_PREFIX}/bin/:$PATH"
cd ${ROOTDIR}/src
mkdir build-bootstrap-${CPU}-gcc
cd build-bootstrap-${CPU}-gcc
../gcc-6.3.0/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --disable-nls --enable-languages=c
--disable-multilib --disable-threads --disable-shared --with-float=soft
--with-arch=${ARCH}
make all-gcc install-gcc
make all-target-libgcc install-target-libgcc
Puesto que hemos especificado --target=arm-linux-musl, el script configure
busca el cross-assembler que hemos compilado en el paso anterior.
${TARGET_TRIPLET}-gcc --version
Este cross-compiler no es capaz de compilar programas en C del user-space,
ya
que todavía no dispone de ninguna C library para el sistema target. Sin
embargo, si posee la funcionalidad básica necesaria para poder compilar la C
library para el target.
=== 8. Compilar la librería de C ===
Utilizamos el cross-compiler generado en el paso anterior (fase 1) para
compilar la C library.
cd ${ROOTDIR}/src
mkdir build-${CLIB}
cd build-${CLIB}
CC=${TARGET_TRIPLET}-gcc CFLAGS=-Wa,-msoft-float
../musl-1.1.16/configure --prefix=${CROSS_PREFIX}/${TARGET_TRIPLET}/
--enable-optimize CROSS_COMPILE=${TARGET_TRIPLET}-
make
make install
=== 9. Compilar el cross-compiler final (fase 2) ===
Se genera el cross-compiler final, también conocido como fase 2, con su
propia
C library (compilada en el paso anterior) y soporte para linkado dinámico.
cd ${ROOTDIR}/src
mkdir build-${CPU}-gcc
cd build-${CPU}-gcc
../gcc-6.3.0/configure --target=${TARGET_TRIPLET}
--prefix=${CROSS_PREFIX} --disable-nls --enable-languages=c,c++
--disable-multilib --enable-threads --enable-shared --with-float=soft
--with-arch=${ARCH} --enable-target-optspace --disable-libgomp
--disable-libmudflap --without-isl --without-cloog --disable-decimal-float
--disable-libssp --disable-libsanitizer --enable-lto
--with-host-libstdcxx=-lstdc++
make
make install-strip
Sorry but I already have a musl cross-compiler. Now I want to use that
cross compiler to make a musl toolchain that runs on the ARM target.
However when I try to cross-compile I get that nasty error about libiberty
(See Below) Can I avoid building libiberty alltoghether?
Post by Angel Ivan Castell Rovira
Hey There
I'm trying to install binutils to my embedded linux from scratch for armel
processors (ARMv5 with soft floating point).
these are the configure parameters I'm giving
../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm
make[1]: ingresso nella directory "/home/michele/sources/build-binutils"
make[2]: ingresso nella directory "/home/michele/sources/build-b
inutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting types for 'psignal'
psignal (int signo, char *message)
^~~~~~~
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non riuscito
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-b
inutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory "/home/michele/sources/build-binutils"
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
How do I fix this problem? Can this problem be circumvented in some way?
--
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
Michele Bucca
2017-11-29 07:32:54 UTC
Permalink
I already have a musl cross-compiler. Now I want to use that
cross compiler to make a musl toolchain that runs on the ARM target.
However when I try to build binutils I get this nasty error about libiberty
(See Below) Can I avoid building libiberty alltoghether?

../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm

The error

make[1]: ingresso nella directory "/home/michele/sources/build-binutils"
Post by m***@gmail.com
make[2]: ingresso nella directory "/home/michele/sources/build-b
inutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting types for 'psignal'
psignal (int signo, char *message)
^~~~~~~
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non riuscito
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-b
inutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory "/home/michele/sources/build-binutils"
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
Chris Smith
2017-11-29 09:19:55 UTC
Permalink
Hi Michele,

I did this some time ago, but using binutils v2.24 not v2.27. I built it using the following:

export CLFS_FLOAT=soft
export CLFS_HOST=x86_64-cross-linux-gnu
export CLFS_TARGET=arm-linux-musleabi
export CLFS_ARCH=arm
export CLFS_ARM_ARCH=armv5te

../binutils-2.24/configure \
--prefix=/usr \
--build=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--host=${CLFS_TARGET} \
--with-sysroot=/ \
--disable-nls \
--disable-multilib

make configure-host
make
make DESTDIR=${TARGET_FS} includedir=${TARGET_DEV_DIR}/usr/include datarootdir=${TARGET_DEV_DIR}/usr/share install

I’m pretty sure this worked okay, but the project was only half finished, and I haven’t touched it for a long time.

Regards,
Chris
Post by Michele Bucca
I already have a musl cross-compiler. Now I want to use that
cross compiler to make a musl toolchain that runs on the ARM target.
However when I try to build binutils I get this nasty error about libiberty
(See Below) Can I avoid building libiberty alltoghether?
../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm
The error
make[1]: ingresso nella directory "/home/michele/sources/build-binutils"
Post by m***@gmail.com
make[2]: ingresso nella directory "/home/michele/sources/build-b
inutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting types for 'psignal'
psignal (int signo, char *message)
^~~~~~~
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non riuscito
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-b
inutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory "/home/michele/sources/build-binutils"
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
Chris

Chris Smith <***@icloud.com>
m***@gmail.com
2017-11-30 20:04:05 UTC
Permalink
Post by Chris Smith
Hi Michele,
I did this some time ago, but using binutils v2.24 not v2.27. I built
export CLFS_FLOAT=soft
export CLFS_HOST=x86_64-cross-linux-gnu
export CLFS_TARGET=arm-linux-musleabi
export CLFS_ARCH=arm
export CLFS_ARM_ARCH=armv5te
../binutils-2.24/configure \
--prefix=/usr \
--build=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--host=${CLFS_TARGET} \
--with-sysroot=/ \
--disable-nls \
--disable-multilib
make configure-host
make
make DESTDIR=${TARGET_FS} includedir=${TARGET_DEV_DIR}/usr/include
datarootdir=${TARGET_DEV_DIR}/usr/share install
I’m pretty sure this worked okay, but the project was only half
finished, and I haven’t touched it for a long time.
Regards,
Chris
it still fails. what version of musl are you using?
Post by Chris Smith
Post by Michele Bucca
I already have a musl cross-compiler. Now I want to use that
cross compiler to make a musl toolchain that runs on the ARM target.
However when I try to build binutils I get this nasty error about
libiberty
Post by Michele Bucca
(See Below) Can I avoid building libiberty alltoghether?
../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm
The error
make[1]: ingresso nella directory
"/home/michele/sources/build-binutils"
Post by Michele Bucca
Post by m***@gmail.com
make[2]: ingresso nella directory "/home/michele/sources/build-b
inutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting
types
Post by Michele Bucca
Post by m***@gmail.com
for 'psignal'
psignal (int signo, char *message)
^~~~~~~
In file included from
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non
riuscito
Post by Michele Bucca
Post by m***@gmail.com
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-b
inutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory
"/home/michele/sources/build-binutils"
Post by Michele Bucca
Post by m***@gmail.com
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
Chris

_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
--
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.
Chris Smith
2017-12-01 10:08:09 UTC
Permalink
I’m using:

musl 1.0.3
gcc 4.7.3
gmp 5.1.2
mpfr 3.1.2

Chris
Post by m***@gmail.com
Post by Chris Smith
Hi Michele,
I did this some time ago, but using binutils v2.24 not v2.27. I built
export CLFS_FLOAT=soft
export CLFS_HOST=x86_64-cross-linux-gnu
export CLFS_TARGET=arm-linux-musleabi
export CLFS_ARCH=arm
export CLFS_ARM_ARCH=armv5te
../binutils-2.24/configure \
--prefix=/usr \
--build=${CLFS_HOST} \
--target=${CLFS_TARGET} \
--host=${CLFS_TARGET} \
--with-sysroot=/ \
--disable-nls \
--disable-multilib
make configure-host
make
make DESTDIR=${TARGET_FS} includedir=${TARGET_DEV_DIR}/usr/include
datarootdir=${TARGET_DEV_DIR}/usr/share install
I’m pretty sure this worked okay, but the project was only half
finished, and I haven’t touched it for a long time.
Regards,
Chris
it still fails. what version of musl are you using?
Post by Chris Smith
Post by Michele Bucca
I already have a musl cross-compiler. Now I want to use that
cross compiler to make a musl toolchain that runs on the ARM target.
However when I try to build binutils I get this nasty error about
libiberty
Post by Michele Bucca
(See Below) Can I avoid building libiberty alltoghether?
../binutils-2.27/configure --host=arm-linux-musleabi
--target=arm-linux-musleabi --build=x86_64-linux-gnu --disable-nls
--disable-multilib --prefix=/home/michele/toolchain-arm
The error
make[1]: ingresso nella directory
"/home/michele/sources/build-binutils"
Post by Michele Bucca
Post by m***@gmail.com
make[2]: ingresso nella directory "/home/michele/sources/build-b
inutils/libiberty"
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o pic/strsignal.o; \
else true; fi
if [ x"" != x ]; then \
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o noasan/strsignal.o; \
else true; fi
arm-linux-musleabi-gcc -c -DHAVE_CONFIG_H -g -O2 -I.
-I../../binutils-2.27/libiberty/../include -W -Wall -Wwrite-strings
-Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE
../../binutils-2.27/libiberty/strsignal.c -o strsignal.o
../../binutils-2.27/libiberty/strsignal.c:554:1: error: conflicting
types
Post by Michele Bucca
Post by m***@gmail.com
for 'psignal'
psignal (int signo, char *message)
^~~~~~~
In file included from
/opt/cross/arm-linux-musleabi/include/signal.h:219:6: note: previous
declaration of 'psignal' was here
void psignal(int, const char *);
^~~~~~~
Makefile:1443: set di istruzioni per l'obiettivo "strsignal.o" non
riuscito
Post by Michele Bucca
Post by m***@gmail.com
make[2]: *** [strsignal.o] Errore 1
make[2]: uscita dalla directory "/home/michele/sources/build-b
inutils/libiberty"
Makefile:8049: set di istruzioni per l'obiettivo "all-libiberty" non riuscito
make[1]: *** [all-libiberty] Errore 2
make[1]: uscita dalla directory
"/home/michele/sources/build-binutils"
Post by Michele Bucca
Post by m***@gmail.com
Makefile:850: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
Chris
—
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org <http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org>
--
Inviato dal mio dispositivo Android con K-9 Mail. Perdonate la brevità.
_______________________________________________
Clfs-support mailing list
http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org <http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org>
Chris
—
Chris Smith <***@icloud.com>

Loading...