Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547AbdCFTmY (ORCPT ); Mon, 6 Mar 2017 14:42:24 -0500 Received: from merlin.infradead.org ([205.233.59.134]:45594 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbdCFTjh (ORCPT ); Mon, 6 Mar 2017 14:39:37 -0500 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 34/35] tools build: Use the same CC for feature detection and actual build Date: Mon, 6 Mar 2017 16:38:24 -0300 Message-Id: <20170306193825.24011-35-acme@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170306193825.24011-1-acme@kernel.org> References: <20170306193825.24011-1-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 51 From: Arnaldo Carvalho de Melo When build with: 'make CC=clang' we were not using that CC to do feature detection, which resulted in features being detected with gcc and then the actual tools being built with clang. Most of the time these compilers are compatible enough, so no problem was being noticed. As soon as a system with an old enough clang, one that hasn't the cpuid.h header is used, and a gcc with it, the "get_cpuid" feature will be found available but then code that will use can't be compiled. Noticed with this combination: / $ gcc --version | head -1 gcc (Alpine 6.3.0) 6.3.0 / $ clang --version | head -1 clang version 3.8.1 (tags/RELEASE_381/final) / $ cat /etc/alpine-release 3.5.0 / $ Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-60q18nvlvgpyfv7e2qqgx4ou@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/build/feature/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index ab1e2bbc2e96..09c9626ea666 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -53,8 +53,8 @@ FILES= \ FILES := $(addprefix $(OUTPUT),$(FILES)) -CC := $(CROSS_COMPILE)gcc -MD -CXX := $(CROSS_COMPILE)g++ -MD +CC ?= $(CROSS_COMPILE)gcc -MD +CXX ?= $(CROSS_COMPILE)g++ -MD PKG_CONFIG := $(CROSS_COMPILE)pkg-config LLVM_CONFIG ?= llvm-config -- 2.9.3