Skip to content

Commit d0b2af2

Browse files
authored
Docs fixes for arm-runtimes and arm-multilib sub-builds. (#575)
The suggested build commands left out the usual `cd` after `mkdir`, so that if you followed them literally, you'd create an `arm-runtimes` or `arm-multilib` directory and then ignore it completely and put all your build debris at the level above it. Also, trying to follow the instructions, I was confused by the semantics of `LLVM_BINARY_DIR`: given the name, I instinctively pointed it at the actual `bin` directory, but it turned out I should have aimed one level up. Added some clarifying text, with particular reference to using a full build of this toolchain for a standalone build of one library. While I'm here, removed some apparently accidental physical tabs, so that all the continuation lines in the long cmake commands line up.
1 parent 6209eba commit d0b2af2

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/building-from-source.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,27 @@ format in the arm-multilib/json/variants folder, which can be loaded at
171171
configuration with the `-DVARIANT_JSON` setting. Any additional options
172172
provided on the command line will override values from he JSON. `-DC_LIBRARY`
173173
will be required to set which library to build, and `-DLLVM_BINARY_DIR` should
174-
point to a build or install of LLVM.
174+
point to the top-level directory of a build or install of LLVM.
175+
176+
(The actual binaries, such as `clang`, are expected to be in
177+
`$LLVM_BINARY_DIR/bin`, not `$LLVM_BINARY_DIR` itself. For example, if you're
178+
using the results of a full build of this toolchain itself in another
179+
directory, then you should set `LLVM_BINARY_DIR` to point at the `llvm`
180+
subdirectory of the previous build tree, not the `llvm/bin` subdirectory.)
175181

176182
For example, to build the `armv7a_soft_nofp` variant using `picolibc`, using
177183
an existing LLVM build and source checkouts:
178184

179185
```
180186
cd LLVM-embedded-toolchain-for-Arm
181187
mkdir build-lib
188+
cd build-lib
182189
cmake ../arm-runtimes -G Ninja \
183190
-DVARIANT_JSON=../arm-multilib/json/variants/armv7a_soft_nofp.json \
184-
-DC_LIBRARY=picolibc \
185-
-DLLVM_BINARY_DIR=/path/to/llvm \
186-
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
187-
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
191+
-DC_LIBRARY=picolibc \
192+
-DLLVM_BINARY_DIR=/path/to/llvm \
193+
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
194+
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
188195
ninja
189196
```
190197

@@ -213,12 +220,13 @@ source checkouts:
213220
```
214221
cd LLVM-embedded-toolchain-for-Arm
215222
mkdir build-multilib
223+
cd build-multilib
216224
cmake ../arm-multilib -G Ninja \
217225
-DMULTILIB_JSON=../arm-multilib/json/multilib.json \
218-
-DC_LIBRARY=picolibc \
219-
-DLLVM_BINARY_DIR=/path/to/llvm \
220-
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
221-
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
226+
-DC_LIBRARY=picolibc \
227+
-DLLVM_BINARY_DIR=/path/to/llvm \
228+
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
229+
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
222230
ninja
223231
```
224232
To only build a subset of the variants defined in the JSON file,

0 commit comments

Comments
 (0)