|
1 | 1 | # How to make cross-compilation work with buildroot |
2 | 2 |
|
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: |
5 | 6 |
|
6 | 7 | ```console |
7 | 8 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
8 | 9 | ``` |
9 | 10 |
|
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: |
13 | 21 | ```console |
14 | 22 | [target.aarch64-unknown-linux-gnu] |
15 | 23 | linker = "aarch64-buildroot-linux-gnu-gcc" |
16 | 24 | ``` |
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: |
21 | 34 |
|
22 | | -6. add the buildroot sysroot on host PC environment: |
23 | 35 | ```console |
24 | 36 | export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/to/your/sysroot" |
25 | 37 | ``` |
| 38 | + |
26 | 39 | 7. Change to the iceoryx2 directory |
27 | 40 |
|
28 | 41 | ```console |
29 | 42 | cd iceoryx2 |
30 | 43 | ``` |
31 | 44 |
|
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 | + ``` |
38 | 51 |
|
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