aboutsummaryrefslogtreecommitdiff
path: root/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch
blob: 16835eae375837f55106b538c6843e62e0cc6570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
@@ -108,12 +108,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
@@ -139,12 +139,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}