Commit 4b7b1ef2 authored by James Hogan's avatar James Hogan Committed by Ralf Baechle

ld-version: Fix awk regex compile failure

The script fails on some versions of awk with the
following error, resulting in build failures for MIPS:

awk: scripts/ 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: ccbef167 ("Kbuild, lto: add ld-version and ld-ifversion ...")
Reported-by: default avatarGeert Uytterhoeven <>
Signed-off-by: default avatarJames Hogan <>
Tested-by: default avatarMichael S. Tsirkin <>
Acked-by: default avatarMichael S. Tsirkin <>
Tested-by: default avatarSudip Mukherjee <>
Cc: Michal Marek <>
Cc: Andi Kleen <>
Cc: Geert Uytterhoeven <>
Cc: # 4.4.x-
Patchwork: default avatarRalf Baechle <>
parent ba9e72c2
#!/usr/bin/awk -f
# extract linker version number from stdin and turn into single number
gsub(".*)", "");
gsub(".*\\)", "");
gsub(".*version ", "");
gsub("-.*", "");
split($1,a, ".");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment