DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] build: fix kernel compile on cross-build
Date: Thu, 19 Apr 2018 17:12:51 +0100	[thread overview]
Message-ID: <20180419161251.GA26648@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <AM2PR04MB0753DEEC62764C112BD9D2C989B50@AM2PR04MB0753.eurprd04.prod.outlook.com>

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 <bruce.richardson@intel.com>
> > ---
> >  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

  reply	other threads:[~2018-04-19 16:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 21:05 [dpdk-dev] [PATCH 0/2] small fixes for meson build Bruce Richardson
2018-04-18 21:05 ` [dpdk-dev] [PATCH 1/2] build: fix kernel compile on cross-build Bruce Richardson
2018-04-19 15:46   ` Hemant Agrawal
2018-04-19 16:12     ` Bruce Richardson [this message]
2018-04-19 17:06       ` Hemant Agrawal
2018-04-18 21:05 ` [dpdk-dev] [PATCH 2/2] build: fix check for libbsd in meson Bruce Richardson
2018-04-27 13:49 ` [dpdk-dev] [PATCH v2 0/3] small improvements to meson build Bruce Richardson
2018-04-27 13:49   ` [dpdk-dev] [PATCH v2 1/3] build: fix kernel compile on cross-build Bruce Richardson
2018-04-27 13:49   ` [dpdk-dev] [PATCH v2 2/3] build: fix check for libbsd in meson Bruce Richardson
2018-04-27 13:51     ` Bruce Richardson
2018-04-27 17:51       ` Vladimir Medvedkin
2018-04-27 13:49   ` [dpdk-dev] [PATCH v2 3/3] build: ensure compatibility with future meson versions Bruce Richardson
2018-04-27 14:37   ` [dpdk-dev] [PATCH v2 0/3] small improvements to meson build Luca Boccassi
2018-05-08 20:22     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180419161251.GA26648@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).