From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E0213A2F18
	for <public@inbox.dpdk.org>; Thu,  3 Oct 2019 12:36:03 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 1B40F1C027;
	Thu,  3 Oct 2019 12:36:03 +0200 (CEST)
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 3E9121C025
 for <dev@dpdk.org>; Thu,  3 Oct 2019 12:36:01 +0200 (CEST)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 03 Oct 2019 03:36:00 -0700
X-IronPort-AV: E=Sophos;i="5.67,251,1566889200"; d="scan'208";a="367003986"
Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.95])
 by orsmga005-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 03 Oct 2019 03:35:58 -0700
Date: Thu, 3 Oct 2019 11:35:54 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>
Message-ID: <20191003103554.GC1803@bricha3-MOBL.ger.corp.intel.com>
References: <1570035347-18360-1-git-send-email-david.marchand@redhat.com>
 <20191003092117.GA1803@bricha3-MOBL.ger.corp.intel.com>
 <CAJFAV8x_97A5i543JtT++2z4QuvRFrW6Su=KcC6349ATsPyPzA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAJFAV8x_97A5i543JtT++2z4QuvRFrW6Su=KcC6349ATsPyPzA@mail.gmail.com>
User-Agent: Mutt/1.11.4 (2019-03-13)
Subject: Re: [dpdk-dev] [PATCH] devtools: reset compilation flags for each
 target
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Thu, Oct 03, 2019 at 12:08:30PM +0200, David Marchand wrote:
> On Thu, Oct 3, 2019 at 11:21 AM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Wed, Oct 02, 2019 at 06:55:47PM +0200, David Marchand wrote:
> > > Same idea than overriding PATH and PKG_CONFIG_PATH, it can be quite
> > > useful to override compilation flags like CFLAGS, CPPFLAGS and LDFLAGS
> > > for cross compilation or libraries that won't provide a pkg-config file.
> > >
> > > Fixes: 272236741258 ("devtools: load target-specific compilation environment")
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > ---
> >
> > No strong objection to this change, but for meson the better way to handle
> > this may be to put these flags into the cross-file used for the build. By
> > explicitly passing CFLAGS etc. to the build, I'm not sure what the
> > behaviour is with regards to passing those flags to cross-built vs
> > native-built components. For a cross-compile, not all CFLAGS should be
> > passed to the build of pmdinfogen, for instance.
> 
> Ok, I see.
> 
> Then the only usecase would be for locally built libraries that meson
> can't find by itself.
> A bit hackish too.
> 
> Mm, is there a way to tell meson "library X (CFLAGS, LDFLAGS) is (xx, yy)" ?
> I could write some local .pc files and override PKG_CONFIG_PATH...
> Any better idea ?
>
If the scheme here using CFLAGS/LDFLAGS works just go with it for now.

Ideally for cross compiles, we could consider taking the stored
cross-compile files and copying them to /tmp and then adding the additional
flags there.  However, for just passing flags to help find library X or Y,
its probably not worth doing, so let's keep it simple until we need
something more powerful. I was just pointing out that this could cause
issues in the future if we do start using it for something more fancy...