[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATozxbhq1Q4HtiOrE87KKFEmdC7Hfp-biXYG1e_eFzHvw@mail.gmail.com>
Date: Mon, 12 Apr 2021 17:15:35 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: linux-kbuild <linux-kbuild@...r.kernel.org>,
Helge Deller <deller@....de>,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Rich Felker <dalias@...c.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Vineet Gupta <vgupta@...opsys.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
"open list:BROADCOM NVRAM DRIVER" <linux-mips@...r.kernel.org>,
Parisc List <linux-parisc@...r.kernel.org>,
Linux-sh list <linux-sh@...r.kernel.org>,
arcml <linux-snps-arc@...ts.infradead.org>,
"moderated list:H8/300 ARCHITECTURE"
<uclinux-h8-devel@...ts.sourceforge.jp>
Subject: Re: [PATCH] kbuild: use ?= to assign CROSS_COMPILE by arch-Makefile
On Mon, Apr 12, 2021 at 4:44 PM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Yamada-san,
>
> On Sun, Apr 11, 2021 at 3:56 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> > Use ?= operator to let arch/*/Makefile to assign CROSS_COMPILE only
> > when CROSS_COMPILE is undefined.
> >
> > This allows arch-Makefiles to drop the ifeq ($(CROSS_COMPILE),)
> > conditional.
> >
> > This slightly changes the behavior; the arch-Makefile previously
> > overrode CROSS_COMPILE when CROSS_COMPILE has already been made empty
> > via an environment variable as in 'export CROSS_COMPILE='.
> >
> > With this commit, arch-Makefle will respect the user's environment
> > set-up, which seems to be a more correct behavior.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
>
> Thanks for your patch!
>
> > ---
> >
> > arch/arc/Makefile | 4 +---
> > arch/h8300/Makefile | 4 +---
> > arch/m68k/Makefile | 4 +---
> > arch/mips/Makefile | 4 +---
> > arch/parisc/Makefile | 6 ++----
> > arch/sh/Makefile | 4 +---
>
> What about arch/xtensa/Makefile?
>
> > --- a/arch/m68k/Makefile
> > +++ b/arch/m68k/Makefile
> > @@ -17,10 +17,8 @@
> > KBUILD_DEFCONFIG := multi_defconfig
> >
> > ifneq ($(SUBARCH),$(ARCH))
> > - ifeq ($(CROSS_COMPILE),)
> > - CROSS_COMPILE := $(call cc-cross-prefix, \
> > + CROSS_COMPILE ?= $(call cc-cross-prefix, \
> > m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
> > - endif
> > endif
>
> This does not seem to work as expected: my standard build scripts
> (using "make ARCH=m68k") no longer pick up the cross-compiler,
> but fall back to the native compiler, thus breaking the build.
Agh, sorry, this patch does not work
because the top Makefile exports CROSS_COMPILE.
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS
CROSS_COMPILE LD CC
Removing CROSS_COMPILE from that makes ?= work,
but it would break other parts.
Please ignore this patch.
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists