mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-18 10:46:41 +00:00
bpf-headers: switch to mips64 for 64 bit targets
BTF pointer data has a different size on 32 vs 64 bit targets, and while the generated eBPF code works, the BTF data fails to validate on mismatch Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
ff6b89df70
commit
8f355becdf
@ -27,7 +27,7 @@ LLVM_OPT:=$(LLVM_PATH)/opt$(LLVM_VER)
|
|||||||
LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
||||||
|
|
||||||
BPF_KARCH:=mips
|
BPF_KARCH:=mips
|
||||||
BPF_ARCH:=mips$(if $(CONFIG_BIG_ENDIAN),,el)
|
BPF_ARCH:=mips$(if $(CONFIG_ARCH_64BIT),64)$(if $(CONFIG_BIG_ENDIAN),,el)
|
||||||
BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
||||||
|
|
||||||
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
||||||
@ -49,7 +49,7 @@ BPF_KERNEL_INCLUDE := \
|
|||||||
|
|
||||||
BPF_CFLAGS := \
|
BPF_CFLAGS := \
|
||||||
$(BPF_KERNEL_INCLUDE) -I$(PKG_BUILD_DIR) \
|
$(BPF_KERNEL_INCLUDE) -I$(PKG_BUILD_DIR) \
|
||||||
-D__KERNEL__ -D__BPF_TRACING__ \
|
-D__KERNEL__ -D__BPF_TRACING__ -DCONFIG_GENERIC_CSUM \
|
||||||
-D__TARGET_ARCH_${BPF_KARCH} \
|
-D__TARGET_ARCH_${BPF_KARCH} \
|
||||||
-m$(if $(CONFIG_BIG_ENDIAN),big,little)-endian \
|
-m$(if $(CONFIG_BIG_ENDIAN),big,little)-endian \
|
||||||
-fno-stack-protector -Wall \
|
-fno-stack-protector -Wall \
|
||||||
|
@ -63,9 +63,15 @@ endef
|
|||||||
|
|
||||||
BPF_DOC = $(PKG_BUILD_DIR)/scripts/bpf_helpers_doc.py
|
BPF_DOC = $(PKG_BUILD_DIR)/scripts/bpf_helpers_doc.py
|
||||||
|
|
||||||
|
define Build/Configure/64
|
||||||
|
echo 'CONFIG_CPU_MIPS64_R2=y' >> $(PKG_BUILD_DIR)/.config
|
||||||
|
echo 'CONFIG_64BIT=y' >> $(PKG_BUILD_DIR)/.config
|
||||||
|
endef
|
||||||
|
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
grep -vE 'CONFIG_(CPU_.*ENDIAN|HZ)' $(PKG_BUILD_DIR)/arch/mips/configs/generic_defconfig > $(PKG_BUILD_DIR)/.config
|
grep -vE 'CONFIG_(CPU_.*ENDIAN|HZ)' $(PKG_BUILD_DIR)/arch/mips/configs/generic_defconfig > $(PKG_BUILD_DIR)/.config
|
||||||
echo 'CONFIG_CPU_$(if $(CONFIG_BIG_ENDIAN),BIG,LITTLE)_ENDIAN=y' >> $(PKG_BUILD_DIR)/.config
|
echo 'CONFIG_CPU_$(if $(CONFIG_BIG_ENDIAN),BIG,LITTLE)_ENDIAN=y' >> $(PKG_BUILD_DIR)/.config
|
||||||
|
$(if $(CONFIG_ARCH_64BIT),$(Build/Configure/64))
|
||||||
grep CONFIG_HZ $(REAL_LINUX_DIR)/.config >> $(PKG_BUILD_DIR)/.config
|
grep CONFIG_HZ $(REAL_LINUX_DIR)/.config >> $(PKG_BUILD_DIR)/.config
|
||||||
yes '' | $(KERNEL_MAKE) oldconfig
|
yes '' | $(KERNEL_MAKE) oldconfig
|
||||||
grep 'CONFIG_HZ=' $(REAL_LINUX_DIR)/.config | \
|
grep 'CONFIG_HZ=' $(REAL_LINUX_DIR)/.config | \
|
||||||
|
Loading…
Reference in New Issue
Block a user