* [PATCH] ld-version: Fix awk regex compile failure
@ 2016-03-08 16:47 James Hogan
2016-03-08 16:55 ` Michael S. Tsirkin
2016-03-10 17:49 ` Sudip Mukherjee
0 siblings, 2 replies; 4+ messages in thread
From: James Hogan @ 2016-03-08 16:47 UTC (permalink / raw)
To: Ralf Baechle, Michal Marek, Andi Kleen, Geert Uytterhoeven
Cc: James Hogan, Michael S. Tsirkin, linux-mips, linux-kbuild,
linux-kernel, stable
The ld-version.sh script fails on some versions of awk with the
following error, resulting in build failures for MIPS:
awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(')
This is due to the regular expression ".*)", meant to strip off the
beginning of the ld version string up to the close bracket, however
brackets have a meaning in regular expressions, so lets escape it so
that awk doesn't expect a corresponding open bracket.
Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Michal Marek <mmarek@suse.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: <stable@vger.kernel.org> # 4.4.x-
---
I've only tested this with GNU Awk 4.0.2, which seems a bit more
lenient than whatever version of awk Geert's build machine is using.
I'd appreciated if somebody experiencing the error could give this patch
a spin to check it fixes it.
---
scripts/ld-version.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
index d154f0877fd8..7bfe9fa1c8dc 100755
--- a/scripts/ld-version.sh
+++ b/scripts/ld-version.sh
@@ -1,7 +1,7 @@
#!/usr/bin/awk -f
# extract linker version number from stdin and turn into single number
{
- gsub(".*)", "");
+ gsub(".*\\)", "");
gsub(".*version ", "");
gsub("-.*", "");
split($1,a, ".");
--
2.4.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ld-version: Fix awk regex compile failure
2016-03-08 16:47 [PATCH] ld-version: Fix awk regex compile failure James Hogan
@ 2016-03-08 16:55 ` Michael S. Tsirkin
2016-03-10 17:49 ` Sudip Mukherjee
1 sibling, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2016-03-08 16:55 UTC (permalink / raw)
To: James Hogan
Cc: Ralf Baechle, Michal Marek, Andi Kleen, Geert Uytterhoeven,
linux-mips, linux-kbuild, linux-kernel, stable
On Tue, Mar 08, 2016 at 04:47:53PM +0000, James Hogan wrote:
> The ld-version.sh script fails on some versions of awk with the
> following error, resulting in build failures for MIPS:
>
> awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(')
>
> This is due to the regular expression ".*)", meant to strip off the
> beginning of the ld version string up to the close bracket, however
> brackets have a meaning in regular expressions, so lets escape it so
> that awk doesn't expect a corresponding open bracket.
>
> Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...")
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Michal Marek <mmarek@suse.com>
> Cc: Andi Kleen <ak@linux.intel.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: linux-mips@linux-mips.org
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: <stable@vger.kernel.org> # 4.4.x-
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> I've only tested this with GNU Awk 4.0.2, which seems a bit more
> lenient than whatever version of awk Geert's build machine is using.
>
> I'd appreciated if somebody experiencing the error could give this patch
> a spin to check it fixes it.
> ---
> scripts/ld-version.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
> index d154f0877fd8..7bfe9fa1c8dc 100755
> --- a/scripts/ld-version.sh
> +++ b/scripts/ld-version.sh
> @@ -1,7 +1,7 @@
> #!/usr/bin/awk -f
> # extract linker version number from stdin and turn into single number
> {
> - gsub(".*)", "");
> + gsub(".*\\)", "");
> gsub(".*version ", "");
> gsub("-.*", "");
> split($1,a, ".");
> --
> 2.4.10
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ld-version: Fix awk regex compile failure
2016-03-08 16:47 [PATCH] ld-version: Fix awk regex compile failure James Hogan
2016-03-08 16:55 ` Michael S. Tsirkin
@ 2016-03-10 17:49 ` Sudip Mukherjee
2016-03-10 20:50 ` James Hogan
1 sibling, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2016-03-10 17:49 UTC (permalink / raw)
To: James Hogan, Ralf Baechle, Michal Marek, Andi Kleen,
Geert Uytterhoeven
Cc: Michael S. Tsirkin, linux-mips, linux-kbuild, linux-kernel,
stable
On Tuesday 08 March 2016 10:17 PM, James Hogan wrote:
> The ld-version.sh script fails on some versions of awk with the
> following error, resulting in build failures for MIPS:
>
> awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(')
>
> This is due to the regular expression ".*)", meant to strip off the
> beginning of the ld version string up to the close bracket, however
> brackets have a meaning in regular expressions, so lets escape it so
> that awk doesn't expect a corresponding open bracket.
>
> Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...")
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
This error was only coming in my gitlab builds but was not showing in
the build of travis-ci. Maybe it depends on the version of awk also.
Build log at: https://gitlab.com/sudipm/linux-next/builds/839573
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
regards
sudip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ld-version: Fix awk regex compile failure
2016-03-10 17:49 ` Sudip Mukherjee
@ 2016-03-10 20:50 ` James Hogan
0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2016-03-10 20:50 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Ralf Baechle, Michal Marek, Andi Kleen, Geert Uytterhoeven,
Michael S. Tsirkin, linux-mips, linux-kbuild, linux-kernel,
stable
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
On Thu, Mar 10, 2016 at 11:19:57PM +0530, Sudip Mukherjee wrote:
> On Tuesday 08 March 2016 10:17 PM, James Hogan wrote:
> > The ld-version.sh script fails on some versions of awk with the
> > following error, resulting in build failures for MIPS:
> >
> > awk: scripts/ld-version.sh: line 4: regular expression compile failed (missing '(')
> >
> > This is due to the regular expression ".*)", meant to strip off the
> > beginning of the ld version string up to the close bracket, however
> > brackets have a meaning in regular expressions, so lets escape it so
> > that awk doesn't expect a corresponding open bracket.
> >
> > Fixes: ccbef1674a15 ("Kbuild, lto: add ld-version and ld-ifversion ...")
> > Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > Signed-off-by: James Hogan <james.hogan@imgtec.com>
>
> This error was only coming in my gitlab builds but was not showing in
> the build of travis-ci. Maybe it depends on the version of awk also.
> Build log at: https://gitlab.com/sudipm/linux-next/builds/839573
>
> Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Great, that looks pretty conclusive. Thanks for testing Sudip and
Michael.
Ralf: is it too late to get this into v4.5 via MIPS tree?
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-10 20:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 16:47 [PATCH] ld-version: Fix awk regex compile failure James Hogan
2016-03-08 16:55 ` Michael S. Tsirkin
2016-03-10 17:49 ` Sudip Mukherjee
2016-03-10 20:50 ` James Hogan
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).