How do I cross-compile compiler-rt for ARM-Linux with CMake? Given a directory with sub-directories named 'llvm', 'compiler-rt', and 'release' (which is a clang build directory), this build succeeds: $ mkdir -p release-rt $ cd release-rt $ cmake ../llvm -G Ninja \ -DCMAKE_INSTALL_PREFIX=ship \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_TARGETS_TO_BUILD=ARM \ -DLLVM_DEFAULT_TARGET_TRIPLE=arm-none-linux-gnueabi \ -DLLVM_TARGET_ARCH=arm-none-linux-gnueabi \ -DCMAKE_C_COMPILER=`which arm-none-linux-gnueabi-gcc` \ -DCMAKE_CXX_COMPILER=`which arm-none-linux-gnueabi-g++` \ -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=../compiler-rt \ -DCMAKE_CROSSCOMPILING=True \ -DLLVM_TABLEGEN=`pwd`/../release/ship/bin/llvm-tblgen $ ninja install As a sanity-check, I was expecting to see a 'lib' directory for the sanitizers in 'lib/clang/3.5', but there's only an 'include' directory. For Android, I've used the toolchain file in llvm/cmake, but for ARM-Linux I'm attempting a variation of the cross-compiled clang build: http://llvm.org/docs/HowToCrossCompileLLVM.html Are there compiler-rt-specific instructions somewhere? Thanks, Greg
On 17 December 2013 22:09, Greg Fitzgerald <garious at gmail.com> wrote:> http://llvm.org/docs/HowToCrossCompileLLVM.html > > Are there compiler-rt-specific instructions somewhere? >Not that I know of, and I always build compiler-rt natively, together with Clang and LLVM. :( Would be great if you could write one, though. ;) cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131217/2910e517/attachment.html>
> Not that I know of, and I always build compiler-rt natively, together with Clang and LLVM. :(Do you mean "natively on ARM" or "natively on X86 with the ARM target enabled"? If the former, do you have a script to merge the target libs into the host's install directory? If the latter, that'll only build the X86 versions of the compiler-rt libraries.> Would be great if you could write one, though. ;)if only I knew what content to add :) -Greg On Tue, Dec 17, 2013 at 2:22 PM, Renato Golin <renato.golin at linaro.org> wrote:> On 17 December 2013 22:09, Greg Fitzgerald <garious at gmail.com> wrote: >> >> http://llvm.org/docs/HowToCrossCompileLLVM.html >> >> Are there compiler-rt-specific instructions somewhere? > > > Not that I know of, and I always build compiler-rt natively, together with > Clang and LLVM. :( > > Would be great if you could write one, though. ;) > > cheers, > --renato