summaryrefslogtreecommitdiff
path: root/net-libs/xdp-tools/files/1.4.0-toolchain.patch
blob: d4bcb511310fcc04ae892cc51447f8fe453b0cb6 (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
50
51
52
53
54
55
56
57

Patch from: https://github.com/xdp-project/xdp-tools/pull/341

From b1377b35cd05daf4d3afc3d59839e9889a642ffb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
Date: Sat, 8 Jul 2023 12:34:20 +0200
Subject: [PATCH] libxdp: don't use direct call to readelf for symbol table
 comparison
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Gentoo CI previously reported symbol mismatches in libxdp
(see #302 and https://bugs.gentoo.org/899742). This was
caused by a direct call to 'readelf' instead of using the
command injected by the environment/toolchain.
The fix is simple: use $(READELF).

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
---
 lib/libxdp/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
index 43de3e8a..532e0687 100644
--- a/lib/libxdp/Makefile
+++ b/lib/libxdp/Makefile
@@ -93,12 +93,12 @@ $(SHARED_OBJDIR)/%.o: %.c $(EXTRA_LIB_DEPS) | $(SHARED_OBJDIR)
 
 XDP_IN_SHARED	:= $(SHARED_OBJDIR)/libxdp.o $(SHARED_OBJDIR)/xsk.o
 
-GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(XDP_IN_SHARED) | \
+GLOBAL_SYM_COUNT = $(shell $(READELF) -s --wide $(XDP_IN_SHARED) | \
 			   cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
 			   sed 's/\[.*\]//' | \
 			   awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
 			   sort -u | wc -l)
-VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OBJDIR)/libxdp.so | \
+VERSIONED_SYM_COUNT = $(shell $(READELF) --dyn-syms --wide $(OBJDIR)/libxdp.so | \
 			      grep -Eo '[^ ]+@LIBXDP_' | cut -d@ -f1 | sort -u | wc -l)
 
 check: $(CHECK_RULES)
@@ -110,12 +110,12 @@ check_abi: $(OBJDIR)/libxdp.so
 		     "versioned symbols in $^ ($(VERSIONED_SYM_COUNT))." \
 		     "Please make sure all symbols are"	 \
 		     "versioned in $(VERSION_SCRIPT)." >&2;		 \
-		readelf -s --wide $(XDP_IN_SHARED) |			 \
+		$(READELF) -s --wide $(XDP_IN_SHARED) |			 \
 		    cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' |	 \
 		    sed 's/\[.*\]//' |					 \
 		    awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'|  \
 		    sort -u > $(OUTPUT)libxdp_global_syms.tmp;		 \
-		readelf --dyn-syms --wide $(OUTPUT)libxdp.so |		 \
+		$(READELF) --dyn-syms --wide $(OUTPUT)libxdp.so |		 \
 		    grep -Eo '[^ ]+@LIBXDP_' | cut -d@ -f1 |		 \
 		    sort -u > $(OUTPUT)libxdp_versioned_syms.tmp; 	 \
 		diff -u $(OUTPUT)libxdp_global_syms.tmp			 \