diff options
author | He Zhe <zhe.he@windriver.com> | 2019-06-11 11:06:49 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2019-06-11 14:03:38 +0800 |
commit | be387ee9e5ae12e2e92d6c7921aa79283dbbeb8a (patch) | |
tree | 807110fb4ff393042bc7bd62f58c6d197433e082 | |
parent | c8c30c2c4e2f36b4a55a69a475fe774015423705 (diff) | |
download | meta-dpdk-be387ee9e5ae12e2e92d6c7921aa79283dbbeb8a.tar.gz |
dpdk: mk: disable warning for packed member pointer
Backport a patch from upstream to fix the following build failure.
x86_64-native-linuxapp-gcc/include/rte_ether.h:178:2: error:
converting a packed 'const struct ether_addr' pointer (alignment 1) to a 'unaligned_uint16_t' {aka 'const short
unsigned int'} pointer (alignment 2) may result in an unaligned pointer value [-Werror=address-of-packed-member]
| 178 | const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
| | ^~~~~
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r-- | recipes-extended/dpdk/dpdk/dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch | 48 | ||||
-rw-r--r-- | recipes-extended/dpdk/dpdk_17.11.3.bb | 1 | ||||
-rw-r--r-- | recipes-extended/dpdk/dpdk_18.11.1.bb | 4 |
3 files changed, 53 insertions, 0 deletions
diff --git a/recipes-extended/dpdk/dpdk/dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch b/recipes-extended/dpdk/dpdk/dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch new file mode 100644 index 0000000..70a8dec --- /dev/null +++ b/recipes-extended/dpdk/dpdk/dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From a385972c3675dd2b4792ab5b3cf7a536e6f9846c Mon Sep 17 00:00:00 2001 | ||
2 | From: Reshma Pattan <reshma.pattan@intel.com> | ||
3 | Date: Thu, 2 May 2019 10:33:34 +0100 | ||
4 | Subject: [PATCH] mk: disable warning for packed member pointer | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | gcc 9 on Fedora 30 gives an error | ||
10 | "taking address of packed member may result in an | ||
11 | unaligned pointer value" warnings. | ||
12 | |||
13 | For clang builds this warning is already disabled, | ||
14 | so disable "-Waddress-of-packed-member" for gcc builds | ||
15 | also. | ||
16 | |||
17 | Snippet of build error: | ||
18 | lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: | ||
19 | lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: | ||
20 | taking address of packed member of ‘struct rte_mem_config’ may result | ||
21 | in an unaligned pointer value [-Werror=address-of-packed-member] | ||
22 | 768 | cur_msl = &mcfg->memsegs[msl_idx]; | ||
23 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
24 | |||
25 | Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> | ||
26 | Tested-by: David Marchand <david.marchand@redhat.com> | ||
27 | Upstream-Status: Backport | ||
28 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
29 | --- | ||
30 | mk/toolchain/gcc/rte.vars.mk | 3 +++ | ||
31 | 1 file changed, 3 insertions(+) | ||
32 | |||
33 | diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk | ||
34 | index d8b99fa..b852fcf 100644 | ||
35 | --- a/mk/toolchain/gcc/rte.vars.mk | ||
36 | +++ b/mk/toolchain/gcc/rte.vars.mk | ||
37 | @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2 | ||
38 | WERROR_FLAGS += -Wno-format-truncation | ||
39 | endif | ||
40 | |||
41 | +# disable packed member unalign warnings | ||
42 | +WERROR_FLAGS += -Wno-address-of-packed-member | ||
43 | + | ||
44 | export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF | ||
45 | export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS | ||
46 | -- | ||
47 | 2.7.4 | ||
48 | |||
diff --git a/recipes-extended/dpdk/dpdk_17.11.3.bb b/recipes-extended/dpdk/dpdk_17.11.3.bb index 7fc89d2..af42ad8 100644 --- a/recipes-extended/dpdk/dpdk_17.11.3.bb +++ b/recipes-extended/dpdk/dpdk_17.11.3.bb | |||
@@ -12,4 +12,5 @@ SRC_URI += "\ | |||
12 | file://dpdk-16.07-dpdk-fix-for-parellel-make-issue.patch \ | 12 | file://dpdk-16.07-dpdk-fix-for-parellel-make-issue.patch \ |
13 | file://dpdk-17.02-dpdk-fix-installation-warning-and-issue.patch \ | 13 | file://dpdk-17.02-dpdk-fix-installation-warning-and-issue.patch \ |
14 | file://dpdk-17.11-Fix-strncpy-error-for-GCC8.patch \ | 14 | file://dpdk-17.11-Fix-strncpy-error-for-GCC8.patch \ |
15 | file://dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch \ | ||
15 | " | 16 | " |
diff --git a/recipes-extended/dpdk/dpdk_18.11.1.bb b/recipes-extended/dpdk/dpdk_18.11.1.bb index 2d04346..39beb65 100644 --- a/recipes-extended/dpdk/dpdk_18.11.1.bb +++ b/recipes-extended/dpdk/dpdk_18.11.1.bb | |||
@@ -9,6 +9,10 @@ LIC_FILES_CHKSUM = "file://license/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4 | |||
9 | file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \ | 9 | file://license/lgpl-2.1.txt;md5=4b54a1fd55a448865a0b32d41598759d \ |
10 | file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444" | 10 | file://license/bsd-3-clause.txt;md5=0f00d99239d922ffd13cabef83b33444" |
11 | 11 | ||
12 | SRC_URI += " \ | ||
13 | file://dpdk-17.11-mk-disable-warning-for-packed-member-pointer.patch \ | ||
14 | " | ||
15 | |||
12 | do_install_append () { | 16 | do_install_append () { |
13 | # Remove the unneeded dir | 17 | # Remove the unneeded dir |
14 | rm -rf ${D}/${INSTALL_PATH}/${RTE_TARGET}/app | 18 | rm -rf ${D}/${INSTALL_PATH}/${RTE_TARGET}/app |