From patchwork Tue Jul 9 06:13:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 168721 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8117235ilk; Mon, 8 Jul 2019 23:13:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIcIP5rS/ON7wxCzYQdL3DmQPrj/pQgytHD8A07Bz2KsHaaFcDJpAVRuNfqWROxPd2hnn7 X-Received: by 2002:a17:902:f213:: with SMTP id gn19mr30660684plb.35.1562652796597; Mon, 08 Jul 2019 23:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562652796; cv=none; d=google.com; s=arc-20160816; b=x8lf4q22C+EgIvbZT82iDP4dXS6z3UJg/ba01kr165FF2SGuePVm5Y21uAyzrJPO+u FZVfdGJkKPriLYdioZor9ldBzOXpzsh8zENjB1WQeKGt5kLW1JoMTQjXHJPi6mv9crT8 d8mPDM+B0+rVe8WGHg8TZ+/N6g2IDgJvrEyxwPVTL+uBETajxToyomMmu0/HgGqvMcVS zXdxq6mE34ByOYiCDCmy4h+TvCzh3bQwiqWw4Oh9bPuwdjnsxFFYPYq+FoHJN8Dc89uv G1Ba7IzzYa9P5DoZGxnBSvlM51C72e/AAy2Dixp2kpTikB/2ij7AHjMdacN3jo8MSomT 0mxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=lnTkZOWAozqElNoBWK0L63rALMGbDSyFD2Pe++T0T9Q=; b=yLXotInwrnE1EpFLdJ0sbXKhLRd4s/UBZbfyRn2boD5BYy41QY8uA0V/mdHr0qwd+Y rcsodvL8U9S6+jBjG5jqkJGS8DVtI1owiAKKUQ8Hh46GpknfVyGvizdI3TYlhKiAfk01 N5UlnevFcYU55ma+nIhdUxxYqUhyJgQvZIsV2w6rJ5tOQcA+OELpEW2cSsv2AfmNLImc 3cNp2s43PUz63PV0i5SSw6/YW2L6I6mgjWpiq42cMogjUj2j4VcJ7VmDOb2bBrLfngIG dpl4hYt8wbwT7MQhWl+UYh9v79LpP2mtPtg1EHSrQsJEc3f38ZKcFZBIjNsQW9eX+Rrw R4kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MUCfYy4x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si21698795pgi.587.2019.07.08.23.13.16; Mon, 08 Jul 2019 23:13:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MUCfYy4x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbfGIGNO (ORCPT + 30 others); Tue, 9 Jul 2019 02:13:14 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:42787 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfGIGNO (ORCPT ); Tue, 9 Jul 2019 02:13:14 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x696D2LL030773; Tue, 9 Jul 2019 15:13:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x696D2LL030773 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1562652783; bh=lnTkZOWAozqElNoBWK0L63rALMGbDSyFD2Pe++T0T9Q=; h=From:To:Cc:Subject:Date:From; b=MUCfYy4xiocaxazb9OPb1wu3bZjr11ZoUaQhOL2mzlVOn0YNgKj/kI74R5A84fuOg OOPZHSMwYdcyJ1o7r+tvuqdoxwDB79XLIPFFB4emL6t4nawhBBRzedhxFKcbZrJsR0 Oz6jh9syQ0ix49Z/UynsefJtrajshefVhoUaoyALBvioOiG43iTZ+qVMhr48ZSl2kj OU40LwLlWL+hOpLFjrjMKMGrEIoXtQ1tLEbKeK1MzVXJKcoTd4UFat8aHPbkoC4W/8 ENQ8o9Ma+QgGDraRjXKPQ04ViJPKYqh9O27E1REWlKMaHBTkZ4FhuygZI8H8qwTJhJ wkwpZxXLXm8yA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix Date: Tue, 9 Jul 2019 15:13:00 +0900 Message-Id: <20190709061300.527-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arch/mips/Makefile passes prefixes that start with '-' to cc-cross-prefix when $(tool-archpref) evaluates to the empty string. They are filtered-out before the $(shell ...) invocation. Otherwise, 'command -v' would be confused. $ command -v -linux-gcc bash: command: -l: invalid option command: usage: command [-pVv] command [arg ...] Since commit 913ab9780fc0 ("kbuild: use more portable 'command -v' for cc-cross-prefix"), cc-cross-prefix throws away the stderr output, so the console is not polluted in any way. This is not a big deal in practice, but I see a slightly better taste in adding '--' to teach it that '-linux-gcc' is an argument instead of a command option. This will cause extra forking of subshell, but it will not be noticeable performance regression. Signed-off-by: Masahiro Yamada --- scripts/Kbuild.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 222fd1d7d3ae..c62d690c7dcf 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -79,8 +79,8 @@ endef # would try to directly execute the shell builtin 'command'. This workaround # should be kept for a long time since this issue was fixed only after the # GNU Make 4.2.1 release. -cc-cross-prefix = $(firstword $(foreach c, $(filter-out -%, $(1)), \ - $(if $(shell command -v $(c)gcc 2>/dev/null), $(c)))) +cc-cross-prefix = $(firstword $(foreach c, $(1), \ + $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c)))) # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)