@@ -8,18 +8,18 @@ Introduction
88This document contains information about building and testing the builtins part
99of compiler-rt for an Arm target, from an x86_64 Linux machine.
1010
11- While this document concentrates on Arm and Linux the general principles should
11+ While this document concentrates on Arm and Linux, the general principles should
1212apply to other targets supported by compiler-rt. Further contributions for other
1313targets are welcome.
1414
1515The instructions in this document depend on libraries and programs external to
16- LLVM, there are many ways to install and configure these dependencies so you
16+ LLVM. There are many ways to install and configure these dependencies, so you
1717may need to adapt the instructions here to fit your own situation.
1818
1919Prerequisites
2020=============
2121
22- In this use case we will be using cmake on a Debian-based Linux system,
22+ In this use case, we will be using cmake on a Debian-based Linux system,
2323cross-compiling from an x86_64 host to a hard-float Armv7-A target. We will be
2424using as many of the LLVM tools as we can, but it is possible to use GNU
2525equivalents.
@@ -35,7 +35,7 @@ You will need:
3535 An existing sysroot is required because some of the builtins include C library
3636 headers and a sysroot is the easiest way to get those.
3737
38- In this example we will be using ``ninja `` as the build tool.
38+ In this example, we will be using ``ninja `` as the build tool.
3939
4040See https://compiler-rt.llvm.org/ for information about the dependencies
4141on clang and LLVM.
@@ -46,7 +46,7 @@ the source for LLVM and compiler-rt.
4646``qemu-arm `` should be available as a package for your Linux distribution.
4747
4848The most complicated of the prerequisites to satisfy is the ``arm-linux-gnueabihf ``
49- sysroot. In theory it is possible to use the Linux distributions multiarch
49+ sysroot. In theory, it is possible to use the Linux distributions multiarch
5050support to fulfill the dependencies for building but unfortunately due to
5151``/usr/local/include `` being added some host includes are selected.
5252
@@ -153,7 +153,7 @@ The cmake try compile stage fails
153153At an early stage cmake will attempt to compile and link a simple C program to
154154test if the toolchain is working.
155155
156- This stage can often fail at link time if the ``--sysroot= ``, ``--target `` or
156+ This stage can often fail at link time if the ``--sysroot= ``, ``--target ``, or
157157``--gcc-toolchain= `` options are not passed to the compiler. Check the
158158``CMAKE_<LANGUAGE>_FLAGS `` and ``CMAKE_<LANGAUGE>_COMPILER_TARGET `` flags along
159159with any of the specific CMake sysroot and toolchain options.
@@ -165,7 +165,7 @@ to make sure it is working. For example::
165165
166166Clang uses the host header files
167167--------------------------------
168- On debian based systems it is possible to install multiarch support for
168+ On Debian- based systems, it is possible to install multiarch support for
169169``arm-linux-gnueabi `` and ``arm-linux-gnueabihf ``. In many cases clang can successfully
170170use this multiarch support when ``--gcc-toolchain= `` and ``--sysroot= `` are not supplied.
171171Unfortunately clang adds ``/usr/local/include `` before
@@ -177,8 +177,8 @@ use a separate ``arm-linux-gnueabihf`` toolchain.
177177
178178No target passed to clang
179179-------------------------
180- If clang is not given a target it will typically use the host target, this will
181- not understand the Arm assembly language files resulting in error messages such
180+ If clang is not given a target, it will typically use the host target. This will
181+ not understand the Arm assembly language files, resulting in error messages such
182182as ``error: unknown directive .syntax unified ``.
183183
184184You can check the clang invocation in the error message to see if there is no
@@ -217,7 +217,7 @@ target to use is:
217217
218218* ``-DCMAKE_C_COMPILER_TARGET=arm-linux-gnueabi ``
219219
220- Depending on whether you want to use floating point instructions or not you
220+ Depending on whether you want to use floating point instructions or not, you
221221may need extra c-flags such as ``-mfloat-abi=softfp `` for use of floating-point
222222instructions, and ``-mfloat-abi=soft -mfpu=none `` for software floating-point
223223emulation.
@@ -241,7 +241,7 @@ To build and test the libraries using a similar method to Armv7-A is possible
241241but more difficult. The main problems are:
242242
243243* There is not a ``qemu-arm `` user-mode emulator for bare-metal systems.
244- ``qemu-system-arm `` can be used but this is significantly more difficult
244+ ``qemu-system-arm `` can be used, but this is significantly more difficult
245245 to setup. This document does not explain how to do this.
246246* The targets to compile compiler-rt have the suffix ``-none-eabi ``. This uses
247247 the BareMetal driver in clang and by default will not find the libraries
@@ -252,8 +252,8 @@ that are supported on Armv7-A we can still get most of the value of running the
252252tests using the same ``qemu-arm `` that we used for Armv7-A by building and
253253running the test cases for Armv7-A but using the builtins compiled for
254254Armv6-M, Armv7-M or Armv7E-M. This will test that the builtins can be linked
255- into a binary and execute the tests correctly but it will not catch if the
256- builtins use instructions that are supported on Armv7-A but not Armv6-M,
255+ into a binary and execute the tests correctly, but it will not catch if the
256+ builtins use instructions that are supported on Armv7-A but not on Armv6-M,
257257Armv7-M and Armv7E-M.
258258
259259This requires a second ``arm-none-eabi `` toolchain for building the builtins.
@@ -321,9 +321,9 @@ command for Armv7-A build and test::
321321
322322The Armv6-M builtins will use the soft-float ABI. When compiling the tests for
323323Armv7-A we must include ``"-mthumb -mfloat-abi=soft -mfpu=none" `` in the
324- test-c-flags. We must use an Armv7-A soft-float abi sysroot for ``qemu-arm ``.
324+ test-c-flags. We must use an Armv7-A soft-float ABI sysroot for ``qemu-arm ``.
325325
326- Depending on the linker used for the test cases you may encounter BuildAttribute
326+ Depending on the linker used for the test cases, you may encounter BuildAttribute
327327mismatches between the M-profile objects from compiler-rt and the A-profile
328328objects from the test. The lld linker does not check the profile
329329BuildAttribute so it can be used to link the tests by adding ``-fuse-ld=lld `` to the
0 commit comments