From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A16C4361B for ; Wed, 9 Dec 2020 17:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC45222BF3 for ; Wed, 9 Dec 2020 17:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbgLIRnu (ORCPT ); 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-kbuild@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 - } +}'