From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933042AbcCHQsm (ORCPT ); Tue, 8 Mar 2016 11:48:42 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:61181 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932545AbcCHQsd (ORCPT ); Tue, 8 Mar 2016 11:48:33 -0500 From: James Hogan To: Ralf Baechle , Michal Marek , "Andi Kleen" , Geert Uytterhoeven CC: James Hogan , "Michael S. Tsirkin" , , , , Subject: [PATCH] ld-version: Fix awk regex compile failure Date: Tue, 8 Mar 2016 16:47:53 +0000 Message-ID: <1457455673-12219-1-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 2.4.10 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.154.110] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: James Hogan Cc: Ralf Baechle Cc: Michal Marek Cc: Andi Kleen Cc: "Michael S. Tsirkin" Cc: linux-mips@linux-mips.org Cc: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: # 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