From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH 2/3] event/octeontx: fix compilation for gcc < 4.6 Date: Thu, 6 Apr 2017 17:56:01 +0530 Message-ID: <20170406122559.GA18255@jerin> References: <20170406121428.16883-1-ferruh.yigit@intel.com> <20170406121428.16883-2-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Bruce Richardson , Harry van Haaren , Thomas Monjalon , dev@dpdk.org To: Ferruh Yigit Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0070.outbound.protection.outlook.com [104.47.34.70]) by dpdk.org (Postfix) with ESMTP id C07C1108D for ; Thu, 6 Apr 2017 14:26:23 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20170406121428.16883-2-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Thu, 6 Apr 2017 13:14:27 +0100 > From: Ferruh Yigit > To: Jerin Jacob , Bruce Richardson > , Harry van Haaren > , Thomas Monjalon > Cc: dev@dpdk.org, Ferruh Yigit > Subject: [PATCH 2/3] event/octeontx: fix compilation for gcc < 4.6 > X-Mailer: git-send-email 2.8.4 > > -Ofast option supported from gcc4.6 [1], for older versions using > "-O3 -ffast-math" instead. > > [1] build error: > cc1: error: invalid option argument ‘-Ofast’ > > Also struct initialization build error [2] fixed. > > [2] build error: > .../event/octeontx/ssovf_mbox.c: In function ‘mbox_send_request’: > .../event/octeontx/ssovf_mbox.c:95:9: error: unknown field ‘u64’ > specified in initializer > > Fixes: 32ff26393bb2 ("event/octeontx: add SSO HW device operations") > > Signed-off-by: Ferruh Yigit Acked-by: Jerin Jacob > --- > drivers/event/octeontx/Makefile | 9 +++++++++ > drivers/event/octeontx/ssovf_mbox.c | 2 +- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile > index b26e35b..aca3d09 100644 > --- a/drivers/event/octeontx/Makefile > +++ b/drivers/event/octeontx/Makefile > @@ -50,10 +50,19 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_probe.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_mbox.c > + > ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > CFLAGS_ssovf_worker.o += -fno-prefetch-loop-arrays > + > +ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1) > +CFLAGS_ssovf_worker.o += -Ofast > +else > +CFLAGS_ssovf_worker.o += -O3 -ffast-math > endif > + > +else > CFLAGS_ssovf_worker.o += -Ofast > +endif > > # install this header file > SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)-include := rte_pmd_octeontx_ssovf.h > diff --git a/drivers/event/octeontx/ssovf_mbox.c b/drivers/event/octeontx/ssovf_mbox.c > index 0435f6d..f42969c 100644 > --- a/drivers/event/octeontx/ssovf_mbox.c > +++ b/drivers/event/octeontx/ssovf_mbox.c > @@ -92,7 +92,7 @@ mbox_send_request(struct mbox *m, struct octeontx_mbox_hdr *hdr, > const void *txmsg, uint16_t txsize) > { > struct mbox_ram_hdr old_hdr; > - struct mbox_ram_hdr new_hdr = {.u64 = 0}; > + struct mbox_ram_hdr new_hdr = {{0}}; > uint64_t *ram_mbox_hdr = (uint64_t *)m->ram_mbox_base; > uint8_t *ram_mbox_msg = m->ram_mbox_base + sizeof(struct mbox_ram_hdr); > > -- > 2.9.3 >