Micah Villmow | 6f6ea93 | 2012-09-27 22:14:10 +0000 | [diff] [blame] | 1 | =================================================================== |
| 2 | How To Build On ARM |
| 3 | =================================================================== |
| 4 | |
Micah Villmow | 6f6ea93 | 2012-09-27 22:14:10 +0000 | [diff] [blame] | 5 | Introduction |
| 6 | ============ |
| 7 | |
| 8 | This document contains information about building/testing LLVM and |
Renato Golin | 36fd952 | 2013-09-27 21:14:54 +0000 | [diff] [blame^] | 9 | Clang on an ARM machine. |
| 10 | |
| 11 | This document is *NOT* tailored to help you cross-compile LLVM/Clang |
| 12 | to ARM on another architecture, for example an x86_64 machine. To find |
| 13 | out more about cross-compiling, please check :doc:`HowToCrossCompileLLVM`. |
Micah Villmow | 6f6ea93 | 2012-09-27 22:14:10 +0000 | [diff] [blame] | 14 | |
| 15 | Notes On Building LLVM/Clang on ARM |
| 16 | ===================================== |
| 17 | Here are some notes on building/testing LLVM/Clang on ARM. Note that |
| 18 | ARM encompasses a wide variety of CPUs; this advice is primarily based |
| 19 | on the ARMv6 and ARMv7 architectures and may be inapplicable to older chips. |
| 20 | |
| 21 | #. If you are building LLVM/Clang on an ARM board with 1G of memory or less, |
| 22 | please use ``gold`` rather then GNU ``ld``. |
| 23 | Building LLVM/Clang with ``--enable-optimized`` |
| 24 | is prefered since it consumes less memory. Otherwise, the building |
| 25 | process will very likely fail due to insufficient memory. In any |
| 26 | case it is probably a good idea to set up a swap partition. |
| 27 | |
| 28 | #. If you want to run ``make |
| 29 | check-all`` after building LLVM/Clang, to avoid false alarms (eg, ARCMT |
David Tweed | 6f20194 | 2012-10-26 12:09:47 +0000 | [diff] [blame] | 30 | failure) please use at least the following configuration: |
Micah Villmow | 6f6ea93 | 2012-09-27 22:14:10 +0000 | [diff] [blame] | 31 | |
| 32 | .. code-block:: bash |
| 33 | |
David Tweed | 6f20194 | 2012-10-26 12:09:47 +0000 | [diff] [blame] | 34 | $ ../$LLVM_SRC_DIR/configure --with-abi=aapcs-vfp |
| 35 | |
| 36 | #. The most popular linaro/ubuntu OS's for ARM boards, eg, the |
| 37 | Pandaboard, have become hard-float platforms. The following set |
| 38 | of configuration options appears to be a good choice for this |
| 39 | platform: |
| 40 | |
| 41 | .. code-block:: bash |
| 42 | |
Renato Golin | 035a1f4 | 2013-02-25 18:25:58 +0000 | [diff] [blame] | 43 | ./configure --build=armv7l-unknown-linux-gnueabihf \ |
| 44 | --host=armv7l-unknown-linux-gnueabihf \ |
| 45 | --target=armv7l-unknown-linux-gnueabihf --with-cpu=cortex-a9 \ |
| 46 | --with-float=hard --with-abi=aapcs-vfp --with-fpu=neon \ |
| 47 | --enable-targets=arm --enable-optimized --enable-assertions |