From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D67F97EBB for ; Thu, 19 Apr 2018 18:12:57 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2018 09:12:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,469,1517904000"; d="scan'208";a="34904356" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51]) by orsmga008.jf.intel.com with SMTP; 19 Apr 2018 09:12:52 -0700 Received: by (sSMTP sendmail emulation); Thu, 19 Apr 2018 17:12:52 +0100 Date: Thu, 19 Apr 2018 17:12:51 +0100 From: Bruce Richardson To: Hemant Agrawal Cc: "dev@dpdk.org" Message-ID: <20180419161251.GA26648@bricha3-MOBL.ger.corp.intel.com> References: <20180418210521.277384-1-bruce.richardson@intel.com> <20180418210521.277384-2-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH 1/2] build: fix kernel compile on cross-build 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, 19 Apr 2018 16:12:58 -0000 On Thu, Apr 19, 2018 at 03:46:14PM +0000, Hemant Agrawal wrote: > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > > > > When cross-compiling, if no kernel_dir was specified, then the kernel modules > > were still being compiled for the build machine. Fix this by only building modules > > on cross-compile when we have a kernel_dir value set. > > > > Fixes: a52f4574f798 ("igb_uio: build with meson") > > > > Signed-off-by: Bruce Richardson > > --- > > meson.build | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/meson.build b/meson.build > > index cc16595cb..9e3b44931 100644 > > --- a/meson.build > > +++ b/meson.build > > @@ -26,10 +26,14 @@ subdir('config') > > > > # build libs and drivers > > subdir('lib') > > -subdir('kernel') > > subdir('buildtools') > > subdir('drivers') > > > > +# build kernel modules if we have a kernel path, or we are not cross > > +compiling if get_option('kernel_dir') != '' or not meson.is_cross_build() > > + subdir('kernel') > > +endif > > [Hemant] actually kernel_dir may not be always available on host. > So unless kernel_dir is available - irrespective of host/cross - it > shall not try kernel compilation. > Well, for many native builds the kernel directory can be computed by looking at `uname -r`, but which won't work for cross-compilation. Given that there is already an option to disable kernel module compilation completely, I think that the default for native builds should be try and build modules for the running kernel. However, we could certainly add in a check to see if the kernel sources are available, and optionally not build them in that case - i.e. convert the error due to non-existant kernel headers into a warning message. Do you think that might be a good compromise? /Bruce