Hi,
I've been trying to build a musl based cross-compilation toolchain for
building static packages. With:
CFLAGS="-O2 -pipe" crossdev -s4 -t armv7a-hardfloat-linux-musleabi
I get a *working* toolchain, with which i can build dynamically linked
executables, but static linking of libc fails. For example, the simple
C program
#include <stdio.h>
int main()
{
puts("hello");
}
gives:
$ armv7a-hardfloat-linux-musleabi-gcc main.c -static
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when
searching for -lc
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when
searching for -lc
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: cannot find -lc
I'm trying to track down what could be causing this, but so far
haven't found anything (tried disabling PIE but same result). The
crossdev toolchain uses musl 1.1.17, gcc 6.4.0 and binutils 2.29.1-r1.
Any help would be appreciated. Thanks.
Jeremi
I've been trying to build a musl based cross-compilation toolchain for
building static packages. With:
CFLAGS="-O2 -pipe" crossdev -s4 -t armv7a-hardfloat-linux-musleabi
I get a *working* toolchain, with which i can build dynamically linked
executables, but static linking of libc fails. For example, the simple
C program
#include <stdio.h>
int main()
{
puts("hello");
}
gives:
$ armv7a-hardfloat-linux-musleabi-gcc main.c -static
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when
searching for -lc
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when
searching for -lc
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: cannot find -lc
I'm trying to track down what could be causing this, but so far
haven't found anything (tried disabling PIE but same result). The
crossdev toolchain uses musl 1.1.17, gcc 6.4.0 and binutils 2.29.1-r1.
Any help would be appreciated. Thanks.
Jeremi