From f8c235c907a979ce2b5bf7ba30a6ba06e1495855 Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Tue, 29 Sep 2015 14:29:25 -0400 Subject: [PATCH] dpdk.spec: Do not avoid array-bounds warning by patching the sources By changing the array size to work around a spurious warning from gcc, we run the risk of breaking future code which may rely on the array's size (using, ex: sizeof). Since this array-bounds failure is the product of gcc-5.x, and not actually an error here, it can safely be ignored. We need to keep the -Wformat warning, however, because that will trigger build errors in some of the PMD builds. Signed-off-by: Aaron Conole Acked-by: Neil Horman Acked-by: Panu Matilainen --- dpdk.spec | 6 +++--- null_array-bounds.patch | 19 ------------------- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 null_array-bounds.patch diff --git a/dpdk.spec b/dpdk.spec index 58f4dbc..432539e 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -11,7 +11,6 @@ Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.gz Patch1: dpdk-config.patch Patch2: enic-pun-fix.patch -Patch3: null_array-bounds.patch Summary: Set of libraries and drivers for fast packet processing @@ -73,7 +72,6 @@ API programming documentation for the Data Plane Development Kit. %setup -q %patch1 -p2 -z .config %patch2 -p2 -z .enic -%patch3 -p2 -z .null %if %{with shared} sed -i 's:^CONFIG_RTE_BUILD_SHARED_LIB=n$:CONFIG_RTE_BUILD_SHARED_LIB=y:g' config/common_linuxapp @@ -81,7 +79,9 @@ sed -i 's:^CONFIG_RTE_BUILD_SHARED_LIB=n$:CONFIG_RTE_BUILD_SHARED_LIB=y:g' confi %build -export EXTRA_CFLAGS="%{optflags} -fPIC" +# For the release, '-Wno-error=array-bounds' is done to prevent a spurious error +# generated by gcc 5.X against the 2.1 branch +export EXTRA_CFLAGS="%{optflags} -Wformat -fPIC -Wno-error=array-bounds" # DPDK defaults to using builder-specific compiler flags. However, # the config has been changed by specifying CONFIG_RTE_MACHINE=default diff --git a/null_array-bounds.patch b/null_array-bounds.patch deleted file mode 100644 index b2b3b17..0000000 --- a/null_array-bounds.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up ./dpdk-2.1.0/drivers/net/null/rte_eth_null.c.null ./dpdk-2.1.0/drivers/net/null/rte_eth_null.c ---- ./dpdk-2.1.0/drivers/net/null/rte_eth_null.c.null 2015-08-17 13:35:37.000000000 -0400 -+++ ./dpdk-2.1.0/drivers/net/null/rte_eth_null.c 2015-08-26 10:34:03.060418807 -0400 -@@ -71,8 +71,13 @@ struct pmd_internals { - unsigned nb_rx_queues; - unsigned nb_tx_queues; - -- struct null_queue rx_null_queues[1]; -- struct null_queue tx_null_queues[1]; -+ /* -+ * NH these should both be 1, but we want to work -+ * around a gcc compiler error here -+ * as -Werror=array-bounds trips over this when its 1 -+ */ -+ struct null_queue rx_null_queues[2]; -+ struct null_queue tx_null_queues[2]; - }; - -