Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions docs/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,27 @@ format in the arm-multilib/json/variants folder, which can be loaded at
configuration with the `-DVARIANT_JSON` setting. Any additional options
provided on the command line will override values from he JSON. `-DC_LIBRARY`
will be required to set which library to build, and `-DLLVM_BINARY_DIR` should
point to a build or install of LLVM.
point to the top-level directory of a build or install of LLVM.

(The actual binaries, such as `clang`, are expected to be in
`$LLVM_BINARY_DIR/bin`, not `$LLVM_BINARY_DIR` itself. For example, if you're
using the results of a full build of this toolchain itself in another
directory, then you should set `LLVM_BINARY_DIR` to point at the `llvm`
subdirectory of the previous build tree, not the `llvm/bin` subdirectory.)

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

```
cd LLVM-embedded-toolchain-for-Arm
mkdir build-lib
cd build-lib
cmake ../arm-runtimes -G Ninja \
-DVARIANT_JSON=../arm-multilib/json/variants/armv7a_soft_nofp.json \
-DC_LIBRARY=picolibc \
-DLLVM_BINARY_DIR=/path/to/llvm \
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
-DC_LIBRARY=picolibc \
-DLLVM_BINARY_DIR=/path/to/llvm \
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
ninja
```

Expand Down Expand Up @@ -213,12 +220,13 @@ source checkouts:
```
cd LLVM-embedded-toolchain-for-Arm
mkdir build-multilib
cd build-multilib
cmake ../arm-multilib -G Ninja \
-DMULTILIB_JSON=../arm-multilib/json/multilib.json \
-DC_LIBRARY=picolibc \
-DLLVM_BINARY_DIR=/path/to/llvm \
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
-DC_LIBRARY=picolibc \
-DLLVM_BINARY_DIR=/path/to/llvm \
-DFETCHCONTENT_SOURCE_DIR_LLVMPROJECT=/path/to/llvm-project \
-DFETCHCONTENT_SOURCE_DIR_PICOLIBC=/path/to/picolibc
ninja
```
To only build a subset of the variants defined in the JSON file,
Expand Down
Loading