Index: docs/HowToCrossCompileLLVM.rst =================================================================== --- docs/HowToCrossCompileLLVM.rst +++ docs/HowToCrossCompileLLVM.rst @@ -40,13 +40,14 @@ The CMake options you need to add are: - * ``-DCMAKE_CROSSCOMPILING=True`` + * ``-DCMAKE_SYSTEM_NAME=Linux`` (this is needed even if the build system is already Linux - + the presence of this flag causes CMake to enter cross-compilation mode) * ``-DCMAKE_INSTALL_PREFIX=`` - * ``-DLLVM_TABLEGEN=/llvm-tblgen`` - * ``-DCLANG_TABLEGEN=/clang-tblgen`` * ``-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf`` * ``-DLLVM_TARGET_ARCH=ARM`` * ``-DLLVM_TARGETS_TO_BUILD=ARM`` + * ``-DCMAKE_C_COMPILER`` and ``-DCMAKE_CXX_COMPILER`` if your cross capable compiler is not + the same as your default compiler. If you're compiling with GCC, you can use architecture options for your target, and the compiler driver will detect everything that it needs: @@ -64,9 +65,7 @@ * Appropriate use of ``-I`` and ``-L``, depending on how the cross GCC is installed, and where are the libraries and headers. -The TableGen options are required to compile it with the host compiler, -so you'll need to compile LLVM (or at least ``llvm-tblgen``) to your host -platform before you start. The CXX flags define the target, cpu (which in this case +The CXX flags define the target, cpu (which in this case defaults to ``fpu=VFP3`` with NEON), and forcing the hard-float ABI. If you're using Clang as a cross-compiler, you will *also* have to set ``--sysroot`` to make sure it picks the correct linker.