xdp-tools: fix compilation wrongly using host header
[openwrt/staging/pepe2k.git] / package / network / utils / xdp-tools / patches / 020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch
1 From 1f160c287c14b4300c4248752e20da5981c9763e Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 18 Jan 2023 19:00:54 +0100
4 Subject: [PATCH] libxdp: Use __noinline__ reserved attribute for XDP
5 dispatcher
6
7 The use of noinline is wrong as noline is not a reserved attribute and
8 with gcc12 this became an error. Use the reserved __noinline__ attribute
9 to fix compilation error.
10
11 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 [a.heider: adapt lib/libxdp/protocol.org too]
13 Signed-off-by: Andre Heider <a.heider@gmail.com>
14 ---
15 lib/libxdp/protocol.org | 2 +-
16 lib/libxdp/xdp-dispatcher.c.in | 4 ++--
17 2 files changed, 3 insertions(+), 3 deletions(-)
18
19 --- a/lib/libxdp/protocol.org
20 +++ b/lib/libxdp/protocol.org
21 @@ -54,7 +54,7 @@ static volatile const struct xdp_dispatc
22 /* The volatile return value prevents the compiler from assuming it knows the
23 * return value and optimising based on that.
24 */
25 -__attribute__ ((noinline))
26 +__attribute__ ((__noinline__))
27 int prog0(struct xdp_md *ctx) {
28 volatile int ret = XDP_DISPATCHER_RETVAL;
29
30 --- a/lib/libxdp/xdp-dispatcher.c.in
31 +++ b/lib/libxdp/xdp-dispatcher.c.in
32 @@ -30,7 +30,7 @@ static volatile const struct xdp_dispatc
33 * return value and optimising based on that.
34 */
35 forloop(`i', `0', NUM_PROGS,
36 -`__attribute__ ((noinline))
37 +`__attribute__ ((__noinline__))
38 int format(`prog%d', i)(struct xdp_md *ctx) {
39 volatile int ret = XDP_DISPATCHER_RETVAL;
40
41 @@ -40,7 +40,7 @@ int format(`prog%d', i)(struct xdp_md *c
42 }
43 ')
44
45 -__attribute__ ((noinline))
46 +__attribute__ ((__noinline__))
47 int compat_test(struct xdp_md *ctx) {
48 volatile int ret = XDP_DISPATCHER_RETVAL;
49