xdp-tools: fix compilation wrongly using host header
[openwrt/staging/stintel.git] / package / network / utils / xdp-tools / Makefile
index dba775e4ea1420de393f0c5aef2bfd29f6577015..8484ca758b0b4d577c05378a674819ecfc313648 100644 (file)
@@ -85,8 +85,13 @@ CONFIGURE_VARS += \
        CFLAGS="$(TARGET_CFLAGS)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
        CLANG="$(CLANG)" \
-       BPF_TARGET="$(BPF_TARGET)" \
-       LLC="$(LLVM_LLC)"
+       BPF_TARGET="$(BPF_ARCH)-linux-gnu" \
+       LLC="$(LLVM_LLC)" \
+       BPF_LDFLAGS="-march=$(BPF_TARGET) -mcpu=v3"
+
+ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
+       MAKE_FLAGS+=V=1
+endif
 
 MAKE_VARS += \
        PREFIX=/usr \
@@ -94,7 +99,7 @@ MAKE_VARS += \
 
 define Build/Configure
        $(call Build/Configure/Default)
-       echo "BPF_CFLAGS += -I$(BPF_HEADERS_DIR)/tools/lib -fno-stack-protector" >> $(PKG_BUILD_DIR)/config.mk
+       echo "BPF_CFLAGS += $(BPF_CFLAGS) -Wno-error -fno-stack-protector" >> $(PKG_BUILD_DIR)/config.mk
 endef
 
 define Build/InstallDev