From: Dominique Martinet <asmadeus@codewreck.org>
To: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH 1/2] ld-version: use /usr/bin/env awk for shebank
Date: Wed, 9 Dec 2020 18:42:52 +0100 [thread overview]
Message-ID: <20201209174252.GA27721@nautica> (raw)
In-Reply-To: <69c82aee-59ec-f8d8-9546-b38f85bf08c0@arm.com>
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 <asmadeus@codewreck.org>
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 <asmadeus@codewreck.org>
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
- }
+}'
next prev parent reply other threads:[~2020-12-09 17:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 13:17 [PATCH 1/2] ld-version: use /usr/bin/env awk for shebank Dominique Martinet
2020-12-01 13:17 ` [PATCH 2/2] kbuild: don't hardcode depmod path Dominique Martinet
2020-12-01 13:52 ` [PATCH 1/2] ld-version: use /usr/bin/env awk for shebank Masahiro Yamada
2020-12-09 17:32 ` Vincenzo Frascino
2020-12-09 17:42 ` Dominique Martinet [this message]
2020-12-09 22:03 ` David Laight
2020-12-10 10:40 ` Vincenzo Frascino
2020-12-10 12:22 ` 'Dominique Martinet'
2020-12-10 22:43 ` David Laight
2020-12-09 18:22 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201209174252.GA27721@nautica \
--to=asmadeus@codewreck.org \
--cc=krzk@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).