From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 21E48A09E4;
	Fri, 29 Jan 2021 16:39:42 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 786ED4067B;
	Fri, 29 Jan 2021 16:39:41 +0100 (CET)
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by mails.dpdk.org (Postfix) with ESMTP id DCC8040395
 for <dev@dpdk.org>; Fri, 29 Jan 2021 16:39:39 +0100 (CET)
IronPort-SDR: W/acP0BRdYzyMI6ycRlXLgX9yJ4goqSte5OBh27qN+5WRWYxSj8qwFHK4bD64Si2mtuJWi8Ycj
 aNonMFE7TM1A==
X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="180579658"
X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="180579658"
Received: from orsmga008.jf.intel.com ([10.7.209.65])
 by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 29 Jan 2021 07:39:37 -0800
IronPort-SDR: R9I3lXRLiqf0S9TDIAUDcRN5lpmbifGA/i+5uYvpjpmBQmXuTYopmeTug5a3+JsZKVqtiQqdZU
 05aWzq8A+/DA==
X-IronPort-AV: E=Sophos;i="5.79,385,1602572400"; d="scan'208";a="389342411"
Received: from bricha3-mobl.ger.corp.intel.com ([10.252.20.59])
 by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA;
 29 Jan 2021 07:39:35 -0800
Date: Fri, 29 Jan 2021 15:39:32 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Juraj =?utf-8?Q?Linke=C5=A1?= <juraj.linkes@pantheon.tech>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
 "Ruifeng.Wang@arm.com" <Ruifeng.Wang@arm.com>,
 "jerinjacobk@gmail.com" <jerinjacobk@gmail.com>,
 "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
 "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
 "aboyer@pensando.io" <aboyer@pensando.io>, "dev@dpdk.org" <dev@dpdk.org>
Message-ID: <20210129153932.GJ929@bricha3-MOBL.ger.corp.intel.com>
References: <1611916159-32158-1-git-send-email-juraj.linkes@pantheon.tech>
 <20210129114340.GE929@bricha3-MOBL.ger.corp.intel.com>
 <a39ce661d67d4440a60c47b5f64060d0@pantheon.tech>
 <20210129135116.GG929@bricha3-MOBL.ger.corp.intel.com>
 <bb861ebbc32d41a283b4fb48d3fdb500@pantheon.tech>
 <20210129144225.GH929@bricha3-MOBL.ger.corp.intel.com>
 <b5a18076a9eb4cf1ba9709310c12c2a0@pantheon.tech>
 <20210129150105.GI929@bricha3-MOBL.ger.corp.intel.com>
 <6d59b6aaa6ae4697ae7200254be55065@pantheon.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <6d59b6aaa6ae4697ae7200254be55065@pantheon.tech>
Subject: Re: [dpdk-dev] [RFC PATCH v1] build: kni gcc cross-compilation
 support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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 Fri, Jan 29, 2021 at 03:17:02PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Friday, January 29, 2021 4:01 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: thomas@monjalon.net; Ruifeng.Wang@arm.com; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> > dev@dpdk.org
> > Subject: Re: [RFC PATCH v1] build: kni gcc cross-compilation support
> > 
> > On Fri, Jan 29, 2021 at 02:47:57PM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > Sent: Friday, January 29, 2021 3:42 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Cc: thomas@monjalon.net; Ruifeng.Wang@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > > ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org
> > > > Subject: Re: [RFC PATCH v1] build: kni gcc cross-compilation support
> > > >
> > <snip>
> > > > > > Can we find some way of getting it working for both cases.
> > > > > > For native builds we want:
> > > > > >
> > > > > > * build kernel-dir = /lib/modules/<ver>/build
> > > > > > * install dir = /lib/modules/<ver>/extra/dpdk
> > > > > >
> > > > > > What are the expected equivalent paths for cross building?
> > > > > >
> > > > >
> > > > > The ubuntu1804 packages are installing aarch64 cross files to
> > > > > /usr/aarch64-
> > > > linux-gnu, so we could install it to /usr/aarch64-linux-
> > > > gnu/lib/modules/<ver>/extra/dpdk, or
> > > > /usr/<cross_triple>/lib/modules/<ver>/extra/dpdk in general. I think
> > > > we can get <ver> from 'make kernelversion', so that would work,
> > > > although I'm not sure this is the right place.
> > > > >
> > > > So what do you specify as the "kernel_dir" for the cross compile?
> > > >
> > >
> > > The place where I cloned (and cross-compiled) linux sources: $HOME/linux.
> > >
> > So I think the key problem is that for cross-compilation you need two completely
> > independent paths, while for native builds the two can be linked. Is that correct?
> 
> Assuming that we want to install cross modules, then yes, although it's incomplete. There's also the scenario when a user would use different kernel_dir than the default for native builds. I don't know why anyone would do that, but it is a theoretical possibility :-)

In the cross-compile install case, is the prefix /usr/aarch64-linux-gnu/
coming from a DESTDIR environment variable? If it is, then we could just
use the kernel_dir option for the build path, and always install to
/lib/modules/<ver>/... allowing any cross-compiler relocation to take care
of the rest.