Skip to content

Commit 034f1ac

Browse files
committed
[#453] Document how to make cross-compilation work with buildroot
1 parent 7aa6411 commit 034f1ac

1 file changed

Lines changed: 30 additions & 17 deletions

File tree

doc/cross-compile/buildroot.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,52 @@
11
# How to make cross-compilation work with buildroot
22

3-
1. install the build dependencies on your host PC, like: cmake, g++, clang...
4-
2. install the `rust` toolchain:
3+
1. Install the build dependencies on your host PC, like: cmake, g++, clang...
4+
5+
2. Install the `rust` toolchain:
56

67
```console
78
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
89
```
910

10-
3. add the arm64 target for Rust: `rustup target add aarch64-unknown-linux-gnu`
11-
4. modify the arm64 target name to suit your cross-compilation tool, need to
12-
create this file `~/.cargo/config.toml`, add:
11+
3. Add the arm64 target for Rust:
12+
13+
```console
14+
rustup target add aarch64-unknown-linux-gnu
15+
```
16+
17+
4. Modify the arm64 target name to suit your cross-compilation tool, need to
18+
create this file `~/.cargo/config.toml`, add the below code,
19+
"aarch64-buildroot-linux-GNU-gcc" which is your real cross-compilation tool
20+
name:
1321
```console
1422
[target.aarch64-unknown-linux-gnu]
1523
linker = "aarch64-buildroot-linux-gnu-gcc"
1624
```
17-
"aarch64-buildroot-linux-GNU-gcc" is your real cross-compilation tool name
18-
5. source your cross-compilation buildroot environment:
19-
`source /to/your/environment-setup`, this file should be in your buildroot
20-
folder
25+
5. Source your cross-compilation buildroot environment:
26+
27+
```console
28+
source /to/your/environment-setup
29+
```
30+
31+
The `environment-setup` file should be in your buildroot directory.
32+
33+
6. Add the buildroot sysroot on host PC environment:
2134

22-
6. add the buildroot sysroot on host PC environment:
2335
```console
2436
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/to/your/sysroot"
2537
```
38+
2639
7. Change to the iceoryx2 directory
2740

2841
```console
2942
cd iceoryx2
3043
```
3144

32-
8. cmake -S . -B build -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../\_OUTPUT
33-
-DRUST_TARGET_TRIPLET='aarch64-unknown-linux-GNU'
34-
35-
9. make -j8
36-
37-
10. make install
45+
8. Configure, build and install iceoryx2
46+
```console
47+
cmake -S . -B build -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../\_OUTPUT -DRUST_TARGET_TRIPLET='aarch64-unknown-linux-GNU'
48+
cmake --build build
49+
cmake --install build
50+
```
3851

39-
Finally, you can get the arm64 libs, include files in the `_OUTPUT` folder.
52+
Finally, you can get the arm64 libs, include files in the `_OUTPUT` directory.

0 commit comments

Comments
 (0)