From: Behan Webster <behanw@converseincode.com>
To: Michal Marek <mmarek@suse.cz>
Cc: Paul Cercueil <paul@crapouillou.net>,
linux-kbuild@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] Makefile: Fix detection of clang when cross-compiling
Date: Thu, 9 Jul 2015 16:09:35 -0700 [thread overview]
Message-ID: <559EFF2F.1070301@converseincode.com> (raw)
In-Reply-To: <20150422143320.GB19277@sepie.suse.cz>
Resent since gmail HTML-ified my previous email...
On Wed, Apr 22, 2015 at 7:33 AM, Michal Marek <mmarek@suse.cz
<mailto:mmarek@suse.cz>> wrote:
On Fri, Apr 17, 2015 at 11:35:04PM +0200, Paul Cercueil wrote:
> When the host's C compiler is clang, and when attempting to
> cross-compile Linux e.g. to MIPS with mipsel-linux-gcc, the Makefile
> would incorrectly detect the use of clang, which resulted in
> clang-specific flags being passed to mipsel-linux-gcc.
>
> This can be verified under Debian by installing the "clang" package,
> and then using it as the default compiler with:
> sudo update-alternatives --config cc
>
> This patch moves the detection of clang after the $(CC) variable is
> initialized to the name of the cross-compiler, so that the check
applies
> to the cross-compiler and not the host's C compiler.
>
> v2: Move the detection of clang after the inclusion of the
> arch/*/Makefile (as they might set $(CROSS_COMPILE))
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net
<mailto:paul@crapouillou.net>>
Applied to kbuild.git#kbuild. I will push it after v4.1-rc1 becomes
available, though.
Drat. I wish I saw this earlier.
This breaks patches which check for the value of COMPILER in
arch/*/Makefile. This detection must be performed before the inclusion
of the arch Makefile.
Can I move this to after the initialization of CC but before the include?
I'm not sure that being able to define the default compiler per arch is
necessary. But I know I need to be able to add arch specific flags for
clang.
Behan
--
Behan Webster
behanw@converseincode.com <mailto:behanw@converseincode.com>
next prev parent reply other threads:[~2015-07-09 23:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 21:35 [PATCH v2] Makefile: Fix detection of clang when cross-compiling Paul Cercueil
2015-04-22 14:33 ` Michal Marek
2015-07-09 23:09 ` Behan Webster [this message]
2015-07-13 10:59 ` Anton Blanchard
2015-08-19 15:41 ` Michal Marek
2015-08-27 1:49 ` Behan Webster
2015-08-27 8:37 ` Michal Marek
2015-09-04 11:25 ` Michal Marek
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=559EFF2F.1070301@converseincode.com \
--to=behanw@converseincode.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=paul@crapouillou.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).