All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile
@ 2012-09-30 23:20 Jason Gunthorpe
  2012-10-30 13:46 ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2012-09-30 23:20 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek

To make cross building a little simpler. The usage with mini-config would
be something like:

$ mkdir build
$ make ARCH=arm CROSS_COMPILE=arm-v5te-linux-gnueabi- \
       KCONFIG_ALLCONFIG=mini.config O=build allnoconfig
$ make -C build/

After configuring subsequent builds do not need to specify the cross
options.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 scripts/mkmakefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc0442..7cdc3fb 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -56,4 +56,9 @@ Makefile:;
 
 %/: all
 	@:
+
+CROSS_COMPILE?=${CROSS_COMPILE:-}
+${CROSS_COMPILE:+export CROSS_COMPILE}
+ARCH?=${ARCH:-}
+${ARCH:+export ARCH}
 EOF
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile
  2012-09-30 23:20 [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile Jason Gunthorpe
@ 2012-10-30 13:46 ` Michal Marek
  2012-10-30 15:19   ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Marek @ 2012-10-30 13:46 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-kbuild

On 1.10.2012 01:20, Jason Gunthorpe wrote:
> To make cross building a little simpler. The usage with mini-config would
> be something like:
> 
> $ mkdir build
> $ make ARCH=arm CROSS_COMPILE=arm-v5te-linux-gnueabi- \
>        KCONFIG_ALLCONFIG=mini.config O=build allnoconfig
> $ make -C build/

Are you sure this is not going to suffer from the same issues as
5755433? See

commit 2331d1a6cd3d6e580bc88b9a160066d9e1177fe1
Author: Sam Ravnborg <sam@ravnborg.org>
Date:   Sun Oct 11 23:22:58 2009 +0200

    kbuild: revert "save ARCH & CROSS_COMPILE ..."

    Revert commit 575543347b5baed0ca927cb90ba8807396fe9cc9

    It caused following issues:

    - On architectures where ARCH= setting is used to select between
      32 and 64 bit this was no longer possible without "make mrproper"
    - If ARCH was changed then kbuild refused to run "make mrproper"
      because ARCH had changed
    - When CROSS_COMPILE was changed people were asked to run "make
mrproper"
      but kbuild refused to run "make mrproper" because CROSS_COMPILE
changed.
    - Spaces in CROSS_COMPILE was not 'supported'
    - If an non-existing ARCH= was used kbuild could get stuck

    Lessons learned:
    . Despite being simple and straghtforward people uses very different
      approaches when building the kernel.

    . CROSS_COMPILE is sometimes used for ccache despite cache being
      only a CC frontend so one would have expected CC to be
      used for this purpose.

    . And obviously this was not tested widely enough.

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile
  2012-10-30 13:46 ` Michal Marek
@ 2012-10-30 15:19   ` Jason Gunthorpe
  2012-10-30 15:28     ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2012-10-30 15:19 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

On Tue, Oct 30, 2012 at 02:46:19PM +0100, Michal Marek wrote:
> On 1.10.2012 01:20, Jason Gunthorpe wrote:
> > To make cross building a little simpler. The usage with mini-config would
> > be something like:
> > 
> > $ mkdir build
> > $ make ARCH=arm CROSS_COMPILE=arm-v5te-linux-gnueabi- \
> >        KCONFIG_ALLCONFIG=mini.config O=build allnoconfig
> > $ make -C build/
> 
> Are you sure this is not going to suffer from the same issues as
> 5755433? See

Thanks for this link, this is the first time I've seen that, so no :)

The approaches are different, my version that uses mkmakefile probably
avoids some problems (like the quoting issue) but I'm not sure about
mrproper. I've never seen mrproper complain, but I've always used this
patch with O=..

Let me review this information and get back to you.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile
  2012-10-30 15:19   ` Jason Gunthorpe
@ 2012-10-30 15:28     ` Michal Marek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2012-10-30 15:28 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-kbuild

On 30.10.2012 16:19, Jason Gunthorpe wrote:
> On Tue, Oct 30, 2012 at 02:46:19PM +0100, Michal Marek wrote:
>> Are you sure this is not going to suffer from the same issues as
>> 5755433? See
> 
> Thanks for this link, this is the first time I've seen that, so no :)
> 
> The approaches are different, my version that uses mkmakefile probably
> avoids some problems (like the quoting issue) but I'm not sure about
> mrproper. I've never seen mrproper complain, but I've always used this
> patch with O=..
> 
> Let me review this information and get back to you.

Good luck :). BTW, here is what people reported about Sam's approach in
2009: http://lkml.indiana.edu/hypermail/linux/kernel/0910.1/index.html#00505

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-30 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-30 23:20 [PATCH] [KBUILD] Put the CROSS_COMPILE and ARCH variables in the build directory makefile Jason Gunthorpe
2012-10-30 13:46 ` Michal Marek
2012-10-30 15:19   ` Jason Gunthorpe
2012-10-30 15:28     ` Michal Marek

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.