openwrt/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch
Konstantin Demin f3080677f5
xdp-tools: update to v1.4.2
- release notes:
  https://github.com/xdp-project/xdp-tools/releases/tag/v1.4.2
- patches rebased manually:
  - 010-configure-respect-LDFLAGS.patch

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15705
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-17 13:26:37 +02:00

50 lines
1.5 KiB
Diff

From e2d8eae9477f6ba41ab75ad77202f235e34c04f7 Mon Sep 17 00:00:00 2001
From: Andre Heider <a.heider@gmail.com>
Date: Wed, 18 Jan 2023 22:30:23 +0100
Subject: [PATCH] lib: allow overwriting -W* flags via BPF_CFLAGS
The bpf header file situation is a mess, and the default warning
compiler flags may not be suitable everywhere, especially with -Werror
in the mix.
Move BPF_CFLAGS further down, so these can be overwritten by builders.
Signed-off-by: Andre Heider <a.heider@gmail.com>
---
lib/common.mk | 2 +-
lib/libxdp/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/lib/common.mk
+++ b/lib/common.mk
@@ -111,12 +111,12 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX
$(QUIET_CLANG)$(CLANG) -S \
-target $(BPF_TARGET) \
-D __BPF_TRACING__ \
- $(BPF_CFLAGS) \
-Wall \
-Wno-unused-value \
-Wno-pointer-sign \
-Wno-compare-distinct-pointer-types \
-Werror \
+ $(BPF_CFLAGS) \
-O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
$(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
--- a/lib/libxdp/Makefile
+++ b/lib/libxdp/Makefile
@@ -138,12 +138,12 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L
$(QUIET_CLANG)$(CLANG) -S \
-target $(BPF_TARGET) \
-D __BPF_TRACING__ \
- $(BPF_CFLAGS) \
-Wall \
-Wno-unused-value \
-Wno-pointer-sign \
-Wno-compare-distinct-pointer-types \
-Werror \
+ $(BPF_CFLAGS) \
-O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
$(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}