Skip to content

Commit 3e57680

Browse files
kazutakahirataDebadri Basak
authored andcommitted
[llvm] Proofread HowToCrossCompileBuiltinsOnArm.rst (llvm#165655)
1 parent 3ec8b71 commit 3e57680

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

llvm/docs/HowToCrossCompileBuiltinsOnArm.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ Introduction
88
This document contains information about building and testing the builtins part
99
of 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
1212
apply to other targets supported by compiler-rt. Further contributions for other
1313
targets are welcome.
1414

1515
The 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
1717
may need to adapt the instructions here to fit your own situation.
1818

1919
Prerequisites
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,
2323
cross-compiling from an x86_64 host to a hard-float Armv7-A target. We will be
2424
using as many of the LLVM tools as we can, but it is possible to use GNU
2525
equivalents.
@@ -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

4040
See https://compiler-rt.llvm.org/ for information about the dependencies
4141
on 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

4848
The 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
5050
support 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
153153
At an early stage cmake will attempt to compile and link a simple C program to
154154
test 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
159159
with any of the specific CMake sysroot and toolchain options.
@@ -165,7 +165,7 @@ to make sure it is working. For example::
165165

166166
Clang 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
170170
use this multiarch support when ``--gcc-toolchain=`` and ``--sysroot=`` are not supplied.
171171
Unfortunately clang adds ``/usr/local/include`` before
@@ -177,8 +177,8 @@ use a separate ``arm-linux-gnueabihf`` toolchain.
177177

178178
No 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
182182
as ``error: unknown directive .syntax unified``.
183183

184184
You 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
221221
may need extra c-flags such as ``-mfloat-abi=softfp`` for use of floating-point
222222
instructions, and ``-mfloat-abi=soft -mfpu=none`` for software floating-point
223223
emulation.
@@ -241,7 +241,7 @@ To build and test the libraries using a similar method to Armv7-A is possible
241241
but 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
252252
tests using the same ``qemu-arm`` that we used for Armv7-A by building and
253253
running the test cases for Armv7-A but using the builtins compiled for
254254
Armv6-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,
257257
Armv7-M and Armv7E-M.
258258

259259
This requires a second ``arm-none-eabi`` toolchain for building the builtins.
@@ -321,9 +321,9 @@ command for Armv7-A build and test::
321321

322322
The Armv6-M builtins will use the soft-float ABI. When compiling the tests for
323323
Armv7-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
327327
mismatches between the M-profile objects from compiler-rt and the A-profile
328328
objects from the test. The lld linker does not check the profile
329329
BuildAttribute so it can be used to link the tests by adding ``-fuse-ld=lld`` to the

0 commit comments

Comments
 (0)