Commit Graph

11 Commits

Author SHA1 Message Date
Felix Fietkau
c46202fb34 bpf: add -mcpu=v3 to support 32-bit alu ops
Fixes JIT on 32-bit ARM and improves performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-12-21 11:29:15 +01:00
Felix Fietkau
8f355becdf 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>
2021-11-19 23:51:20 +01:00
Felix Fietkau
98ef23dda8 include/bpf.mk: preserve the bpf .o file with debug symbols
Makes it easier to analyze verifier complaints

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-19 23:51:20 +01:00
Felix Fietkau
959a0308e5 include/bpf.mk: fix typo in clang version check
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-12 13:15:44 +01:00
Felix Fietkau
694aed607f include/bpf.mk: check minimum required clang version
Avoid spurious runtime errors caused by loading eBPF modules
built with an old clang version

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-09 20:59:51 +01:00
Felix Fietkau
9f90a89655 build: add support for using prebuilt LLVM toolchain
When the prebuilt llvm toolchain is unpacked into the source dir,
it is automatically picked up and used by the build system, and eBPF
based packages can be selected

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-04 20:06:14 +01:00
Felix Fietkau
a7c0d7c06c llvm-bpf: move to staging_dir/host/llvm-bpf
This makes it easier to package it up for the download server

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-04 16:55:04 +01:00
Felix Fietkau
cfb022cd5f include/bpf.mk: fix compile for big-endian targets
llvm-opt and llc need endian flags in the target as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 10:39:37 +01:00
Felix Fietkau
ce6088bb30 include/bpf.mk: fix typo
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-02 09:56:22 +01:00
Felix Fietkau
6738820bf6 build: fix bpf toolchain dependency for qosify
Add hidden symbols to fix defaults with CONFIG_DEVEL unset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 18:41:20 +01:00
Felix Fietkau
a537d06c72 bpf-headers: add a package with kernel headers for ebpf
In order to genererate suitable kernel headers, a 5.10 kernel tree is
prepared with a default config for mips. The arch is forced to mips in
order to avoid issues with inline asm on various architectures in a way
that doesn't involve relying on the host toolchain/headers.
It also has the advantage of supporting both endian types

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:39:09 +01:00