[llvm-dev] Help building compiler-rt for a new cross target?

Peter Smith via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 2 03:06:03 PDT 2017


Hello John,

I don't know of any recipe for cross-compiling for a new target. I'm
intending to write up some recent experience with cross-compiling the
builtins and running tests via qemu for Arm and AArch64 targets. I
don't have any experience in adding a new target though. If I were to
do it myself I'd start by finding the references to an already
supported target that most closely matches the new one and fill it out
from there. You have my sympathies as it took quite a few failed
experiments to get cross-compilation working.

My guess is that your cmake output has a blank for "-- Compiler-RT
supported architectures: ", there are some internal tests in
compiler-rt to check whether your target is supported or not. If you
haven't already set it, I suggest using
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON and
-DCMAKE_C_COMPILER_TARGET="Your target". The next place I'd check is
whether you need to add your target to lib/builtins/CMakeLists.txt,
I'm not sure if GENERIC_SOURCES are added by default.

I've found the cmake option --trace-expand useful in debugging what is
happening.

Hope this is of some use.

Peter


More information about the llvm-dev mailing list