Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4160425pxu; Wed, 9 Dec 2020 09:46:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxK3R5HoiuU4zEfsbJffAs/7H/5MbKtkTzFkfM85s4fu39uB1AZ3k0r3/RXhwvshvt1+g+/ X-Received: by 2002:a17:906:55d0:: with SMTP id z16mr2995538ejp.466.1607536006209; Wed, 09 Dec 2020 09:46:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607536006; cv=none; d=google.com; s=arc-20160816; b=eCn+fon+4MfNwEDXM2zQLbKy61zJmlvkuA+OAwRBQFf4OUMOU4L1v9eaXOqJYBKRp5 vLd58D09+AkpxXIFjvFDPB1rsHDuxTgObfsi5E34fPiC7P4nEXroGZqUN4y+b9pl61xY U0pn2qmleGH223PeDzNcjRiEfRXostRcpNOSwwFlUmUMFAdKz6Ai6o9zm4cxEkhCQOn3 f57jKZpb+abHmjGkqXxbfUgfyi4NQ0HGhgbQX3TPUS5Mlh0SMQs4FfyD87wT97TlvCas 8j+5qONo+Sh6a6GIOL3nFAc08OIjcC2roeIqdUQVwH7aPGEqdW/0rLTEPP02D3muxPlg mC1g== 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=3I60BVokN26eXe/da78K5ujczl/m97T6r86SgjOzMwI=; b=HGDmoGEvh6ji8pWCwOO5fK1hVbU3QrRV0ssZC0yoXx7QaGkq/jxbK6JSu/D3YDyNiQ GmUypTVUi7YJjzULf/Bocd9FYlPJB3yemeDXztXMOzbNh/djksb2M6wCKQnAB4Gvs51K D7OHcCiA9PaaT5hbX+wo3Xurxd2re3Y1xMWJH2FY4yOg2kN7RTUlYNH+H1ODGsKmQLtY NGMuITIcMUJ3X+rZ4xsmpbv+Y2khKfNTGHtcka4uQKwb49EA9aNALu4BfV0kgb8a6dIL vYnZa3mMbulu8LZkctyCy8o9baD4ZxT8lmBW5aLxyrgJVY/YBiF92M5XjS/GjLCqvxc5 OTOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=zqv1w3sw; 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 bd3si1190039edb.589.2020.12.09.09.46.23; Wed, 09 Dec 2020 09:46:46 -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=zqv1w3sw; 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 S1730278AbgLIRnu (ORCPT + 99 others); Wed, 9 Dec 2020 12:43:50 -0500 Received: from nautica.notk.org ([91.121.71.147]:42329 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbgLIRnu (ORCPT ); Wed, 9 Dec 2020 12:43:50 -0500 X-Greylist: delayed 4952 seconds by postgrey-1.27 at vger.kernel.org; Wed, 09 Dec 2020 12:43:48 EST Received: by nautica.notk.org (Postfix, from userid 1001) id 626D0C01A; Wed, 9 Dec 2020 18:43:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1607535787; bh=3I60BVokN26eXe/da78K5ujczl/m97T6r86SgjOzMwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zqv1w3swRounFyPzor/YKTZbqNEdFCB3FULtVzV+IcS3rYZ1WpUKE7zdKaX+4gU7m oSZdUIgdKQf/QdezJNd9xf6ea3xDYjfKqoo/GftMvaTXYr8MzRV1vdyNQZYrP5NPb9 zWYJkyaP1uuvQvCJYuVzuoI7FCta1Qi27dpC4s5FKHEpncQCpB7k9IUGhCkXOUZHQH omTUw/BoO7jvgNSoyAbk5Qcxhf/or26mfijdG+lrMDRhn1SLNldAYwV+n3Sc4x8oe2 4LOd+OdK/ktjps9QlA0cTAMNPko5L3ke/AlivN/LAyvl1vquZKNxF9WsLR0bSSsnfd VKeZy3n8QZgXw== Date: Wed, 9 Dec 2020 18:42:52 +0100 From: Dominique Martinet To: Vincenzo Frascino Cc: Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: Re: [PATCH 1/2] ld-version: use /usr/bin/env awk for shebank Message-ID: <20201209174252.GA27721@nautica> References: <1606828650-29841-1-git-send-email-asmadeus@codewreck.org> <69c82aee-59ec-f8d8-9546-b38f85bf08c0@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <69c82aee-59ec-f8d8-9546-b38f85bf08c0@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vincenzo Frascino wrote on Wed, Dec 09, 2020: > On 12/1/20 1:17 PM, Dominique Martinet wrote: > > /usr/bin/awk is not garanteed to exist (and doesn't on e.g. nixos), > > using /usr/bin/env to have it look in PATH is more robust > > This patch breaks the compilation on Ubuntu 16.04 and 18.04 in fact: Thanks for the report, I was told the same by Krzysztof Kozlowski (added to Ccs) earlier today, I don't have any "old" machines like this around so didn't notice when I checked unfortunately :( I've suggested either just reverting this (I'll keep my local workaround) or going through /bin/sh which is always safe like the following patch -- leaving this to maintainers. Thanks! ----- 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 - } +}'