diff options
| -rw-r--r-- | recipes-extended/dpdk/dpdk/0001-fix-build-with-gcc-7.1.patch | 119 | ||||
| -rw-r--r-- | recipes-extended/dpdk/dpdk_16.07.bb | 8 |
2 files changed, 123 insertions, 4 deletions
diff --git a/recipes-extended/dpdk/dpdk/0001-fix-build-with-gcc-7.1.patch b/recipes-extended/dpdk/dpdk/0001-fix-build-with-gcc-7.1.patch new file mode 100644 index 000000000..399510aab --- /dev/null +++ b/recipes-extended/dpdk/dpdk/0001-fix-build-with-gcc-7.1.patch | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | From 03ee26cd708971a51f056e3f53482367aa38fcb1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chunrong Guo <chunrong.guo@nxp.com> | ||
| 3 | Date: Wed, 12 Jul 2017 12:03:38 +0800 | ||
| 4 | Subject: [PATCH] fix build with gcc 7.1 | ||
| 5 | |||
| 6 | Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com> | ||
| 7 | --- | ||
| 8 | lib/librte_cmdline/cmdline_parse_num.c | 4 ++-- | ||
| 9 | lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | 2 +- | ||
| 10 | lib/librte_hash/rte_crc_arm64.h | 2 ++ | ||
| 11 | lib/librte_ring/rte_ring.h | 18 ++++++++++++------ | ||
| 12 | mk/toolchain/gcc/rte.vars.mk | 6 ++++++ | ||
| 13 | 5 files changed, 23 insertions(+), 9 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/lib/librte_cmdline/cmdline_parse_num.c b/lib/librte_cmdline/cmdline_parse_num.c | ||
| 16 | index b0f9a35..e507ec4 100644 | ||
| 17 | --- a/lib/librte_cmdline/cmdline_parse_num.c | ||
| 18 | +++ b/lib/librte_cmdline/cmdline_parse_num.c | ||
| 19 | @@ -250,7 +250,7 @@ cmdline_parse_num(cmdline_parse_token_hdr_t *tk, const char *srcbuf, void *res, | ||
| 20 | |||
| 21 | case HEX: | ||
| 22 | st = HEX_OK; | ||
| 23 | - /* no break */ | ||
| 24 | + /* fall-through no break */ | ||
| 25 | case HEX_OK: | ||
| 26 | if (c >= '0' && c <= '9') { | ||
| 27 | if (add_to_res(c - '0', &res1, 16) < 0) | ||
| 28 | @@ -282,7 +282,7 @@ cmdline_parse_num(cmdline_parse_token_hdr_t *tk, const char *srcbuf, void *res, | ||
| 29 | |||
| 30 | case BIN: | ||
| 31 | st = BIN_OK; | ||
| 32 | - /* no break */ | ||
| 33 | + /* fall-through */ | ||
| 34 | case BIN_OK: | ||
| 35 | if (c >= '0' && c <= '1') { | ||
| 36 | if (add_to_res(c - '0', &res1, 2) < 0) | ||
| 37 | diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | ||
| 38 | index e5554ca..8d76f32 100644 | ||
| 39 | --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | ||
| 40 | +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | ||
| 41 | @@ -607,7 +607,7 @@ struct igb_adapter { | ||
| 42 | int int_mode; | ||
| 43 | u32 rss_queues; | ||
| 44 | u32 vmdq_pools; | ||
| 45 | - char fw_version[32]; | ||
| 46 | + char fw_version[43]; | ||
| 47 | u32 wvbr; | ||
| 48 | struct igb_mac_addr *mac_table; | ||
| 49 | #ifdef CONFIG_IGB_VMDQ_NETDEV | ||
| 50 | diff --git a/lib/librte_hash/rte_crc_arm64.h b/lib/librte_hash/rte_crc_arm64.h | ||
| 51 | index 7dd6334..a17c0e4 100644 | ||
| 52 | --- a/lib/librte_hash/rte_crc_arm64.h | ||
| 53 | +++ b/lib/librte_hash/rte_crc_arm64.h | ||
| 54 | @@ -110,8 +110,10 @@ rte_hash_crc_set_alg(uint8_t alg) | ||
| 55 | case CRC32_ARM64: | ||
| 56 | if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) | ||
| 57 | alg = CRC32_SW; | ||
| 58 | + /* fall-through */ | ||
| 59 | case CRC32_SW: | ||
| 60 | crc32_alg = alg; | ||
| 61 | + /* fall-through */ | ||
| 62 | default: | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h | ||
| 66 | index 0e22e69..085f3fe 100644 | ||
| 67 | --- a/lib/librte_ring/rte_ring.h | ||
| 68 | +++ b/lib/librte_ring/rte_ring.h | ||
| 69 | @@ -364,9 +364,12 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); | ||
| 70 | r->ring[idx+3] = obj_table[i+3]; \ | ||
| 71 | } \ | ||
| 72 | switch (n & 0x3) { \ | ||
| 73 | - case 3: r->ring[idx++] = obj_table[i++]; \ | ||
| 74 | - case 2: r->ring[idx++] = obj_table[i++]; \ | ||
| 75 | - case 1: r->ring[idx++] = obj_table[i++]; \ | ||
| 76 | + case 3: \ | ||
| 77 | + r->ring[idx++] = obj_table[i++]; /* fallthrough */ \ | ||
| 78 | + case 2: \ | ||
| 79 | + r->ring[idx++] = obj_table[i++]; /* fallthrough */ \ | ||
| 80 | + case 1: \ | ||
| 81 | + r->ring[idx++] = obj_table[i++]; /* fallthrough */ \ | ||
| 82 | } \ | ||
| 83 | } else { \ | ||
| 84 | for (i = 0; idx < size; i++, idx++)\ | ||
| 85 | @@ -390,9 +393,12 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r); | ||
| 86 | obj_table[i+3] = r->ring[idx+3]; \ | ||
| 87 | } \ | ||
| 88 | switch (n & 0x3) { \ | ||
| 89 | - case 3: obj_table[i++] = r->ring[idx++]; \ | ||
| 90 | - case 2: obj_table[i++] = r->ring[idx++]; \ | ||
| 91 | - case 1: obj_table[i++] = r->ring[idx++]; \ | ||
| 92 | + case 3: \ | ||
| 93 | + obj_table[i++] = r->ring[idx++]; /* fallthrough */ \ | ||
| 94 | + case 2: \ | ||
| 95 | + obj_table[i++] = r->ring[idx++]; /* fallthrough */ \ | ||
| 96 | + case 1: \ | ||
| 97 | + obj_table[i++] = r->ring[idx++]; /* fallthrough */ \ | ||
| 98 | } \ | ||
| 99 | } else { \ | ||
| 100 | for (i = 0; idx < size; i++, idx++) \ | ||
| 101 | diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk | ||
| 102 | index 94f6412..350c8bc 100644 | ||
| 103 | --- a/mk/toolchain/gcc/rte.vars.mk | ||
| 104 | +++ b/mk/toolchain/gcc/rte.vars.mk | ||
| 105 | @@ -101,5 +101,11 @@ ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1) | ||
| 106 | WERROR_FLAGS += -Wno-uninitialized | ||
| 107 | endif | ||
| 108 | |||
| 109 | +ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) | ||
| 110 | +# Tell GCC only to error for switch fallthroughs without a suitable comment | ||
| 111 | +# Ignore errors for snprintf truncation | ||
| 112 | +WERROR_FLAGS += -Wno-format-truncation | ||
| 113 | +endif | ||
| 114 | + | ||
| 115 | export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF | ||
| 116 | export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS | ||
| 117 | -- | ||
| 118 | 2.7.4 | ||
| 119 | |||
diff --git a/recipes-extended/dpdk/dpdk_16.07.bb b/recipes-extended/dpdk/dpdk_16.07.bb index ebc088097..b47d041fd 100644 --- a/recipes-extended/dpdk/dpdk_16.07.bb +++ b/recipes-extended/dpdk/dpdk_16.07.bb | |||
| @@ -9,12 +9,12 @@ RDEPENDS_${PN}-examples = "bash python-core" | |||
| 9 | 9 | ||
| 10 | inherit module | 10 | inherit module |
| 11 | 11 | ||
| 12 | SRC_URI = "git://git.freescale.com/ppc/sdk/dpdk.git;nobranch=1 \ | 12 | SRC_URI = "git://github.com/qoriq-open-source/dpdk.git;nobranch=1 \ |
| 13 | file://add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \ | 13 | file://add-RTE_KERNELDIR_OUT-to-split-kernel-bu.patch \ |
| 14 | file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \ | 14 | file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \ |
| 15 | file://0001-fix-build-with-gcc-7.1.patch \ | 15 | file://0001-fix-build-with-gcc-7.1.patch \ |
| 16 | " | 16 | " |
| 17 | SRCREV = "a3395d24774a8a7a2ce0d56a92a8ad2895b2ae8c" | 17 | SRCREV = "98f548c36b3c805a04d9963b8eb02e09340aa089" |
| 18 | 18 | ||
| 19 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
| 20 | 20 | ||
| @@ -40,7 +40,7 @@ do_compile() { | |||
| 40 | do_install() { | 40 | do_install() { |
| 41 | unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS | 41 | unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS |
| 42 | 42 | ||
| 43 | oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" WERROR_FLAGS="-w" V=1 T="${RTE_TARGET}" DESTDIR="${D}" install | 43 | oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" WERROR_FLAGS="-w" V=1 T="${RTE_TARGET}" DESTDIR="${D}" install |
| 44 | 44 | ||
| 45 | # Build and install the DPDK examples | 45 | # Build and install the DPDK examples |
| 46 | for APP in examples/l2fwd examples/l3fwd examples/l2fwd-crypto examples/ipsec-secgw examples/kni examples/ip_fragmentation examples/ip_reassembly; do | 46 | for APP in examples/l2fwd examples/l3fwd examples/l2fwd-crypto examples/ipsec-secgw examples/kni examples/ip_fragmentation examples/ip_reassembly; do |
| @@ -89,4 +89,4 @@ FILES_${PN}-dev += "${datadir}/mk ${datadir}/scripts \ | |||
| 89 | " | 89 | " |
| 90 | FILES_${PN}-examples += "${datadir}/examples" | 90 | FILES_${PN}-examples += "${datadir}/examples" |
| 91 | 91 | ||
| 92 | COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a)" | 92 | COMPATIBLE_MACHINE = "(ls2080ardb|ls2084ardb|ls2088a|ls1043a|ls1046a|ls1088a)" |
