Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1353241

Re: [PATCH] ld-version: Fix awk regex compile failure

From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ld-version: Fix awk regex compile failure
Date 2016-03-08 18:00 +0100
Message-ID <rat9j-3s9-87@gated-at.bofh.it> (permalink)
References <rasZA-3on-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ld-version: Fix awk regex compile failure James Hogan <james.hogan@imgtec.com> - 2016-03-08 17:50 +0100
  Re: [PATCH] ld-version: Fix awk regex compile failure "Michael S. Tsirkin" <mst@redhat.com> - 2016-03-08 18:00 +0100
  Re: [PATCH] ld-version: Fix awk regex compile failure Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-03-10 19:00 +0100
    Re: [PATCH] ld-version: Fix awk regex compile failure James Hogan <james.hogan@imgtec.com> - 2016-03-10 22:00 +0100

csiph-web