From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by dpdk.org (Postfix) with ESMTP id 57358333 for ; Fri, 7 Mar 2014 14:32:13 +0100 (CET) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd001.nsn-inter.net (8.12.11.20060308/8.12.11) with ESMTP id s27DXdjf009215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 7 Mar 2014 14:33:39 +0100 Received: from ak-desktop.emea.nsn-net.net ([10.144.36.74]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with SMTP id s27DXbx6020786; Fri, 7 Mar 2014 14:33:38 +0100 Received: by ak-desktop.emea.nsn-net.net (sSMTP sendmail emulation); Fri, 07 Mar 2014 15:32:27 +0200 Date: Fri, 7 Mar 2014 15:32:27 +0200 From: Aaro Koskinen To: Thomas Monjalon Message-ID: <20140307133226.GV15431@ak-desktop.emea.nsn-net.net> References: <1391791458-17601-1-git-send-email-aaro.koskinen@nsn.com> <2031701.DtHZU1GqtL@x220> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2031701.DtHZU1GqtL@x220> User-Agent: Mutt/1.5.21 (2010-09-15) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 1238 X-purgate-ID: 151667::1394199220-00001FA8-2733EE30/0-0/0-0 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] mk: pass CROSS_COMPILE when compiling kernel modules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 13:32:13 -0000 Hi, On Tue, Feb 25, 2014 at 10:55:36PM +0100, Thomas Monjalon wrote: > 07/02/2014 18:44, Aaro Koskinen : > > Pass CROSS_COMPILE to the kernel build system when compiling kernel > > modules. Although we export CC etc. the top level kernel Makefile will > > override the environment. As a result it will end up using wrong tools > > if cross-compilation is desired but CROSS_COMPILE is not set. > > > > Signed-off-by: Aaro Koskinen > > Could you explain why it's needed ? > In a basic test, CC=$(CROSS)gcc in rte.vars.mk seems sufficient. If you compile on 32-bit host to 64-bit target, the build fails with errors such as: [...]include/linux/kernfs.h:331:1: note: expected 'const char *' but argument is of type 'const unsigned char *' kernfs_find_and_get(struct kernfs_node *kn, const char *name) ^ cc1: all warnings being treated as errors Build with V=1 shows that following appears in the command line when compiling the kernel modules: -isystem /usr/lib/gcc/i486-linux-gnu/4.8/include With the patch this will be corrected to point to my target's sysroot: -isystem /foo/bar/lib/gcc/x86_64-linux-gnu/4.8.2/include And the build succeeds without any warnings. A.