[LLVMdev] [compiler-rt] is the arm lib complete?

liangh at codeaurora.org liangh at codeaurora.org
Fri Nov 16 15:05:02 PST 2012


Hi guys,

Thanks for all the info.

Then, if, besides compiler-rt, I also need some other libs, such as libm,
how do I link?

Here is an example of missing functions in compiler-rt when linking:
"-lstdc++ -lm --start-group  -lcompiler-rt-armv7 -lgcc_eh -lc --end-group"
vs.
"-lstdc++ -lm --start-group  -lgcc -lgcc_eh -lc --end-group"
...
tools/gcc-4.6.1-cs/arm-2011.09/bin/../arm-none-linux-gnueabi/libc/thumb2/usr/lib/libm.a(mpa.o):
In function `norm':
mpa.c:(.text+0xba): undefined reference to `__aeabi_dcmplt'

Does clang provide other replacing libs for them which don't depend on
those missing functions on libgcc? Or there are some other ways to link?
Currently I have to link with both compiler-rt and libgcc with
"--allow-multiple-definition" so that libgcc can cover the missing
functions in compiler-rt. But this is not a clean solution, and I have
trouble when linking thumb2 code with the arm libs in this way. Do you
have better ideas to use compiler-rt to replace libgcc for now?

Thanks!
-Liang


> Hello
>
> It seems you misses several points here...
>
>> So, you mean I should compile libc with clang and link with compiler-rt
>> too?
>> But how can we expect a user of compiler-rt have a libc compiled in this
>> way? It's a part of gcc's src code...
> No it is not
>
>> If compiler-rt is a complete lib, it should also cover these functions,
>> right?
> Yes and no. Yes - it should cover all library functions as defined by
> ARM EABI. Right now it misses some, but the calls to them are not
> generated by clang. No - in general it should not cover gcc's internal
> functions. Though it can cover *some* functions which are important.
>
> So, in your case we need to include _aeabi* and _sync* functions, yes.
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>








More information about the llvm-dev mailing list