From patchwork Wed Oct 25 17:17:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 30900 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D7D01B808; Wed, 25 Oct 2017 19:17:52 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DAD101B669 for ; Wed, 25 Oct 2017 19:17:50 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 25 Oct 2017 10:17:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,432,1503385200"; d="scan'208";a="142161500" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by orsmga004.jf.intel.com with ESMTP; 25 Oct 2017 10:17:48 -0700 From: Ferruh Yigit To: Santosh Shukla , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit Date: Wed, 25 Oct 2017 18:17:46 +0100 Message-Id: <20171025171746.64844-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025090304.67133-1-ferruh.yigit@intel.com> References: <20171025090304.67133-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] net/octeontx: fix build for gcc < 4.6 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -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 --- v2: * version check should be only for gcc * Kept Ack from Santosh --- drivers/net/octeontx/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile index 0a8775a16..30fb459af 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