From patchwork Thu Aug 20 09:21:49 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: 248035 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1312829ils; Thu, 20 Aug 2020 05:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzRgy1hsMcsWXMpIC1d/UaPh+6SUoM/0MUT+dqs9l6jigeFE2X05d7owL/+ZAZkntg34H0 X-Received: by 2002:aa7:cc12:: with SMTP id q18mr2604478edt.113.1597926569421; Thu, 20 Aug 2020 05:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597926569; cv=none; d=google.com; s=arc-20160816; b=jp9FPdcVeWQiKnFqqibYMcynmPKtF4AfO1+8WI7OQOmTZ8NCHTqNTBk4yAj8AJMX46 CPIuEJY9nBOyNdzvnNO/Wj45z4z3Ymk5HgVh31ota7DegCGFxDebpYrIiNcwRpiF1X1x jGJv1mUNsmtu/WqeU6pBuFI4EODs9NxI9VmMmi/tNTTbSnNItE/X9E1+i+mPA/ox1eXk 6YP748hSkKUq5gGV05wjkZyYKy3jQ0fRVKi/Q+jDwcsr+bRovy6Nq2AO+83MeFfGS3Gx 1RnUK32igWzI+jOptJfozvfATFPQ1OD7EuwHWS9H7KFZJmWsZPUUZJpN5CGqwxlvXYQB uOlQ== 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=+vW9Tb6f78Vy+qWKO0yJWj9xgTYRutKIYI3fwqEMa8w=; b=FS4Y8dPNCHN67E66/+eoLkXmH/BYuDpZj4OhbXSYDylkVO4QMqkHineI2KgrQ0xcnY X4jYXAncxLFHATa9D0LX9I3yM/5JEfZkh74130PTTP6Wovrd3gWqZvtwMybUfgIP6JU3 uY6ZjsbEMmiK9Du/QizH9MaTHGRhFFF5DqT202Vs2ETwPz2FMniNSy+qqFddiI35adzH DO43tkr9bFo7dW+RP0kH3xFef3jU8jsdNCBSINz9AGu0lZhjYCH5e7uXt2CBNhADdunR jFqw2EuvYA4SWL+QiJ9plsjlr/S9BmS+IexZxt09teYs8WZ9F2FzYFRWhAyH0u1fJInU H3KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JofTzQGG; 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 yc15si1371634ejb.413.2020.08.20.05.29.29; Thu, 20 Aug 2020 05:29:29 -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=JofTzQGG; 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 S1728936AbgHTM31 (ORCPT + 15 others); Thu, 20 Aug 2020 08:29:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:60598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729347AbgHTJvc (ORCPT ); Thu, 20 Aug 2020 05:51:32 -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 228E42078D; Thu, 20 Aug 2020 09:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917091; bh=lpx7Jg3abwMhOx8OANGz+OZFCZejRU8WyDKbjrjb6uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JofTzQGGTy5asQa159EUoxr6aXXJJFMw/G5yIBQO+hzkFpu3XHvK3d1cwyvm0pxlQ ynyyqn5VdoYtlLjuhcRJkSfRnxElSfWhFJ0qU/JyFvpHeFQTwZf7f/pTWsARsfDsTz 5wuyQYkBNP1Q8zuEGNUIrbHjNKL18kyGvMCYY8yQ= 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 5.4 142/152] tools build feature: Quote CC and CXX for their arguments Date: Thu, 20 Aug 2020 11:21:49 +0200 Message-Id: <20200820091601.084347912@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091553.615456912@linuxfoundation.org> References: <20200820091553.615456912@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 e80a1a8e287f8..8c6e1ea67f213 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -8,7 +8,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))