File: with-ebpf-includes.patch

package info (click to toggle)
suricata 1%3A8.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240,704 kB
  • sloc: ansic: 357,736; python: 8,721; sh: 5,043; makefile: 2,411; perl: 570; php: 170
file content (43 lines) | stat: -rw-r--r-- 1,490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Hilko Bengen <bengen@debian.org>
Date: Tue, 23 Jul 2019 14:43:21 +0200
Subject: Add --with-ebpf-includes parameter

---
 configure.ac     | 4 ++++
 ebpf/Makefile.am | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

--- a/configure.ac
+++ b/configure.ac
@@ -508,7 +508,11 @@
                     AC_SUBST(LLC)
                   ],
                   [AC_MSG_ERROR([clang needed to build ebpf files])])
-            AC_MSG_CHECKING([libbpf has bpf/bpf_helpers.h])
+            AC_ARG_WITH(ebpf_includes,
+                    [  --with-ebpf-includes=DIR  include directory for building eBPF programs],
+                    [AC_SUBST([ebpf_includes],["$withval"])],
+                    [AC_SUBST([ebpf_includes],["/usr/include/${build_alias}"])])
+	    AC_MSG_CHECKING([libbpf has bpf/bpf_helpers.h])
             AC_COMPILE_IFELSE(
                 [AC_LANG_PROGRAM(
                     [
--- a/ebpf/Makefile.am
+++ b/ebpf/Makefile.am
@@ -4,7 +4,7 @@
 if BUILD_EBPF
 
 # Maintaining a local copy of UAPI linux/bpf.h
-BPF_CFLAGS = -Iinclude
+BPF_CFLAGS = -Iinclude -I$(ebpf_includes)
 
 BPF_TARGETS  = lb.bpf
 BPF_TARGETS += filter.bpf
@@ -19,7 +19,6 @@
 $(BPF_TARGETS): %.bpf: %.c
 #      From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm)
 	${CLANG} -Wall $(BPF_CFLAGS) -O2 -g \
-		-I/usr/include/$(build_cpu)-$(build_os)/ \
 		-D__KERNEL__ -D__ASM_SYSREG_H \
 		-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
 #      From LLVM-IR to BPF-bytecode in ELF-obj file