From patchwork Thu Aug 20 09:23:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 248016 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1217631ils; Thu, 20 Aug 2020 03:17:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8Yef/d8GCTDGxX9+u7Zd+xgDYBavhFGyMhwpvogELp69kjvIQV00xfxHChWJhJJp/efZG X-Received: by 2002:a17:906:140e:: with SMTP id p14mr2564559ejc.430.1597918622862; Thu, 20 Aug 2020 03:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597918622; cv=none; d=google.com; s=arc-20160816; b=pRB/PVEcGLDBMJFbqAtwvW9r8kPEvKkdbwn6q1jFWGLBBbcAGCTeVCXcxj9dc9BFtW iVzPVl82Px0UeSsX/eOJliAfUk7/quB6TqwRkui6xo/yPElNKVhQiWOyQqNBIHtESrfx TbMaadZpojdMsYMs5oSgqkG/SkoWMgUAFsasXjMvwoIxOorBzboAc3Jlz97XXIRi4a4A GLzSlDcyoUVLJd1l96e7EnjhIGYb/pbHSXs35/nt670mqJ63mjMYDQoxhD3CuwbR2rVU 2aFca8hueUY2AztkvGeWjAcNlXk8PckJIt0FCGt/x0F1w5VapenImZgvY0YBRLcV+YCj l+NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y6C/rGaen9H2gM2JLV5UV3V0VzFBD5ETikE3VbewELU=; b=cZBtKagjTEZr4fff4ds7EnMQIEnO1ie2xrIRF3ko2rbLhpD41GV5Sp5UUygVoWiOWs QeKR6hakSAsEWCXl+H7nO/N6Z97dHcl75F/0Hi7bD1ROTcMgdXuyMO0HFXlVkKJKgeMy RvGf75CUfrNBTb5worP/oi9Ail7JpLWjD5wWhpmunS+Rnt+FHzGkvO6g9H3rJFCP1/KF X6RG5FRHBzeVYhMa8YPOYgDPX+gyApnCVWKUGUgrl89fckmEz2FpkmFoIj5ABBFVsFwh qR+XpS0MQiaqKsPz5GnWZASujThe3oeDN8WLF9unH0d+5GPrJornb6b71qvfGxVhJ+Kb io+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UH5MQ262; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b22si1088673edx.6.2020.08.20.03.17.02; Thu, 20 Aug 2020 03:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UH5MQ262; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731195AbgHTKQ6 (ORCPT + 15 others); Thu, 20 Aug 2020 06:16:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:37254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731290AbgHTKQp (ORCPT ); Thu, 20 Aug 2020 06:16:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6951520738; Thu, 20 Aug 2020 10:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597918604; bh=sxZ5ylAKoRVVX/w8LJHVT4jrrFePjUDjSF+qg88vS40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UH5MQ262+h42srBq0c0L+dHzQ1hT30P/parlpTgnupJahs1pBfKqdqrwtX341oqSm 0hwwt1XE2usy99u+DPy3vcLHJ/XCsPOs/TaZIvt64u+6VaLyiO+nffugRbaiZqX4xT 76wMllzt4XUMjCmAsyQr8ErZToK0MFog3A2t19uc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Daniel_D=C3=ADaz?= , Thomas Hebb , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Namhyung Kim , Song Liu , Stephane Eranian , Yonghong Song , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 219/228] tools build feature: Quote CC and CXX for their arguments Date: Thu, 20 Aug 2020 11:23:14 +0200 Message-Id: <20200820091618.455902788@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091607.532711107@linuxfoundation.org> References: <20200820091607.532711107@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Daniel Díaz [ Upstream commit fa5c893181ed2ca2f96552f50073786d2cfce6c0 ] When using a cross-compilation environment, such as OpenEmbedded, the CC an CXX variables are set to something more than just a command: there are arguments (such as --sysroot) that need to be passed on to the compiler so that the right set of headers and libraries are used. For the particular case that our systems detected, CC is set to the following: export CC="aarch64-linaro-linux-gcc --sysroot=/oe/build/tmp/work/machine/perf/1.0-r9/recipe-sysroot" Without quotes, detection is as follows: Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ OFF ] ... gtk2: [ OFF ] ... libbfd: [ OFF ] ... libcap: [ OFF ] ... libelf: [ OFF ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ OFF ] ... libaio: [ OFF ] ... libzstd: [ OFF ] ... disassembler-four-args: [ OFF ] Makefile.config:414: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop. Makefile.perf:230: recipe for target 'sub-make' failed make[1]: *** [sub-make] Error 2 Makefile:69: recipe for target 'all' failed make: *** [all] Error 2 With CC and CXX quoted, some of those features are now detected. Fixes: e3232c2f39ac ("tools build feature: Use CC and CXX from parent") Signed-off-by: Daniel Díaz Reviewed-by: Thomas Hebb Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Link: http://lore.kernel.org/lkml/20200812221518.2869003-1-daniel.diaz@linaro.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/build/Makefile.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index a2389f0c0b1c0..79427b09590c5 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -7,7 +7,7 @@ endif feature_check = $(eval $(feature_check_code)) define feature_check_code - feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC=$(CC) CXX=$(CXX) CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0) + feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC="$(CC)" CXX="$(CXX)" CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0) endef feature_set = $(eval $(feature_set_code))