From 557df38b4ca6e4beecfa4fc3b8cfa89ad7466fb3 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mar 03 2023 11:25:16 +0000 Subject: scripts/tags.sh: fix incompatibility with PCRE2 (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.2-007-scripts-tags.sh-fix-incompatibility-with-PCRE2.patch b/patches.kernel.org/6.2.2-007-scripts-tags.sh-fix-incompatibility-with-PCRE2.patch new file mode 100644 index 0000000..41788c7 --- /dev/null +++ b/patches.kernel.org/6.2.2-007-scripts-tags.sh-fix-incompatibility-with-PCRE2.patch @@ -0,0 +1,59 @@ +From: Carlos Llamas +Date: Wed, 15 Feb 2023 18:38:50 +0000 +Subject: [PATCH] scripts/tags.sh: fix incompatibility with PCRE2 +References: bsc#1012628 +Patch-mainline: 6.2.2 +Git-commit: 6ec363fc6142226b9ab5a6528f65333d729d2b6b + +commit 6ec363fc6142226b9ab5a6528f65333d729d2b6b upstream. + +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 4f491bb6ea2a +("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 +Cc: Cristian Ciocaltea +Cc: Masahiro Yamada +Cc: Jialu Xu +Cc: Vipin Sharma +Cc: stable@vger.kernel.org +Fixes: 4f491bb6ea2a ("scripts/tags.sh: collect compiled source precisely") +Signed-off-by: Carlos Llamas +Link: https://lore.kernel.org/r/20230215183850.3353198-1-cmllamas@google.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + scripts/tags.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/tags.sh b/scripts/tags.sh +index e137cf15..0d045182 100755 +--- a/scripts/tags.sh ++++ b/scripts/tags.sh +@@ -91,7 +91,7 @@ all_compiled_sources() + { + echo include/generated/autoconf.h + find $ignore -name "*.cmd" -exec \ +- grep -Poh '(?(?=^source_.* \K).*|(?=^ \K\S).*(?= \\))' {} \+ | ++ sed -n -E 's/^source_.* (.*)/\1/p; s/^ (\S.*) \\/\1/p' {} \+ | + awk '!a[$0]++' + } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) | + sort -u +-- +2.35.3 + diff --git a/series.conf b/series.conf index 59028a2..b5b9718 100644 --- a/series.conf +++ b/series.conf @@ -46,6 +46,7 @@ patches.kernel.org/6.2.2-004-vc_screen-don-t-clobber-return-value-in-vcs_rea.patch patches.kernel.org/6.2.2-005-drm-amd-display-Move-DCN314-DOMAIN-power-contro.patch patches.kernel.org/6.2.2-006-drm-amd-display-Properly-reuse-completion-struc.patch + patches.kernel.org/6.2.2-007-scripts-tags.sh-fix-incompatibility-with-PCRE2.patch ######################################################## # Build fixes that apply to the vanilla kernel too.