Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965205AbbDVOdX (ORCPT ); Wed, 22 Apr 2015 10:33:23 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46687 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933456AbbDVOdV (ORCPT ); Wed, 22 Apr 2015 10:33:21 -0400 Date: Wed, 22 Apr 2015 16:33:20 +0200 From: Michal Marek To: Paul Cercueil Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Makefile: Fix detection of clang when cross-compiling Message-ID: <20150422143320.GB19277@sepie.suse.cz> References: <1429306504-26122-1-git-send-email-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429306504-26122-1-git-send-email-paul@crapouillou.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1199 Lines: 28 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 Applied to kbuild.git#kbuild. I will push it after v4.1-rc1 becomes available, though. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/