1 |
Hi, |
2 |
|
3 |
I've been trying to build a musl based cross-compilation toolchain for |
4 |
building static packages. With: |
5 |
|
6 |
CFLAGS="-O2 -pipe" crossdev -s4 -t armv7a-hardfloat-linux-musleabi |
7 |
|
8 |
I get a *working* toolchain, with which i can build dynamically linked |
9 |
executables, but static linking of libc fails. For example, the simple |
10 |
C program |
11 |
|
12 |
#include <stdio.h> |
13 |
int main() |
14 |
{ |
15 |
puts("hello"); |
16 |
} |
17 |
|
18 |
gives: |
19 |
|
20 |
$ armv7a-hardfloat-linux-musleabi-gcc main.c -static |
21 |
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping |
22 |
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when |
23 |
searching for -lc |
24 |
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: skipping |
25 |
incompatible /usr/armv7a-hardfloat-linux-musleabi/usr/lib/libc.a when |
26 |
searching for -lc |
27 |
/usr/libexec/gcc/armv7a-hardfloat-linux-musleabi/ld: cannot find -lc |
28 |
|
29 |
I'm trying to track down what could be causing this, but so far |
30 |
haven't found anything (tried disabling PIE but same result). The |
31 |
crossdev toolchain uses musl 1.1.17, gcc 6.4.0 and binutils 2.29.1-r1. |
32 |
|
33 |
Any help would be appreciated. Thanks. |
34 |
Jeremi |