Skip to contentSkip to conversation

net/octeontx: fix build for gcc < 4.6

PATCH Superseded Ferruh Yigit 2 participants 4 messages Oct 25, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/octeontx: fix build for gcc < 4.6

-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")
---
 drivers/net/octeontx/Makefile | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/octeontx/Makefile +5 -0
index 0a8775a16..6197b66f4 100644
@@ -59,7 +59,12 @@ SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx_ethdev.c
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_octeontx_rxtx.o += -fno-prefetch-loop-arrays
 endif
+
+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
 
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ferruh Yigit

-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")

---

Thanks.

#2 lore raw

PATCH v2 1/1 net/octeontx: fix build for gcc < 4.6

In reply to Ferruh Yigit

-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")

---

v2:
* version check should be only for gcc
* Kept Ack from Santosh

---
 drivers/net/octeontx/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/octeontx/Makefile +8 -0
index 0a8775a16..30fb459af 100644
@@ -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
Signature · 1 line
2.13.6
author Applied
#3 lore raw
Quoted 11 lines · Ferruh Yigit

-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")

Applied to dpdk-next-net/master, thanks.