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 <aconole@redhat.com> Acked-by: Neil Horman <nhorman@redhat.com> Acked-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
parent
b41f5f17db
commit
f8c235c907
@ -11,7 +11,6 @@ Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.gz
|
|||||||
|
|
||||||
Patch1: dpdk-config.patch
|
Patch1: dpdk-config.patch
|
||||||
Patch2: enic-pun-fix.patch
|
Patch2: enic-pun-fix.patch
|
||||||
Patch3: null_array-bounds.patch
|
|
||||||
|
|
||||||
Summary: Set of libraries and drivers for fast packet processing
|
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
|
%setup -q
|
||||||
%patch1 -p2 -z .config
|
%patch1 -p2 -z .config
|
||||||
%patch2 -p2 -z .enic
|
%patch2 -p2 -z .enic
|
||||||
%patch3 -p2 -z .null
|
|
||||||
|
|
||||||
%if %{with shared}
|
%if %{with shared}
|
||||||
sed -i 's:^CONFIG_RTE_BUILD_SHARED_LIB=n$:CONFIG_RTE_BUILD_SHARED_LIB=y:g' config/common_linuxapp
|
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
|
%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,
|
# DPDK defaults to using builder-specific compiler flags. However,
|
||||||
# the config has been changed by specifying CONFIG_RTE_MACHINE=default
|
# the config has been changed by specifying CONFIG_RTE_MACHINE=default
|
||||||
|
@ -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];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user