[LLVMdev] Setting up a cross-compiler for cortex-m3

salvatore benedetto salvatore.benedetto at gmail.com
Mon Jul 23 00:59:32 PDT 2012


On Mon, Jul 23, 2012 at 9:51 AM, salvatore benedetto
<salvatore.benedetto at gmail.com> wrote:
>
> The other problem I have to figure out is why it links with libc in
> the first place, but I have
> an idea.

Actually I dont.

I used the -Wl,-v to see the flags used.

/home/emitrax/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld
--sysroot=/home/emitrax/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../arm-none-linux-gnueabi/libc/thumb2
-Bstatic -dynamic-linker /lib/ld-linux.so.3 .....  -lstdc++ -lm
--start-group -lgcc -lgcc_eh -lc --end-group -T stm32f103rbt6.ld

apart from the fact that I don't understand why it reference the host
dynamic linker.
I removed all this flags

-lm --start-group -lgcc -lgcc_eh -lc --end-group

and it compiled fine.

Please note, that I'm using a list container from the STL provided with libcxx.

On GCC I had the same problem, but when removing those flags it didn't
compile as symbols
in the libc were needed. This seem not to be the case with clang.

Now I need to understand why those flags are added in the first place.

S.



More information about the llvm-dev mailing list