I am attempting to port an operating system project to use Clang/LLVM instead of GCC, but I'm having issues with Compiler-RT. Right now, the OS is being cross-compiled on an x86_64 host targeting ARMv7a. I built the LLVM toolchain according to the instructions, though I limited the supported targets to arm, x86, and x86_64 to reduce compilation time. I'm finding that compilation proceeds fine but fails at the linking stage due to missing compiler builtins. When I examined the build log for the LLVM toolchain, I found that Compiler-RT was only being built for x86_64. So, as a stopgap, I've started linking against the existing cross-compiled libgcc to fill in the gaps. However, I'm trying to find out what I need to do to cross-compile Compiler-RT's builtins library for ARMv7 so I can use it to replace libgcc. Any help here would be appreciated. Thanks, Kev Kitchens -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140303/9fcfc34f/attachment.html>
On 4 March 2014 04:00, Kev Kitchens <kitchens.sync at me.com> wrote:> I've started linking against the existing cross-compiled libgcc to fill in > the gaps. However, I'm trying to find out what I need to do to cross-compile > Compiler-RT's builtins library for ARMv7 so I can use it to replace libgcc. > Any help here would be appreciated.Hi Kev, Non-Darwin Compiler-RT support for ARMv7 is patchy. I've ran some tests and found some bugs (that I have yet to investigate and report), but I wouldn't replace it yet in production, and certainly not when cross-compiling, as I don't know if it even works. It could be just a matter of fixing the CMake/autoconf files, or it could be some more work, but if you're just trying to use LLVM instead of GCC, I'd go without RT for the moment. cheers, --renato
On 4 March 2014 04:00, Kev Kitchens <kitchens.sync at me.com> wrote:> I've started linking against the existing cross-compiled libgcc to fill in > the gaps. However, I'm trying to find out what I need to do to cross-compile > Compiler-RT's builtins library for ARMv7 so I can use it to replace libgcc. > Any help here would be appreciated.Hi Kev, Non-Darwin Compiler-RT support for ARMv7 is patchy. I've ran some tests and found some bugs (that I have yet to investigate and report), but I wouldn't replace it yet in production, and certainly not when cross-compiling, as I don't know if it even works. It could be just a matter of fixing the CMake/autoconf files, or it could be some more work, but if you're just trying to use LLVM instead of GCC, I'd go without RT for the moment. cheers, --renato
I've implemented something like this in Rust's fork of compiler-rt<https://github.com/rust-lang/compiler-rt/commits/rust-2014-02-17-do-not-delete>. Note that this can only be built via makefile, and, I suspect, my change does not do a good job at figuring out appropriate gcc flags for each platform, because I expect CFLAGS to be passed along from the parent project's build script. On the plus side, it seems to work on all platforms that Rust currently supports (Linux, Windows, OSX, FreeBSD, Android), so Rust (almost) doesn't need libgcc anymore. ("almost" because there's still no replacement for stack unwinding routines). On Mon, Mar 3, 2014 at 12:00 PM, Kev Kitchens <kitchens.sync at me.com> wrote:> I am attempting to port an operating system project to use Clang/LLVM > instead of GCC, but I'm having issues with Compiler-RT. Right now, the OS > is being cross-compiled on an x86_64 host targeting ARMv7a. I built the > LLVM toolchain according to the instructions, though I limited the > supported targets to arm, x86, and x86_64 to reduce compilation time. I'm > finding that compilation proceeds fine but fails at the linking stage due > to missing compiler builtins. When I examined the build log for the LLVM > toolchain, I found that Compiler-RT was only being built for x86_64. So, as > a stopgap, I've started linking against the existing cross-compiled libgcc > to fill in the gaps. However, I'm trying to find out what I need to do to > cross-compile Compiler-RT's builtins library for ARMv7 so I can use it to > replace libgcc. Any help here would be appreciated. > > > > Thanks, > > Kev Kitchens > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140304/b7cc44b1/attachment.html>
On 4 Mar 2014, at 09:14, Vadim Chugunov <vadimcn at gmail.com> wrote:> ("almost" because there's still no replacement for stack unwinding routines).And comments like this are why we should move the stack unwind routines from libc++abi into libunwind... David
Reasonably Related Threads
- [RFC] Strategies for Bootstrapping Compiler-RT builtins
- [LLVMdev] [Compiler-RT] [ARM] Where __aeabi_[il]div0 builtins should be implemented?
- [LLVMdev] [compiler-rt] is the arm lib complete?
- Running the compiler-rt builtins unit tests
- [LLVMdev] [compiler-rt] is the arm lib complete?