All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Aaro Koskinen <aaro.koskinen-OYasijW0DpE@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH] mk: pass CROSS_COMPILE when compiling kernel modules
Date: Thu, 17 Apr 2014 15:38:06 +0200	[thread overview]
Message-ID: <1472845.ooNuTRJrP7@xps13> (raw)
In-Reply-To: <20140307133226.GV15431-wKwWf7Pro3RJlwZWLBHdvBaOaYmgohGe0e7PPNI6Mm0@public.gmane.org>

Hi,

2014-03-07 15:32, Aaro Koskinen:
> 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 <aaro.koskinen-OYasijW0DpE@public.gmane.org>
> > 
> > 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.

Acked-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

It's applied for version 1.6.0r2.

Thanks
-- 
Thomas

      parent reply	other threads:[~2014-04-17 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 16:44 [PATCH] mk: pass CROSS_COMPILE when compiling kernel modules Aaro Koskinen
     [not found] ` <1391791458-17601-1-git-send-email-aaro.koskinen-OYasijW0DpE@public.gmane.org>
2014-02-25 21:55   ` Thomas Monjalon
2014-03-07 13:32     ` Aaro Koskinen
     [not found]       ` <20140307133226.GV15431-wKwWf7Pro3RJlwZWLBHdvBaOaYmgohGe0e7PPNI6Mm0@public.gmane.org>
2014-04-17 13:38         ` Thomas Monjalon [this message]

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=1472845.ooNuTRJrP7@xps13 \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=aaro.koskinen-OYasijW0DpE@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.