diff options
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-support/xdp-tools')
5 files changed, 194 insertions, 0 deletions
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 @@ | |||
1 | From 53f8a8dffa571de99b50f1a7b757cfd7d8c24d21 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Mon, 17 Oct 2022 15:44:16 +0800 | ||
4 | Subject: [PATCH 1/4] configure: skip toolchain checks | ||
5 | |||
6 | Current logic fetch full command line along with the tool. i.e | ||
7 | gcc -m64 -march=skylake -mtune=generic ... | ||
8 | |||
9 | Which throws ERROR: Cannot find tool -m64 | ||
10 | |||
11 | So need to re-write for loop, so it can work in cross-compilation | ||
12 | environment too. | ||
13 | |||
14 | Upstream-Status: Inappropriate | ||
15 | |||
16 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
17 | --- | ||
18 | configure | 12 ++++++------ | ||
19 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
20 | |||
21 | diff --git a/configure b/configure | ||
22 | index 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 | -- | ||
45 | 2.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 @@ | |||
1 | From 2840cf0b89497f545fae2eed7ece3f3c5fc558e3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Mon, 17 Oct 2022 15:50:34 +0800 | ||
4 | Subject: [PATCH 2/4] Makefile: It does not detect libbpf header from sysroot | ||
5 | |||
6 | So adding sysroot headers path. | ||
7 | |||
8 | Upstream-Status: OE-Specific | ||
9 | |||
10 | Signed-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 | |||
16 | diff --git a/lib/common.mk b/lib/common.mk | ||
17 | index 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 | |||
29 | diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile | ||
30 | index 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 | -- | ||
43 | 2.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 @@ | |||
1 | From 157546fbc4f18751c52b3c8788879c05cf253331 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Mon, 17 Oct 2022 16:02:46 +0800 | ||
4 | Subject: [PATCH 3/4] Makefile: fix KeyError failure | ||
5 | |||
6 | Error: | ||
7 | Exception: KeyError: 'getpwuid(): uid not found: 11857215' | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | |||
11 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
12 | --- | ||
13 | lib/libxdp/Makefile | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile | ||
17 | index 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 | -- | ||
30 | 2.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 @@ | |||
1 | From 46b3ff797135574aa0ee42f633a281d44f48da95 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Mon, 17 Oct 2022 16:05:15 +0800 | ||
4 | Subject: [PATCH 4/4] Makefile: fix libxdp.pc error | ||
5 | |||
6 | Error: | ||
7 | do_populate_sysroot: QA Issue: libxdp.pc failed sanity test (tmpdir) in | ||
8 | path ... xdp-tools/1.2.8-r0/sysroot-destdir/usr/lib/pkgconfig [pkgconfig] | ||
9 | |||
10 | Upstream-Status: Inappropriate | ||
11 | |||
12 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
13 | --- | ||
14 | lib/libxdp/Makefile | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile | ||
18 | index 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 | -- | ||
33 | 2.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 @@ | |||
1 | SUMMARY = "Utilities and example programs for use with XDP" | ||
2 | HOMEPAGE = "https://github.com/xdp-project/xdp-tools" | ||
3 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & BSD-2-Clause" | ||
4 | LIC_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 | |||
9 | DEPENDS += " libbpf clang-native zlib elfutils libpcap" | ||
10 | |||
11 | SRC_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 | |||
18 | SRCREV = "d4ff1f9bcf8b03556b625ab6e16958598482e861" | ||
19 | |||
20 | S = "${WORKDIR}/git" | ||
21 | |||
22 | inherit pkgconfig | ||
23 | |||
24 | EXTRA_OEMAKE += "PREFIX=${D}${prefix}" | ||
25 | |||
26 | export STAGING_INCDIR | ||
27 | |||
28 | do_configure:prepend () { | ||
29 | export DYNAMIC_LIBXDP=1 | ||
30 | } | ||
31 | |||
32 | do_install () { | ||
33 | oe_runmake install | ||
34 | |||
35 | # Remove object files *.o | ||
36 | rm -rf ${D}/${libdir}/bpf | ||
37 | } | ||
38 | |||
39 | RDEPENDS:${PN} += "bash" | ||