Skip to content

Commit

Permalink
Merge pull request #56 from boschglobal/feature/cross_compile
Browse files Browse the repository at this point in the history
Added crosscompile toolchain file for aarch64.
  • Loading branch information
nayakned authored Dec 27, 2024
2 parents 6418084 + 1118a98 commit 1fbe09e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends meson libcmocka0 \
libcmocka-dev lcov gcovr gcc-aarch64-linux-gnu
libcmocka-dev lcov gcovr gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross binutils-aarch64-linux-gnu
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ To install Open1722 on your system run:
$ sudo make install
```

To cross-compile for aarch64 (e.g. Raspberry Pi), you can use the [toolchain file](./aarch64.toolchain) we provided. Note that this requires a fresh build process with a new ```build``` folder.
```
$ sudo apt install gcc-aarch64-linux-gnu libc6-dev-arm64-cross binutils-aarch64-linux-gnu
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../aarch64.toolchain
$ make
```

## AVTP Formats Support

AVTP protocol defines several AVTPDU type formats (see Table 6 from IEEE 1722-2016 spec).
Expand Down
8 changes: 8 additions & 0 deletions aarch64.toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm64)

set(triple aarch64-linux-gnu)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_C_COMPILER_TARGET ${triple})

0 comments on commit 1fbe09e

Please sign in to comment.