From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: Re: [PATCH 1/2] build: fix kernel compile on cross-build Date: Thu, 19 Apr 2018 17:06:41 +0000 Message-ID: References: <20180418210521.277384-1-bruce.richardson@intel.com> <20180418210521.277384-2-bruce.richardson@intel.com> <20180419161251.GA26648@bricha3-MOBL.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Bruce Richardson Return-path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0069.outbound.protection.outlook.com [104.47.2.69]) by dpdk.org (Postfix) with ESMTP id 252E98D95 for ; Thu, 19 Apr 2018 19:06:42 +0200 (CEST) In-Reply-To: <20180419161251.GA26648@bricha3-MOBL.ger.corp.intel.com> Content-Language: en-US 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----- > > > 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') !=3D '' 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. > > >=20 > 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. >=20 > However, we could certainly add in a check to see if the kernel sources a= re > 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? [Hemant] Yes. A warning instead of error is good in this case. >=20 > /Bruce