Skip to content

Commit

Permalink
How to make cross-compilation work with buildroot
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-xie-000 authored Nov 4, 2024
1 parent 29c71af commit 25b3547
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions doc/cross-compile/buildroot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

## How to make cross-compilation work with buildroot

1. install the build dependencies on your host PC, like: cmake, g++, clang...

2. install the `rust` tool: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`

3. add the arm64 target for rust: `rustup target add aarch64-unknown-linux-gnu`

4. modify the arm64 target name to suit your cross-compilation tool, need to create this file `~/.cargo/config.toml`, add:
```
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-buildroot-linux-gnu-gcc"
```
"aarch64-buildroot-linux-gnu-gcc" is your real cross-compilation tool name


6. source your cross-compilation buildroot environment: `source /to/your/environment-setup`, this file should be in your buildroot folder

7. add the buildroot sysroot on host PC environment: `export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/to/your/sysroot"`

8. cd iceoryx2

9. cmake -S . -B build -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=../_OUTPUT -DRUST_TARGET_TRIPLET='aarch64-unknown-linux-gnu'

10. cd build

11. make -j8

12. make install

Finally, you can get the arm64 libs, include files in _OUTPUT folder.

0 comments on commit 25b3547

Please sign in to comment.