Skip to content

Commit

Permalink
cmake: Fix eBPF include path for all arches
Browse files Browse the repository at this point in the history
Fix eBPF include path for all arches by using corresponding cmake variable.

That works for all multi arch systems.

Link: xdp-project/xdp-tools#4
Link: xdp-project/xdp-tools#408
Signed-off-by: Kurt Kanzenbach <[email protected]>
Reviewed-by: Sebastian Andrzej Siewior <[email protected]>
  • Loading branch information
shifty91 committed Feb 10, 2025
1 parent c200f0a commit b533aaf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ include_directories("${PROJECT_BINARY_DIR}")
#
# Add code for compiling XDP eBPF programes.
#
execute_process(COMMAND uname -m OUTPUT_VARIABLE BUILD_ARCH ERROR_QUIET)
string(STRIP "${BUILD_ARCH}" BUILD_ARCH)
set(ASM_INCLUDE "/usr/include/${BUILD_ARCH}-linux-gnu")
set(ASM_INCLUDE "/usr/include/${CMAKE_C_LIBRARY_ARCHITECTURE}")
set(CLANG_FLAGS -S --target=bpf -D __BPF_TRACING__ -Wall -O2 -fno-stack-protector -emit-llvm -g -I ${ASM_INCLUDE})
set(LLC_FLAGS -march=bpf -filetype=obj)

Expand Down

0 comments on commit b533aaf

Please sign in to comment.