Hello Everybody! This is my first post, I hope you can help me.
I love a lot to compile things from source, and recentrly I've discovered the Musl libc library. I use it to cross-compile simple static binaries such as busybox, rsync, etc. Now I would like to cross-compile a static host-x-host compiler for arm. I'm using the following sources packages:
Binutils 2.30
GCC 7.3.0
GMP 6.1.2
MPC 1.1.0
MPFR 4.0.1
Linux 4.15.3
Musl (libc) 1.1.19
I've managed to build everything successfully, however when I try to build a C Program such as "Hello World" it outputs this error:
Code:
/home/michele/tmp/a.out:(.data+0x0): multiple definition of `__dso_handle'
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/crtbegin.o:(.data+0x0): first defined here
/home/michele/tmp/a.out: In function `_init':
:(.init+0x0): multiple definition of `_init'
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/../../../../arm-linux-musleabi/lib/crti.o:(.init+0x0): first defined here
/home/michele/tmp/a.out: In function `_start':
:(.text+0x0): multiple definition of `_start'
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/../../../../arm-linux-musleabi/lib/crt1.o:crt1.c:(.text+0x0): first defined here
/home/michele/tmp/a.out: In function `_start_c':
:(.text+0x1c): multiple definition of `_start_c'
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/../../../../arm-linux-musleabi/lib/crt1.o:crt1.c:(.text._start_c+0x0): first defined here
/home/michele/tmp/a.out: In function `main':
:(.text+0xe8): multiple definition of `main'
/tmp/ccegcMMo.o:hello.c:(.text+0x0): first defined here
/home/michele/tmp/a.out: In function `_fini':
:(.fini+0x0): multiple definition of `_fini'
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/../../../../arm-linux-musleabi/lib/crti.o:(.fini+0x0): first defined here
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
/home/michele/tmp/a.out::(.data+0x4): first defined here
/home/michele/tmp/toolchain/output/lib/gcc/arm-linux-musleabi/7.3.0/libgcc.a(_dvmd_lnx.o): In function `__aeabi_idiv0':
/home/michele/tmp/toolchain/tmp/build-gcc/arm-linux-musleabi/libgcc/../../../src/gcc/libgcc/config/arm/lib1funcs.S:1545: undefined reference to `raise'
collect2: error: ld returned 1 exit status
I have installed qemu-user-static and binfmt-support, this way I am able to run gcc. What could have I done wrong? Could someone instruct me to build a static relocatable native host-x-host cross-compiler for arm? It needs to run on armv6 (and beyond) with soft floating point.
I already have a cross-compiler, i've built it using the same package versions and it works. I'm using it to build this version of GCC
Thanks for the help
P.S feel free to correct my English, I usually don't pay too much attention on how I write when I post a topic because I'm too focused on my problem