@@ -78,6 +78,51 @@ cmake ..
7878make
7979```
8080
81+ ## Cross-build for aarch64 on Ubuntu
82+
83+ First cross-build and stage SysinternalsEBPF as described in its ` BUILD.md ` .
84+ The commands below assume its staged installation is in
85+ ` ../SysinternalsEBPF/build-arm64/staging ` .
86+
87+ Install the cross compiler and target development libraries:
88+
89+ ``` shell
90+ sudo dpkg --add-architecture arm64
91+ sudo apt update
92+ sudo apt install crossbuild-essential-arm64 binutils-aarch64-linux-gnu \
93+ libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
94+ libelf-dev:arm64 zlib1g-dev:arm64 libzstd-dev:arm64 \
95+ libjson-glib-dev:arm64 libgtest-dev:arm64 libgmock-dev:arm64
96+ ```
97+
98+ Build the eBPF size checker for the build host. It inspects architecture-neutral
99+ eBPF objects during the cross-build and avoids executing aarch64 programs on
100+ the build host:
101+
102+ ``` shell
103+ cmake -S . -B build-host
104+ cmake --build build-host --target checkEBPFsizes
105+ ```
106+
107+ Configure and build the aarch64 targets:
108+
109+ ``` shell
110+ EBPF_STAGE=" $( realpath ../SysinternalsEBPF/build-arm64/staging) "
111+
112+ cmake -S . -B build-arm64 \
113+ -DCMAKE_TOOLCHAIN_FILE=cmake/aarch64-linux-gnu.cmake \
114+ -DOPENSSL_CROSS_COMPILE=aarch64-linux-gnu- \
115+ -DSYSINTERNALS_EBPF_ROOT=" $EBPF_STAGE /opt/sysinternalsEBPF" \
116+ -DSYSINTERNALS_EBPF_INCLUDE_DIR=" $EBPF_STAGE /usr/local/include" \
117+ -DSYSINTERNALS_EBPF_LIBRARY=" $EBPF_STAGE /usr/local/lib/libsysinternalsEBPF.so" \
118+ -DSYSMON_HOST_CHECK_EBPF_SIZES=" $PWD /build-host/checkEBPFsizes"
119+ cmake --build build-arm64 --parallel
120+ ```
121+
122+ The resulting ` sysmon ` , ` sysmonLogView ` , ` sysmonUnitTests ` , and
123+ ` checkEBPFsizes ` executables target aarch64. Run those executables and all
124+ runtime tests on an aarch64 Linux host; QEMU is not required.
125+
81126## Test
82127```
83128./sysmonUnitTests
0 commit comments