summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Saini <naveen.kumar.saini@intel.com>2022-10-21 09:40:50 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2022-10-31 10:01:01 +0800
commit12900bd7b17d18eb05ed9e7ad337cb6d861eef00 (patch)
tree13c44629df023bd0b7307fee4616001b18bde482
parentf6895c0dd2e6add213eb16bcf041af50ad2ec153 (diff)
downloadmeta-dpdk-12900bd7b17d18eb05ed9e7ad337cb6d861eef00.tar.gz
xdp-tools: add recipe
xdp-tools - Library and utilities for use with XDP. It also provides libxdp library. https://github.com/xdp-project/xdp-tools Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--conf/layer.conf5
-rw-r--r--dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch46
-rw-r--r--dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch44
-rw-r--r--dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch31
-rw-r--r--dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch34
-rw-r--r--dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools_1.2.8.bb39
6 files changed, 199 insertions, 0 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index 9bef296..45e5bd9 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -15,3 +15,8 @@ LAYERDEPENDS_dpdk = "core"
15# cause compatibility issues with other layers 15# cause compatibility issues with other layers
16LAYERVERSION_dpdk = "1" 16LAYERVERSION_dpdk = "1"
17LAYERSERIES_COMPAT_dpdk = "kirkstone langdale" 17LAYERSERIES_COMPAT_dpdk = "kirkstone langdale"
18
19BBFILES_DYNAMIC += " \
20 clang-layer:${LAYERDIR}/dynamic-layers/clang-layer/*/*/*.bb \
21 clang-layer:${LAYERDIR}/dynamic-layers/clang-layer/*/*/*.bbappend \
22"
diff --git a/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch
new file mode 100644
index 0000000..32a88b2
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch
@@ -0,0 +1,46 @@
1From 53f8a8dffa571de99b50f1a7b757cfd7d8c24d21 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 15:44:16 +0800
4Subject: [PATCH 1/4] configure: skip toolchain checks
5
6Current logic fetch full command line along with the tool. i.e
7gcc -m64 -march=skylake -mtune=generic ...
8
9Which throws ERROR: Cannot find tool -m64
10
11So need to re-write for loop, so it can work in cross-compilation
12environment too.
13
14Upstream-Status: Inappropriate
15
16Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
17---
18 configure | 12 ++++++------
19 1 file changed, 6 insertions(+), 6 deletions(-)
20
21diff --git a/configure b/configure
22index 70fdfdf..48d1ea5 100755
23--- a/configure
24+++ b/configure
25@@ -38,12 +38,12 @@ check_toolchain()
26 : ${EMACS=emacs}
27 : ${ARCH_INCLUDES=}
28
29- for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4; do
30- if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then
31- echo "*** ERROR: Cannot find tool ${TOOL}" ;
32- exit 1;
33- fi;
34- done
35+ #for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4; do
36+ # if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then
37+ # echo "*** ERROR: Cannot find tool ${TOOL}" ;
38+ # exit 1;
39+ # fi;
40+ #done
41
42 clang_version=$($CLANG --version | grep -Po '(?<=clang version )[[:digit:]]+')
43 echo "Found clang binary '$CLANG' with version $clang_version (from '$($CLANG --version | head -n 1)')"
44--
452.25.1
46
diff --git a/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch
new file mode 100644
index 0000000..2e66783
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch
@@ -0,0 +1,44 @@
1From 2840cf0b89497f545fae2eed7ece3f3c5fc558e3 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 15:50:34 +0800
4Subject: [PATCH 2/4] Makefile: It does not detect libbpf header from sysroot
5
6So adding sysroot headers path.
7
8Upstream-Status: OE-Specific
9
10Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
11---
12 lib/common.mk | 2 +-
13 lib/libxdp/Makefile | 2 +-
14 2 files changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/lib/common.mk b/lib/common.mk
17index 56c0406..ab0bad8 100644
18--- a/lib/common.mk
19+++ b/lib/common.mk
20@@ -55,7 +55,7 @@ LIBXDP_SOURCES := $(wildcard $(LIBXDP_DIR)/*.[ch] $(LIBXDP_DIR)/*.in)
21 KERN_USER_H ?= $(wildcard common_kern_user.h)
22
23 CFLAGS += -I$(HEADER_DIR) -I$(LIB_DIR)/util $(ARCH_INCLUDES)
24-BPF_CFLAGS += -I$(HEADER_DIR) $(ARCH_INCLUDES)
25+BPF_CFLAGS += -I$(HEADER_DIR) $(ARCH_INCLUDES) -I${STAGING_INCDIR}/
26
27 BPF_HEADERS := $(wildcard $(HEADER_DIR)/bpf/*.h) $(wildcard $(HEADER_DIR)/xdp/*.h)
28
29diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
30index 358b751..8f459d8 100644
31--- a/lib/libxdp/Makefile
32+++ b/lib/libxdp/Makefile
33@@ -30,7 +30,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc
34 TEMPLATED_SOURCES := xdp-dispatcher.c
35
36 CFLAGS += -I$(HEADER_DIR)
37-BPF_CFLAGS += -I$(HEADER_DIR)
38+BPF_CFLAGS += -I$(HEADER_DIR) -I${STAGING_INCDIR}/
39
40
41 ifndef BUILD_STATIC_ONLY
42--
432.25.1
44
diff --git a/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch
new file mode 100644
index 0000000..41c57f6
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch
@@ -0,0 +1,31 @@
1From 157546fbc4f18751c52b3c8788879c05cf253331 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 16:02:46 +0800
4Subject: [PATCH 3/4] Makefile: fix KeyError failure
5
6Error:
7Exception: KeyError: 'getpwuid(): uid not found: 11857215'
8
9Upstream-Status: Inappropriate
10
11Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
12---
13 lib/libxdp/Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
17index 8f459d8..9a340a3 100644
18--- a/lib/libxdp/Makefile
19+++ b/lib/libxdp/Makefile
20@@ -55,7 +55,7 @@ install: all
21 $(Q)install -d -m 0755 $(DESTDIR)$(BPF_OBJECT_DIR)
22 $(Q)install -m 0644 $(LIB_HEADERS) $(DESTDIR)$(HDRDIR)/
23 $(Q)install -m 0644 $(PC_FILE) $(DESTDIR)$(LIBDIR)/pkgconfig/
24- $(Q)cp -fpR $(SHARED_LIBS) $(STATIC_LIBS) $(DESTDIR)$(LIBDIR)
25+ $(Q)cp -fpR --no-preserve=ownership $(SHARED_LIBS) $(STATIC_LIBS) $(DESTDIR)$(LIBDIR)
26 $(Q)install -m 0755 $(XDP_OBJS) $(DESTDIR)$(BPF_OBJECT_DIR)
27 $(if $(MAN_FILES),$(Q)install -m 0755 -d $(DESTDIR)$(MANDIR)/man3)
28 $(if $(MAN_FILES),$(Q)install -m 0644 $(MAN_FILES) $(DESTDIR)$(MANDIR)/man3)
29--
302.25.1
31
diff --git a/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch
new file mode 100644
index 0000000..b1e15e5
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch
@@ -0,0 +1,34 @@
1From 46b3ff797135574aa0ee42f633a281d44f48da95 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 16:05:15 +0800
4Subject: [PATCH 4/4] Makefile: fix libxdp.pc error
5
6Error:
7do_populate_sysroot: QA Issue: libxdp.pc failed sanity test (tmpdir) in
8path ... xdp-tools/1.2.8-r0/sysroot-destdir/usr/lib/pkgconfig [pkgconfig]
9
10Upstream-Status: Inappropriate
11
12Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
13---
14 lib/libxdp/Makefile | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
18index 9a340a3..bc39177 100644
19--- a/lib/libxdp/Makefile
20+++ b/lib/libxdp/Makefile
21@@ -76,8 +76,8 @@ $(OBJDIR)/libxdp.so.$(LIBXDP_VERSION): $(SHARED_OBJS)
22 $^ $(LDFLAGS) $(LDLIBS) -o $@
23
24 $(OBJDIR)/libxdp.pc:
25- $(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
26- -e "s|@LIBDIR@|$(LIBDIR)|" \
27+ $(Q)sed -e "s|@PREFIX@|$(prefix)|" \
28+ -e "s|@LIBDIR@|$(libdir)|" \
29 -e "s|@VERSION@|$(TOOLS_VERSION)|" \
30 < libxdp.pc.template > $@
31
32--
332.25.1
34
diff --git a/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools_1.2.8.bb b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools_1.2.8.bb
new file mode 100644
index 0000000..6744554
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-support/xdp-tools/xdp-tools_1.2.8.bb
@@ -0,0 +1,39 @@
1SUMMARY = "Utilities and example programs for use with XDP"
2HOMEPAGE = "https://github.com/xdp-project/xdp-tools"
3LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & BSD-2-Clause"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=9ee53f8d06bbdb4c11b1557ecc4f8cd5 \
5 file://LICENSES/GPL-2.0;md5=994331978b428511800bfbd17eea3001 \
6 file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd \
7 file://LICENSES/BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927"
8
9DEPENDS += " libbpf clang-native zlib elfutils libpcap"
10
11SRC_URI = "git://github.com/xdp-project/xdp-tools.git;branch=v1.2;protocol=https \
12 file://0001-configure-skip-toolchain-checks.patch \
13 file://0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch \
14 file://0003-Makefile-fix-KeyError-failure.patch \
15 file://0004-Makefile-fix-libxdp.pc-error.patch \
16 "
17
18SRCREV = "d4ff1f9bcf8b03556b625ab6e16958598482e861"
19
20S = "${WORKDIR}/git"
21
22inherit pkgconfig
23
24EXTRA_OEMAKE += "PREFIX=${D}${prefix}"
25
26export STAGING_INCDIR
27
28do_configure:prepend () {
29 export DYNAMIC_LIBXDP=1
30}
31
32do_install () {
33 oe_runmake install
34
35 # Remove object files *.o
36 rm -rf ${D}/${libdir}/bpf
37}
38
39RDEPENDS:${PN} += "bash"