Skip to content

Commit 6ec363f

Browse files
Carlos Llamasgregkh
authored andcommitted
scripts/tags.sh: fix incompatibility with PCRE2
Starting with release 10.38 PCRE2 drops default support for using \K in lookaround patterns as described in [1]. Unfortunately, scripts/tags.sh relies on such functionality to collect all_compiled_soures() leading to the following error: $ make COMPILED_SOURCE=1 tags GEN tags grep: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) The usage of \K for this pattern was introduced in commit 4f491bb ("scripts/tags.sh: collect compiled source precisely") which speeds up the generation of tags significantly. In order to fix this issue without compromising the performance we can switch over to an equivalent sed expression. The same matching pattern is preserved here except \K is replaced with a backreference \1. [1] https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC11 Cc: Greg Kroah-Hartman <[email protected]> Cc: Cristian Ciocaltea <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Jialu Xu <[email protected]> Cc: Vipin Sharma <[email protected]> Cc: [email protected] Fixes: 4f491bb ("scripts/tags.sh: collect compiled source precisely") Signed-off-by: Carlos Llamas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e42af72 commit 6ec363f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/tags.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ all_compiled_sources()
9898
{
9999
echo include/generated/autoconf.h
100100
find $ignore -name "*.cmd" -exec \
101-
grep -Poh '(?(?=^source_.* \K).*|(?=^ \K\S).*(?= \\))' {} \+ |
101+
sed -n -E 's/^source_.* (.*)/\1/p; s/^ (\S.*) \\/\1/p' {} \+ |
102102
awk '!a[$0]++'
103103
} | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
104104
sort -u

0 commit comments

Comments
 (0)