diff options
author | Ting Liu <ting.liu@nxp.com> | 2021-10-14 16:44:08 +0800 |
---|---|---|
committer | Ting Liu <ting.liu@nxp.com> | 2021-10-15 22:11:36 +0800 |
commit | 7fade9243aeeef32a972bec3aa263ab7201a7681 (patch) | |
tree | b803eff99258a7aed6344bc271e9a9eeff2f00ae | |
parent | 6ab74151605998436d2480d90d6d5d9efeab1d91 (diff) | |
download | meta-freescale-7fade9243aeeef32a972bec3aa263ab7201a7681.tar.gz |
pktgen-dpdk: upgrade to 21.05.0
Signed-off-by: Ting Liu <ting.liu@nxp.com>
3 files changed, 109 insertions, 33 deletions
diff --git a/recipes-extended/pktgen-dpdk/files/fix-gcc11-mismatched-dealloc-error.patch b/recipes-extended/pktgen-dpdk/files/fix-gcc11-mismatched-dealloc-error.patch new file mode 100644 index 00000000..a2befbd6 --- /dev/null +++ b/recipes-extended/pktgen-dpdk/files/fix-gcc11-mismatched-dealloc-error.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From 530fbb2e2deb6b9214466933df221910c2c50b7c Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <ting.liu@nxp.com> | ||
3 | Date: Fri, 15 Oct 2021 08:01:15 +0530 | ||
4 | Subject: [PATCH] fix gcc11 mismatched-dealloc error | ||
5 | |||
6 | Fix build error with gcc 11: | ||
7 | | FAILED: lib/common/libcommon.a.p/lscpu.c.o | ||
8 | | aarch64-poky-linux-gcc -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time --sysroot=/opt/ci/yocto/honister/build-lx2162aqds/tmp/work/lx2162aqds-poky-linux/pktgen-dpdk/21.05.0-r0/recipe-sysroot -Ilib/common/libcommon.a.p -Ilib/common -I../git/lib/common -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -O3 -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE -Wno-pedantic -Wno-format-truncation -DRTE_FORCE_INTRINSICS -fPIC -include rte_config.h -march=armv8-a+crc -moutline-atomics -MD -MQ lib/common/libcommon.a.p/lscpu.c.o -MF lib/common/libcommon.a.p/lscpu.c.o.d -o lib/common/libcommon.a.p/lscpu.c.o -c ../git/lib/common/lscpu.c | ||
9 | | In function 'lscpu_info_get', | ||
10 | | inlined from 'lscpu_info' at ../git/lib/common/lscpu.c:210:2: | ||
11 | | ../git/lib/common/lscpu.c:167:9: error: 'fclose' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc] | ||
12 | | 167 | fclose(f); | ||
13 | | | ^~~~~~~~~ | ||
14 | | ../git/lib/common/lscpu.c: In function 'lscpu_info': | ||
15 | | ../git/lib/common/lscpu.c:146:22: note: returned from 'popen' | ||
16 | | 146 | FILE *f = popen(lscpu_path, "r"); | ||
17 | | | ^~~~~~~~~~~~~~~~~~~~~~ | ||
18 | | In function 'cpu_proc_info', | ||
19 | | inlined from 'lscpu_info' at ../git/lib/common/lscpu.c:211:2: | ||
20 | | ../git/lib/common/lscpu.c:195:9: error: 'fclose' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc] | ||
21 | | 195 | fclose(f); | ||
22 | | | ^~~~~~~~~ | ||
23 | | ../git/lib/common/lscpu.c: In function 'lscpu_info': | ||
24 | | ../git/lib/common/lscpu.c:174:22: note: returned from 'popen' | ||
25 | | 174 | FILE *f = popen(proc_path, "r"); | ||
26 | | | ^~~~~~~~~~~~~~~~~~~~~ | ||
27 | | cc1: all warnings being treated as errors | ||
28 | |||
29 | Signed-off-by: Ting Liu <ting.liu@nxp.com> | ||
30 | --- | ||
31 | app/pktgen.h | 2 +- | ||
32 | lib/common/lscpu.c | 4 ++-- | ||
33 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
34 | |||
35 | diff --git a/app/pktgen.h b/app/pktgen.h | ||
36 | index 7c61fc8..2f24c65 100644 | ||
37 | --- a/app/pktgen.h | ||
38 | +++ b/app/pktgen.h | ||
39 | @@ -531,7 +531,7 @@ do_command(const char *cmd, int (*display)(char *, int)) { | ||
40 | i = display(line, i); | ||
41 | |||
42 | if (f) | ||
43 | - fclose(f); | ||
44 | + pclose(f); | ||
45 | if (line) | ||
46 | free(line); | ||
47 | |||
48 | diff --git a/lib/common/lscpu.c b/lib/common/lscpu.c | ||
49 | index 8b56ccd..912c601 100644 | ||
50 | --- a/lib/common/lscpu.c | ||
51 | +++ b/lib/common/lscpu.c | ||
52 | @@ -164,7 +164,7 @@ lscpu_info_get(const char *lscpu_path) | ||
53 | } | ||
54 | } | ||
55 | |||
56 | - fclose(f); | ||
57 | + pclose(f); | ||
58 | free(line); | ||
59 | } | ||
60 | |||
61 | @@ -192,7 +192,7 @@ cpu_proc_info(const char *proc_path) | ||
62 | } | ||
63 | } | ||
64 | |||
65 | - fclose(f); | ||
66 | + pclose(f); | ||
67 | free(line); | ||
68 | } | ||
69 | |||
70 | -- | ||
71 | 2.25.1 | ||
72 | |||
diff --git a/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb b/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb deleted file mode 100644 index 6a039129..00000000 --- a/recipes-extended/pktgen-dpdk/pktgen-dpdk_19.12.0.bb +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | DESCRIPTION = "PKTGEN DPDK" | ||
2 | LICENSE = "BSD" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=30ac8fa65a07ea7cc1c7ee84e1c80294" | ||
4 | |||
5 | DEPENDS += "libpcap dpdk lua lua-native" | ||
6 | |||
7 | SRC_URI = "git://dpdk.org/git/apps/pktgen-dpdk;protocol=https;nobranch=1 \ | ||
8 | " | ||
9 | SRCREV = "7a61e4dfcdf037c31460b6c9bcb301797813036a" | ||
10 | |||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | DPAA_VER ?= "dpaa" | ||
14 | export RTE_TARGET = "arm64-${DPAA_VER}-linuxapp-gcc" | ||
15 | export RTE_SDK = "${RECIPE_SYSROOT}/usr/share/" | ||
16 | |||
17 | EXTRA_OEMAKE += 'CC="${CC}" LD="${LD}" RTE_SDK="${RECIPE_SYSROOT}/usr/share/" RTE_TARGET="arm64-${DPAA_VER}-linuxapp-gcc"' | ||
18 | |||
19 | do_compile() { | ||
20 | oe_runmake | ||
21 | } | ||
22 | |||
23 | do_install() { | ||
24 | install -d ${D}${bindir}/ | ||
25 | cp -f ${S}/app/arm64-dpaa-linuxapp-gcc/pktgen ${D}${bindir}/ | ||
26 | cp -f ${S}/Pktgen.lua ${D}${bindir}/ | ||
27 | } | ||
28 | |||
29 | INSANE_SKIP:${PN} = "ldflags" | ||
30 | INHIBIT_PACKAGE_STRIP = "1" | ||
31 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
32 | PARALLEL_MAKE = "" | ||
33 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||
diff --git a/recipes-extended/pktgen-dpdk/pktgen-dpdk_21.05.0.bb b/recipes-extended/pktgen-dpdk/pktgen-dpdk_21.05.0.bb new file mode 100644 index 00000000..f04e1e9f --- /dev/null +++ b/recipes-extended/pktgen-dpdk/pktgen-dpdk_21.05.0.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | DESCRIPTION = "PKTGEN DPDK" | ||
2 | LICENSE = "BSD" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0245ceedaef59ae0129500b0ce1e8a45" | ||
4 | |||
5 | DEPENDS += "libpcap dpdk lua lua-native" | ||
6 | |||
7 | SRC_URI = "git://dpdk.org/git/apps/pktgen-dpdk;protocol=https;nobranch=1 \ | ||
8 | file://fix-gcc11-mismatched-dealloc-error.patch \ | ||
9 | " | ||
10 | SRCREV = "3a09aa916597fb9a97ee8eec50044cbdb9c4abde" | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | DPAA_VER ?= "dpaa" | ||
15 | export RTE_TARGET = "arm64-${DPAA_VER}-linuxapp-gcc" | ||
16 | export RTE_SDK = "${RECIPE_SYSROOT}/usr/share/dpdk" | ||
17 | |||
18 | inherit meson pkgconfig | ||
19 | |||
20 | MESON_BUILDTYPE = "release" | ||
21 | EXTRA_OEMESON += '-Dc_args="-DRTE_FORCE_INTRINSICS"' | ||
22 | |||
23 | do_configure:prepend() { | ||
24 | sed -i "/^add_project_arguments('-march=native'/s/^/#&/" ${S}/meson.build | ||
25 | } | ||
26 | |||
27 | do_install() { | ||
28 | install -d ${D}${bindir}/ | ||
29 | install -m 0755 app/pktgen ${D}${bindir}/ | ||
30 | install -m 0644 ${S}/Pktgen.lua ${D}${bindir}/ | ||
31 | } | ||
32 | |||
33 | INSANE_SKIP:${PN} = "ldflags" | ||
34 | INHIBIT_PACKAGE_STRIP = "1" | ||
35 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
36 | PARALLEL_MAKE = "" | ||
37 | COMPATIBLE_MACHINE = "(qoriq-arm64)" | ||