bpf: fix llvm version check
authorKonstantin Demin <rockdrilla@gmail.com>
Thu, 13 Jun 2024 17:56:31 +0000 (20:56 +0300)
committerRobert Marko <robimarko@gmail.com>
Mon, 9 Sep 2024 08:36:47 +0000 (10:36 +0200)
- specify CC target explicitly

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15703
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/bpf.mk

index 85c3edb4c773b2341eb08206ffe2dba3f76e0e06..2b7aa8512c2cb9a9c112fae889f4792830d1fd39 100644 (file)
@@ -66,7 +66,7 @@ BPF_CFLAGS := \
 
 ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
 ifeq ($(DUMP)$(filter download refresh,$(MAKECMDGOALS)),)
-  CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
+  CLANG_VER:=$(shell $(CLANG) --target=$(BPF_TARGET) -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),)
     $(error ERROR: LLVM/clang version too old. Minimum required: $(CLANG_MIN_VER), found: $(CLANG_VER))