aboutsummaryrefslogtreecommitdiffstats
path: root/include/bpf.mk
Commit message (Collapse)AuthorAgeFilesLines
* bpf: ignore missing LLVM bins on package for non compile stepsChristian Marangi2023-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | To download a package the LLVM bins are not strictly needed. Currently with an example run of make package/bridger/download V=s, the build fail with make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/network/services/bridger' bash: line 1: /home/ansuel/openwrt-ansuel/openwrt/staging_dir/host/llvm-bpf/bin/clang: No such file or directory bash: line 1: [: : integer expression expected /home/ansuel/openwrt-ansuel/openwrt/include/bpf.mk:71: *** ERROR: LLVM/clang version too old. Minimum required: 12, found: . Stop. make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/network/services/bridger' time: package/network/services/bridger/download#0.04#0.00#0.06 ERROR: package/network/services/bridger failed to build. This is wrong since it may be needed to download the required packages first and then compile them later. Fix this by ignoring the LLVM bin check on non compile steps. Tested-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* bpf: check llvm version only when usedHauke Mehrtens2022-10-311-0/+2
| | | | | | | | | | | | unetd always includes $(INCLUDE_DIR)/bpf.mk. This file always checks if the LLVM version is supported in CLANG_VER_VALID. unetd only needs bpf when UNETD_VXLAN_SUPPORT is set. It fails when UNETD_VXLAN_SUPPORT is not set and llvm is not installed. Fix it by only checking the LLVM version when a LLVM toolchain is available. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* treewide: drop use of whichAnsuel Smith2022-01-171-1/+1
| | | | | | | | | | | | | | Ubuntu started to flag which as deprecated and it seems which is not really standard and may vary across Distro. Drop the use of which and use the standard 'command -v' for this simple task. Which is still present in the prereq if some package/script still use which. A utility script called command_all.sh is implemented that will just mimic the output of which -a. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* bpf: add -mcpu=v3 to support 32-bit alu opsFelix Fietkau2021-12-211-1/+1
| | | | | | Fixes JIT on 32-bit ARM and improves performance Signed-off-by: Felix Fietkau <nbd@nbd.name>
* bpf-headers: switch to mips64 for 64 bit targetsFelix Fietkau2021-11-191-2/+2
| | | | | | | | 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>
* include/bpf.mk: preserve the bpf .o file with debug symbolsFelix Fietkau2021-11-191-0/+1
| | | | | | Makes it easier to analyze verifier complaints Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/bpf.mk: fix typo in clang version checkFelix Fietkau2021-11-121-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/bpf.mk: check minimum required clang versionFelix Fietkau2021-11-091-0/+10
| | | | | | | Avoid spurious runtime errors caused by loading eBPF modules built with an old clang version Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add support for using prebuilt LLVM toolchainFelix Fietkau2021-11-041-3/+7
| | | | | | | | 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>
* llvm-bpf: move to staging_dir/host/llvm-bpfFelix Fietkau2021-11-041-1/+1
| | | | | | This makes it easier to package it up for the download server Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/bpf.mk: fix compile for big-endian targetsFelix Fietkau2021-11-021-2/+3
| | | | | | llvm-opt and llc need endian flags in the target as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/bpf.mk: fix typoFelix Fietkau2021-11-021-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix bpf toolchain dependency for qosifyFelix Fietkau2021-11-011-0/+2
| | | | | | Add hidden symbols to fix defaults with CONFIG_DEVEL unset Signed-off-by: Felix Fietkau <nbd@nbd.name>
* bpf-headers: add a package with kernel headers for ebpfFelix Fietkau2021-11-011-0/+65
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>