[openwrt/openwrt] bpf: ignore missing LLVM bins on package for non compile steps

LEDE Commits lede-commits at lists.infradead.org
Wed Jan 18 15:29:30 PST 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/116c73fd71c75e38c4d707dc5a74e6993874098f

commit 116c73fd71c75e38c4d707dc5a74e6993874098f
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Jan 18 12:22:12 2023 +0100

    bpf: ignore missing LLVM bins on package for non compile steps
    
    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 at gmail.com>
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/bpf.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/bpf.mk b/include/bpf.mk
index e43fcad50c..ec3f04e1e9 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -64,7 +64,7 @@ BPF_CFLAGS := \
 	-O2 -emit-llvm -Xclang -disable-llvm-passes
 
 ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
-ifeq ($(DUMP),)
+ifeq ($(DUMP)$(filter download refresh,$(MAKECMDGOALS)),)
   CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
   CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
   ifeq ($(CLANG_VER_VALID),)




More information about the lede-commits mailing list