Chao Yan
2015-Mar-12 19:59 UTC
[LLVMdev] Customize Standard C Library Using LLVM (to support llvm backend optimization)
2015-03-12 10:49 GMT-05:00 Jonathan Roelofs <jonathan at codesourcery.com>:> You need to build a sysroot from the lib and include directories in > ~/research/musl-1.1.6 combined with the same folders from > /usr/local/arm-2009q, then use `--sysroot` instead of the `-I`s and `-L's.I copied everything from the lib in musl-1.1.6 to arm-2009q3/arm-none-linux-gnueabi/libc/usr/lib but there is still an error message: src/env/__libc_start_main.c:(.text+0x40): undefined reference to `__aeabi_memset' collect2: ld returned 1 exit status it seems that I need an arm-none-linux-gcc-4.9 (current version from arm-2009q3 is gcc-4.4) to support the `__aeabi_memset' function? Regards, Chao -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150312/3e8ba780/attachment.html>
Jonathan Roelofs
2015-Mar-12 20:07 UTC
[LLVMdev] Customize Standard C Library Using LLVM (to support llvm backend optimization)
On 3/12/15 1:59 PM, Chao Yan wrote:> > 2015-03-12 10:49 GMT-05:00 Jonathan Roelofs <jonathan at codesourcery.com > <mailto:jonathan at codesourcery.com>>: > > You need to build a sysroot from the lib and include directories in > ~/research/musl-1.1.6 combined with the same folders from > /usr/local/arm-2009q, then use `--sysroot` instead of the `-I`s and > `-L's. > > > I copied everything from the lib in musl-1.1.6 > to arm-2009q3/arm-none-linux-gnueabi/libc/usr/lib but there is still an > error message: > > src/env/__libc_start_main.c:(.text+0x40): undefined reference to > `__aeabi_memset' > collect2: ld returned 1 exit status > > it seems that I need an arm-none-linux-gcc-4.9 (current version from > arm-2009q3 is gcc-4.4) to support the `__aeabi_memset' function?This isn't a gcc support mailing list... If you have questions pertaining to llvm/clang, we'd be happy to answer them. That being said, that symbol should be part of the compiler's runtime library (or maybe in the libc?). llvm provides that symbol as part of libclangrt/libcompiler_rt. Jon> > Regards, > Chao-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Jonathan Roelofs
2015-Mar-28 13:53 UTC
[LLVMdev] Customize Standard C Library Using LLVM (to support llvm backend optimization)
On 3/27/15 8:07 PM, Chao Yan wrote:> > 2015-03-12 15:07 GMT-05:00 Jonathan Roelofs <jonathan at codesourcery.com > <mailto:jonathan at codesourcery.com>>: > > This isn't a gcc support mailing list... If you have questions > pertaining to llvm/clang, we'd be happy to answer them. > > That being said, that symbol should be part of the compiler's > runtime library (or maybe in the libc?). llvm provides that symbol > as part of libclangrt/libcompiler_rt. > > The problem is basically caused by llvm. I cross-compile the musl-libc > to arm binaries using clang. However, the cross-compiled musl-libc needs > runtime support from libcompiler_rt. The arm version of this static > runtime library cannot be obtained by cross compiling.Where did you read that? Because it's plainly not true. libcompiler_rt is *designed* to be cross-built, and building the ARM version of it from x86 Linux/Darwin is well exercised by several members of the community, myself included.> Do I need to build llvm on an arm host machine?No. LLVM/Clang is a cross compiler. Building host binaries is just a special, easier case of that. Jon> > Thanks, > Chao >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Chao Yan
2015-Mar-29 06:13 UTC
[LLVMdev] Customize Standard C Library Using LLVM (to support llvm backend optimization)
2015-03-28 8:53 GMT-05:00 Jonathan Roelofs <jonathan at codesourcery.com>:> libcompiler_rt is *designed* to be cross-built, and building the ARM > version of it from x86 Linux/Darwin is well exercised by several members of > the community, myself included.Thank you for helping Jon. I'm still learning the llvm cross compiling stuff, sometimes I might misunderstand it. I tried "make clang_linux" in the compiler_rt directory, it would only build the "libcompiler_rt.a" for x86_64, which is my host machine ISA. Could you please tell me how can I build the arm version? I tried to modify the "make/platform/arm_linux.mk" and "make/options.mk", but none of them work. Thanks, Chao -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150329/dafdb137/attachment.html>