From 7f2576ddb0ae5269fb65e77b4d73db21e2b5bfe5 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Mon, 9 Sep 2013 19:05:03 +0000 Subject: [PATCH] [docs] Some typographical fixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190324 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/HowToCrossCompileLLVM.rst | 73 ++++++++++++++++------------------ 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/docs/HowToCrossCompileLLVM.rst b/docs/HowToCrossCompileLLVM.rst index 0e3298f7937..1072517e4c2 100644 --- a/docs/HowToCrossCompileLLVM.rst +++ b/docs/HowToCrossCompileLLVM.rst @@ -22,15 +22,15 @@ nowadays) to a hard-float ARM target (most ARM targets nowadays). The packages you'll need are: - * cmake - * ninja-build (from backports in Ubuntu) - * gcc-4.7-arm-linux-gnueabihf - * gcc-4.7-multilib-arm-linux-gnueabihf - * binutils-arm-linux-gnueabihf - * libgcc1-armhf-cross - * libsfgcc1-armhf-cross - * libstdc++6-armhf-cross - * libstdc++6-4.7-dev-armhf-cross + * ``cmake`` + * ``ninja-build`` (from backports in Ubuntu) + * ``gcc-4.7-arm-linux-gnueabihf`` + * ``gcc-4.7-multilib-arm-linux-gnueabihf`` + * ``binutils-arm-linux-gnueabihf`` + * ``libgcc1-armhf-cross`` + * ``libsfgcc1-armhf-cross`` + * ``libstdc++6-armhf-cross`` + * ``libstdc++6-4.7-dev-armhf-cross`` Configuring CMake ----------------- @@ -39,32 +39,29 @@ For more information on how to configure CMake for LLVM/Clang, see :doc:`CMake`. The CMake options you need to add are: - * -DCMAKE_CROSSCOMPILING=True - * -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_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9 - -I/usr/arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf/ - -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard - -ccc-gcc-name arm-linux-gnueabihf-gcc' + * ``-DCMAKE_CROSSCOMPILING=True`` + * ``-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_CXX_FLAGS='-target armv7a-linux-gnueabihf -mcpu=cortex-a9 -I/usr/arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf/ -I/usr/arm-linux-gnueabihf/include/ -mfloat-abi=hard -ccc-gcc-name arm-linux-gnueabihf-gcc'`` 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 +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 -defaults to fpu=VFP3 with NEON), and forcing the hard-float ABI. If you're +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 ``-ccc-gcc-name``, to make sure it picks the correct linker. Most of the time, what you want is to have a native compiler to the platform itself, but not others. It might not even be feasible to produce x86 binaries from ARM targets, so there's no point in compiling -all back-ends. For that reason, you should also set the "TARGETS_TO_BUILD" -to only build the ARM back-end. +all back-ends. For that reason, you should also set the +``TARGETS_TO_BUILD`` to only build the ARM back-end. -You must set the CMAKE_INSTALL_PREFIX, otherwise a ``ninja install`` +You must set the ``CMAKE_INSTALL_PREFIX``, otherwise a ``ninja install`` will copy ARM binaries to your root filesystem, which is not what you want. @@ -76,7 +73,7 @@ running CMake: #. If you're using Clang as the cross-compiler, there is a problem in the LLVM ARM back-end that is producing absolute relocations on - position-independent code (R_ARM_THM_MOVW_ABS_NC), so for now, you + position-independent code (``R_ARM_THM_MOVW_ABS_NC``), so for now, you should disable PIC: .. code-block:: bash @@ -88,25 +85,25 @@ running CMake: #. The ARM libraries won't be installed in your system, and possibly not easily installable anyway, so you'll have to build/download - them separately. But the CMake prepare step, which check for - dependencies, will check the `host` libraries, not the `target` + them separately. But the CMake prepare step, which checks for + dependencies, will check the *host* libraries, not the *target* ones. A quick way of getting the libraries is to download them from a distribution repository, like Debian (http://packages.debian.org/wheezy/), - and download the missing libraries. Note that the `libXXX` - will have the shared objects (.so) and the `libXXX-dev` will - give you the headers and the static (.a) library. Just in + and download the missing libraries. Note that the ``libXXX`` + will have the shared objects (``.so``) and the ``libXXX-dev`` will + give you the headers and the static (``.a``) library. Just in case, download both. The ones you need for ARM are: ``libtinfo``, ``zlib1g``, ``libxml2`` and ``liblzma``. In the Debian repository you'll find downloads for all architectures. - After you download and unpack all `.deb` packages, copy all + After you download and unpack all ``.deb`` packages, copy all ``.so`` and ``.a`` to a directory, make the appropriate symbolic links (if necessary), and add the relevant ``-L`` - and ``-I`` paths to -DCMAKE_CXX_FLAGS above. + and ``-I`` paths to ``-DCMAKE_CXX_FLAGS`` above. Running CMake and Building @@ -124,9 +121,9 @@ If you're using Clang as the cross-compiler, run: $ CC='clang' CXX='clang++' cmake -G Ninja -If you have clang/clang++ on the path, it should just work, and special +If you have ``clang``/``clang++`` on the path, it should just work, and special Ninja files will be created in the build directory. I strongly suggest -you to run cmake on a separate build directory, *not* inside the +you to run ``cmake`` on a separate build directory, *not* inside the source tree. To build, simply type: @@ -151,7 +148,7 @@ via: $ ninja install -which will create a sysroot on the install-dir. You can then TarGz +which will create a sysroot on the install-dir. You can then tar that directory into a binary with the full triple name (for easy identification), like: @@ -160,9 +157,9 @@ identification), like: $ ln -sf arm-linux-gnueabihf-clang $ tar zchf arm-linux-gnueabihf-clang.tar.gz arm-linux-gnueabihf-clang -If you copy that TarBall to your target board, you'll be able to use +If you copy that tarball to your target board, you'll be able to use it for running the test-suite, for example. Follow the guidelines at -http://llvm.org/docs/lnt/quickstart.html, unpack the TarBall in the +http://llvm.org/docs/lnt/quickstart.html, unpack the tarball in the test directory, and use options: .. code-block:: bash