From f064b2cba090c730cc0db38b533b70aa5d1bed12 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Wed, 25 Oct 2017 18:17:46 +0100 Subject: [PATCH] net/octeontx: fix build for gcc < 4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit -Ofast option supported starting from gcc4.6 [1], for older versions using "-O3 -ffast-math" instead. [1] build error: CC octeontx_rxtx.o cc1: error: invalid option argument ‘-Ofast’ Fixes: 9e747589bd4c ("net/octeontx: add packet transmit burst function") Signed-off-by: Ferruh Yigit Acked-by: Santosh Shukla --- drivers/net/octeontx/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile index 0a8775a16c..30fb459afc 100644 --- a/drivers/net/octeontx/Makefile +++ b/drivers/net/octeontx/Makefile @@ -58,8 +58,16 @@ SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_ethdev.c ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_octeontx_rxtx.o += -fno-prefetch-loop-arrays + +ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1) +CFLAGS_octeontx_rxtx.o += -O3 -Ofast +else +CFLAGS_octeontx_rxtx.o += -O3 -ffast-math endif + +else CFLAGS_octeontx_rxtx.o += -O3 -Ofast +endif LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -- 2.39.5