Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4103391pxu; Wed, 9 Dec 2020 08:26:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu04Ahx4c5x8hfKU/8QTDt1+WqNoStg7mcvNVx2EFaKyEn/FRiN40Qgsk1NdeVIN2lVBwR X-Received: by 2002:a05:6402:1597:: with SMTP id c23mr2807881edv.212.1607531160637; Wed, 09 Dec 2020 08:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607531160; cv=none; d=google.com; s=arc-20160816; b=qQfgguHStoxtbRRFGjxQfEQO3bHkqqsm/CCrtmabFm/E9hdMLuvi2oNhrIzkamoQ2R W/UQxQ7iTaiIs9tYCGcS4lDPw4lk6uXXLkYqd8eUH4TCmK0E+aiOsmaadz5bYOgvs/G2 fSTXOTg+ZfYmvh51sC4l2GuKDHOHMnAA15nNS81CcZ5P03hMMMZDty6VZvJ5UX2Ay46d +/8V1S8yXETraI91qhkr70qzHntrCa8rgqjl9KTcbM4YCbgD5CborK9HKQCMsW8Ywm3x 2HmiZoxNfl7z/zoI1F2eOoIyHPownfTIzThPRxWRBZMp7fzuTsF7Iq6ZptKnYounF4cE 36Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=keyoWzApK04/Bs9zCELFJu/kJwHnZGUNf7oCPH/UEoU=; b=kE95O6pUXkBnLb8k9i+HVTlpht7iCxLJXNmh/gvTZiOSXpdWZocPbxbfhpfCaIOCnd ad3nHV0UkLHAOdlg9xdaF/MlW/5ZJXV1wsLec67Q0gNZUdcybNQXIO3XgpwA1c7Kk5iw sPvle7mfvo3TPtLanMFsGyjUBj/M52wIWJEM1CIPN/QFeZNuCcFe3JfOQGLAqgWR5pDs AoLyU6OSj1LQcFk9X1E/Zvyc0QPI6jZGxVL5S7xVxzbLgSuBmsAbXGQ9dcpxXa9iyFlH nDOKYWSdCBtfdk3AbZsVX/8BS0xoJnNiiZBdGhunzHP0lk4FFe+9bOByKMWk5n03+9KB QVZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=yZWf3cTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq10si1121210edb.140.2020.12.09.08.25.37; Wed, 09 Dec 2020 08:26:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@codewreck.org header.s=2 header.b=yZWf3cTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731881AbgLIQVd (ORCPT + 99 others); Wed, 9 Dec 2020 11:21:33 -0500 Received: from nautica.notk.org ([91.121.71.147]:43620 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731338AbgLIQVV (ORCPT ); Wed, 9 Dec 2020 11:21:21 -0500 Received: by nautica.notk.org (Postfix, from userid 1001) id 33C14C009; Wed, 9 Dec 2020 17:20:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1607530835; bh=keyoWzApK04/Bs9zCELFJu/kJwHnZGUNf7oCPH/UEoU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yZWf3cTDPiCpzyz1E21AfgwszWxOKRIc3SGpOdKG92wbSuOqyswoELlXOhBA9x6wz i2qmRj5vltbWK/V/hMBJe1ug4F1XqoNY+ENI9oBUBeYVKWCrG4YtulddGBN/3OMNDf zA4VkSni3oSfPc9F3+160zuFkaNh+QdVljP6LH+b1MFaFZnEoS5uGNWgRzM8mhN6BY 1ij9Z2KoluBQ/odFJcQd/yV2Elzqig2GfZ3p1gqlgQhGc/LyszqId3pnI4qswt4Bbz 2Xt/Z0pWnEP0W+OO3Gg92N/qP3m7XuRIyejvR7k88I3HASK6eU/QURwBFnhcz5uaNp xEU5BrD7MLTrw== Date: Wed, 9 Dec 2020 17:20:20 +0100 From: Dominique Martinet To: Krzysztof Kozlowski Cc: Masahiro Yamada , "linux-kernel@vger.kernel.org" , Michal Marek , linux-kbuild@vger.kernel.org Subject: Re: Broken /usr/bin/env (invalid option) Message-ID: <20201209162020.GA15684@nautica> References: <20201209122437.GA26815@kozik-lap> <20201209130709.GB15469@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Krzysztof Kozlowski wrote on Wed, Dec 09, 2020: > > Hm, what version of env is that? > > I only checked on a couple of systems that env -S exists, but it might > > not be available (e.g. now I'm looking, at least busybox env does not > > provide -S) > > $ env --version > env (GNU coreutils) 8.25 Ok, so this is a much newer option than I thought it was, sorry for my lack of checking. I know we no longer support older gccs but it's probably best to keep supporting this. > > I don't see any way to make this work out of the box for me (awk not in > > /usr/bin) and you (env not supporting -S), but I guess I can keep that > > patch around locally... > > You could add a wrapper which uses PATH or searches for the awk... > kind of reimplement other tools. Another solution is to clearly > document the requirements for the build system and explicitly say that > older systems like four-year Ubuntu are not supported. Well there definitely are ways, but I'm not sure it's worth it... For example another idea is just to use /bin/sh (which is mandated to exist) and have it invoke awk, the script is short enough to just quote it. Yamada-san, how about this instead? But to be honest I'm fine with dropping my patch altogether, I'll work around it locally if it's too much. --- From d53ef3b4c55aa2ea5f9ae887b3e1ace368f30f66 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 15 Jul 2020 16:00:13 +0200 Subject: [PATCH] ld-version: use /bin/sh then awk for shebank /usr/bin/awk is not garanteed to exist (and doesn't on e.g. nixos), using /bin/sh and invoking awk to have it look in PATH is more robust. Signed-off-by: Dominique Martinet diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh index f2be0ff9a738..02dbad7b5613 100755 --- a/scripts/ld-version.sh +++ b/scripts/ld-version.sh @@ -1,11 +1,11 @@ -#!/usr/bin/awk -f +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # extract linker version number from stdin and turn into single number - { +awk '{ gsub(".*\\)", ""); gsub(".*version ", ""); gsub("-.*", ""); split($1,a, "."); print a[1]*100000000 + a[2]*1000000 + a[3]*10000; exit - } +}'