From fe73377ee96117986404e0920bd4710225baf6db Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 13 Mar 2023 22:05:35 -0700 Subject: dpdk_19.11-20.12.bb: Fix build with gcc-12 Backport relevant fix from upstream dpdk Signed-off-by: Khem Raj --- .../0001-examples-fix-Arm-build-with-GCC-12.patch | 49 ++++++++++++++++++++++ recipes-extended/dpdk/dpdk_19.11-20.12.bb | 1 + 2 files changed, 50 insertions(+) create mode 100644 recipes-extended/dpdk/dpdk/0001-examples-fix-Arm-build-with-GCC-12.patch (limited to 'recipes-extended') diff --git a/recipes-extended/dpdk/dpdk/0001-examples-fix-Arm-build-with-GCC-12.patch b/recipes-extended/dpdk/dpdk/0001-examples-fix-Arm-build-with-GCC-12.patch new file mode 100644 index 00000000..b73b3a96 --- /dev/null +++ b/recipes-extended/dpdk/dpdk/0001-examples-fix-Arm-build-with-GCC-12.patch @@ -0,0 +1,49 @@ +From 229fc129be85a4d2d2c4efddae7bb97c3d87d416 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 13 Mar 2023 22:02:01 -0700 +Subject: [PATCH] examples: fix Arm build with GCC 12 + +GCC-12 warns when a pointer of type union points to an array of same +defined size, as union internally gets paded with pad bytes. + + ../examples/common/neon/port_group.h:42:21: error: array subscript + 'union [0]' is partly outside array bounds of + 'uint16_t[5]' {aka 'short unsigned int[5]'} + [-Werror=array-bounds] + 42 | pnum->u64 = gptbl[v].pnum; + | ^~ + ../examples/common/neon/port_group.h:21:23: note: object 'pn' of + size [0, 10] + 21 | port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1 + | ~~~~~~~~~^~~~~~~~~~~~~~~ + ../examples/common/neon/port_group.h:43:21: error: array subscript + 'union [0]' is partly outside array bounds of + 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds] + 43 | pnum->u16[FWDSTEP] = 1; + | ^~ + +Fixes: 732115ce38c6 ("examples/l3fwd: move packet group function in common") + +Upstream-Status: Backport [https://github.com/DPDK/dpdk/commit/b269bd630e96b276a69d698e13ad9ebfbbb67512] +Signed-off-by: Amit Prakash Shukla +Signed-off-by: Khem Raj +--- + examples/l3fwd/l3fwd_neon.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h +index 86ac5971d7..dc73e9fef7 100644 +--- a/examples/l3fwd/l3fwd_neon.h ++++ b/examples/l3fwd/l3fwd_neon.h +@@ -77,7 +77,7 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1, + union { + uint16_t u16[FWDSTEP + 1]; + uint64_t u64; +- } *pnum = (void *)pn; ++ } __rte_packed *pnum = (void *)pn; + + int32_t v; + uint16x8_t mask = {1, 2, 4, 8, 0, 0, 0, 0}; +-- +2.39.2 + diff --git a/recipes-extended/dpdk/dpdk_19.11-20.12.bb b/recipes-extended/dpdk/dpdk_19.11-20.12.bb index e974eba0..b14d4fbf 100644 --- a/recipes-extended/dpdk/dpdk_19.11-20.12.bb +++ b/recipes-extended/dpdk/dpdk_19.11-20.12.bb @@ -8,6 +8,7 @@ SRC_URI = "git://github.com/nxp-qoriq/dpdk;protocol=https;nobranch=1 \ file://0001-add-Wno-cast-function-type.patch \ file://0001-Add-RTE_KERNELDIR_OUT.patch \ file://0005-use-python3-instead-of-python.patch \ + file://0001-examples-fix-Arm-build-with-GCC-12.patch \ " SRCREV = "7071c27f6f5aefb57de1cffab3484707b1e82e2b" -- cgit v1.2.3-54-g00ecf