From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 991585F19 for ; Thu, 2 May 2019 15:26:37 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 06:26:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,421,1549958400"; d="scan'208";a="147663936" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.48]) by fmsmga007.fm.intel.com with SMTP; 02 May 2019 06:26:34 -0700 Received: by (sSMTP sendmail emulation); Thu, 02 May 2019 14:26:34 +0100 Date: Thu, 2 May 2019 14:26:34 +0100 From: Bruce Richardson To: David Marchand Cc: Reshma Pattan , dev Message-ID: <20190502132630.GD1980@bricha3-MOBL.ger.corp.intel.com> References: <20190502093334.7546-1-reshma.pattan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 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: , X-List-Received-Date: Thu, 02 May 2019 13:26:38 -0000 On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote: > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan > wrote: > > > gcc 9 on Fedora 30 gives an error > > "taking address of packed member may result in an > > unaligned pointer value" warnings. > > > > For clang builds this warning is already disabled, > > so disable "-Waddress-of-packed-member" for gcc builds > > also. > > > > Snippet of build error: > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address > > of packed member of ‘struct rte_mem_config’ may result in an unaligned > > pointer value [-Werror=address-of-packed-member] > > 768 | cur_msl = &mcfg->memsegs[msl_idx]; > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > > > Signed-off-by: Reshma Pattan > > --- > > mk/toolchain/gcc/rte.vars.mk | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > > index d8b99faf6..b852fcfd7 100644 > > --- a/mk/toolchain/gcc/rte.vars.mk > > +++ b/mk/toolchain/gcc/rte.vars.mk > > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2 > > WERROR_FLAGS += -Wno-format-truncation > > endif > > > > +# disable packed member unalign warnings > > +WERROR_FLAGS += -Wno-address-of-packed-member > > + > > export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF > > export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS > > -- > > 2.21.0 > > > > > Not the best approach to me... > Agreed, but this fix does seem reasonable since we already disable this warning for clang. > Let me install a fedora 30 and have a look. Hopefully you can come up with a better fix, but I think we need something soon for 19.05, so this patch may be needed as a stop-gap fix. /Bruce From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7821CA0AC5 for ; Thu, 2 May 2019 15:26:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E60C95F1B; Thu, 2 May 2019 15:26:38 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 991585F19 for ; Thu, 2 May 2019 15:26:37 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2019 06:26:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,421,1549958400"; d="scan'208";a="147663936" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.48]) by fmsmga007.fm.intel.com with SMTP; 02 May 2019 06:26:34 -0700 Received: by (sSMTP sendmail emulation); Thu, 02 May 2019 14:26:34 +0100 Date: Thu, 2 May 2019 14:26:34 +0100 From: Bruce Richardson To: David Marchand Cc: Reshma Pattan , dev Message-ID: <20190502132630.GD1980@bricha3-MOBL.ger.corp.intel.com> References: <20190502093334.7546-1-reshma.pattan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 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" Message-ID: <20190502132634.BmNQbe9VFYiNNgwtD4BfyVJ973Qjuq0dzOoya1VnNiA@z> On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote: > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan > wrote: > > > gcc 9 on Fedora 30 gives an error > > "taking address of packed member may result in an > > unaligned pointer value" warnings. > > > > For clang builds this warning is already disabled, > > so disable "-Waddress-of-packed-member" for gcc builds > > also. > > > > Snippet of build error: > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking address > > of packed member of ‘struct rte_mem_config’ may result in an unaligned > > pointer value [-Werror=address-of-packed-member] > > 768 | cur_msl = &mcfg->memsegs[msl_idx]; > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > > > Signed-off-by: Reshma Pattan > > --- > > mk/toolchain/gcc/rte.vars.mk | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > > index d8b99faf6..b852fcfd7 100644 > > --- a/mk/toolchain/gcc/rte.vars.mk > > +++ b/mk/toolchain/gcc/rte.vars.mk > > @@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2 > > WERROR_FLAGS += -Wno-format-truncation > > endif > > > > +# disable packed member unalign warnings > > +WERROR_FLAGS += -Wno-address-of-packed-member > > + > > export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF > > export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS > > -- > > 2.21.0 > > > > > Not the best approach to me... > Agreed, but this fix does seem reasonable since we already disable this warning for clang. > Let me install a fedora 30 and have a look. Hopefully you can come up with a better fix, but I think we need something soon for 19.05, so this patch may be needed as a stop-gap fix. /Bruce