Cross Compiling CompilerRT

Hi,

I would like to build CompilerRT (builtins) for our architecture from an x86 host archticture.
However, in the main CMakeLists.txt file it says:

# An important constraint of the build is that it only produces libraries
# based on the ability of the host toolchain to target various platforms.

Does that mean I would have to compile clang + LLVM with x86 and our own architecture as
configured targets first and do a subsequent build to be able to cross compile CompilerRT?
Or is there an easier way to bring compilerRT to build it for our CPU?

Regards,
Jan Tlatlik

Hi,

I would like to build CompilerRT (builtins) for our architecture from an
x86 host archticture.
However, in the main CMakeLists.txt file it says:

# An important constraint of the build is that it only produces libraries
# based on the ability of the host toolchain to target various platforms.

Does that mean I would have to compile clang + LLVM with x86 and our own
architecture as
configured targets first and do a subsequent build to be able to cross
compile CompilerRT?
Or is there an easier way to bring compilerRT to build it for our CPU?

If you are building with CMake, set -DLLVM_BUILD_EXTERNAL_COMPILER_RT=On, and it will use the just-built clang to build compiler-rt. Then you won't have to worry about bootstrapping clang.

The autotools build works this way by default.

Jon