mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-26 19:33:07 +08:00
[BUILD FAILING] Checkpoint for backup, added new hook for file system, tweaked makefile for real kernel header files inclusion, still not working. Commiting for periodic backup
This commit is contained in:
17
src/Makefile
17
src/Makefile
@@ -16,9 +16,16 @@ COMMON_INCLUDES := -I$(abspath ./ebpf/include) -I$(abspath ./user/include)
|
||||
# Use our own libbpf API headers and Linux UAPI headers distributed with
|
||||
# libbpf to avoid dependency on system-wide headers, which could be missing or
|
||||
# outdated
|
||||
#INCLUDES := -I$(OUTPUT) -I./libbpf/include/uapi -I$(dir $(VMLINUX))
|
||||
INCLUDES := -I$(OUTPUT) -I./libbpf/include/uapi -I/lib/modules/5.11.0-40-generic/build #-I$(dir $(VMLINUX))
|
||||
CFLAGS := -g -Wall #-I/lib/modules/5.11.0-40-generic/build/include
|
||||
INCLUDES := -I$(OUTPUT) -I./libbpf/include/uapi #-I$(dir $(VMLINUX))
|
||||
KINCLUDES := -I$(OUTPUT) \
|
||||
-I./libbpf/include/uapi \
|
||||
-I/lib/modules/5.11.0-41-generic/build/include \
|
||||
-I/lib/modules/$$(uname -r)/build/include/uapi \
|
||||
-I/lib/modules/$$(uname -r)/build/include/generated/uapi \
|
||||
-I/lib/modules/$$(uname -r)/build/arch/x86/include \
|
||||
-I/lib/modules/$$(uname -r)/build/arch/x86/include/uapi \
|
||||
-I/lib/modules/$$(uname -r)/build/arch/x86/include/generated #-I$(dir $(VMLINUX))
|
||||
CFLAGS := -g -Wall
|
||||
ARCH := $(shell uname -m | sed 's/x86_64/x86/')
|
||||
|
||||
APPS = xdp_filter
|
||||
@@ -55,7 +62,7 @@ clean:
|
||||
$(Q)rm -rf $(OUTPUT) user/$(APPS)
|
||||
$(Q)rm -rf $(OUTPUT) ebpf/$(APPS)
|
||||
$(Q)rm -rf $(OUTPUT) bin/*
|
||||
$(Q)rm $(USER_INCLUDES_OBJ)
|
||||
$(Q)rm -f $(USER_INCLUDES_OBJ)
|
||||
|
||||
$(OUTPUT) $(OUTPUT)/libbpf:
|
||||
$(call msg,MKDIR,$@)
|
||||
@@ -72,7 +79,7 @@ $(LIBBPF_OBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPU
|
||||
# Build BPF code
|
||||
$(OUTPUT)/%.bpf.o: $(EBPF)/%.bpf.c $(LIBBPF_OBJ) $(wildcard $(EBPF)/%.h) | $(OUTPUT)
|
||||
$(call msg,BPF,$@)
|
||||
$(Q)$(CLANG) -g -O2 -fno-builtin -target bpf -D__TARGET_ARCH_$(ARCH) $(INCLUDES) $(COMMON_INCLUDES) $(CLANG_BPF_SYS_INCLUDES) -c $(filter %.c,$^) -o $@
|
||||
$(Q)$(CLANG) -g -O2 -fno-builtin -target bpf -emit-llvm -D__KERNEL__ -D__ASM_SYSREG_H -D__TARGET_ARCH_$(ARCH) $(KINCLUDES) $(COMMON_INCLUDES) $(CLANG_BPF_SYS_INCLUDES) -c $(filter %.c,$^) -o - | llc -march=bpf -filetype=obj -o $@
|
||||
$(Q)$(LLVM_STRIP) -g $@ # strip useless DWARF info
|
||||
|
||||
# Generate BPF skeletons
|
||||
|
||||
Reference in New Issue
Block a user