From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3A27C199A9 for ; Thu, 7 Sep 2017 15:52:16 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 07 Sep 2017 06:52:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,358,1500966000"; d="scan'208";a="1012002139" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.24]) by orsmga003.jf.intel.com with SMTP; 07 Sep 2017 06:52:14 -0700 Received: by (sSMTP sendmail emulation); Thu, 07 Sep 2017 14:52:13 +0100 Date: Thu, 7 Sep 2017 14:52:13 +0100 From: Bruce Richardson To: "Van Haaren, Harry" Cc: "dev@dpdk.org" Message-ID: <20170907135213.GA33788@bricha3-MOBL3.ger.corp.intel.com> References: <20170901100416.80264-1-bruce.richardson@intel.com> <20170901100416.80264-2-bruce.richardson@intel.com> <20170904135101.GB22056@bricha3-MOBL3.ger.corp.intel.com> <20170906161846.GA26160@bricha3-MOBL3.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170906161846.GA26160@bricha3-MOBL3.ger.corp.intel.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.8.3 (2017-05-23) Subject: Re: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure for meson & ninja builds 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, 07 Sep 2017 13:52:17 -0000 On Wed, Sep 06, 2017 at 05:18:46PM +0100, Bruce Richardson wrote: > On Mon, Sep 04, 2017 at 02:51:01PM +0100, Bruce Richardson wrote: > > On Mon, Sep 04, 2017 at 02:36:42PM +0100, Van Haaren, Harry wrote: > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce > > > > Richardson Sent: Friday, September 1, 2017 11:04 AM To: > > > > dev@dpdk.org Cc: Richardson, Bruce > > > > Subject: [dpdk-dev] [PATCH 01/17] build: add initial > > > > infrastructure for meson & ninja builds > > > > > > > > To build with meson and ninja, we need some initial > > > > infrastructure in place. The build files for meson always need > > > > to be called "meson.build", and options get placed in > > > > meson_options.txt > > > > > > > > This commit adds a top-level meson.build file, which sets up the > > > > global variables for tracking drivers, libraries, etc., and then > > > > includes other build files, before finishing by writing the > > > > global build configuration header file and a DPDK pkgconfig file > > > > at the end, using some of those same globals. > > > > > > > > From the top level build file, the only include file thus far is > > > > for the config folder, which does some other setup of global > > > > configuration parameters, including pulling in architecture > > > > specific parameters from an architectural subdirectory. A number > > > > of configuration build options are provided for the project to > > > > tune a number of global variables which will be used later e.g. > > > > max numa nodes, max cores, etc. These settings all make their > > > > way to the global build config header "rte_build_config.h". > > > > There is also a file "rte_config.h", which includes > > > > "rte_build_config.h", and this file is meant to hold other > > > > build-time values which are present in our current static build > > > > configuration but are not normally meant for user-configuration. > > > > Ideally, over time, the values placed here should be moved to > > > > the individual libraries or drivers which want those values. > > > > > > > > Signed-off-by: Bruce Richardson > > > > > > Comments inline below; > > > > > > > > > > > > > diff --git a/config/meson.build b/config/meson.build > > > > > > > +# disable any unwanted warnings +unwanted_warnings = [ + > > > > '-Wno-address-of-packed-member', + '-Wno-format-truncation' > > > > +] +foreach arg: unwanted_warnings + if cc.has_argument(arg) > > > > + add_project_arguments(arg, language: 'c') + > > > > endif +endforeach > > > > > > I can't fault the code here, or Meson, just noting that the > > > disabling of these warnings causes prints on GCC 4.8.5 and GCC > > > 5.4.0, GCC 7 only prints on -Wno-address-of-packed-member. Clang > > > handles it correctly - and no out-of-the-ordinary prints occur. No > > > code changes required here. > > > > > > > Strange. Just tested with gcc 4.8.5 and gcc 5.4, and everything > > worked as expected, no errors or warnings. > > > Dug into the invalid flag warnings a bit more and found a number of > items in the root cause. > > First is that gcc only complains about invalid -Wno-* parameters in > the case where there is another error or warning being printed. This > explains why the warnings are only seen for some files, rather than > others. Second is that, because of this meson, is not correctly > identifying the relevant flags as unsupported by the compiler. I'm > looking to upstream to meson a fix for this. Third is that there are > more warnings that need to be disabled for some files when compiled > with gcc 5.4. So long as there are no other problems with the code, > gcc will never print the errors about the invalid warning disable > flags. > > So, for V2 of this, I hope to fix point 3. > [Hopefully] Final update here. It appears that this is an issue that only appears on Ubuntu, as I can't reproduce it on Fedora with any of a number of gcc version when I turn on -Wunused-result flag. I believe that this may be due to extra hardening in the standard headers that is done on Ubuntu to mark the functions as requiring the extra checking. To fix these, rather than disable the warnings - something that may hide other problems, I've sent two small patches [1] [2] to add return value checks to the code as applicable. /Bruce [1] http://dpdk.org/dev/patchwork/patch/28457/ [2] http://dpdk.org/dev/patchwork/patch/28458/