-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 <ferruh.yigit@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
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