]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Mar 2023 15:23:29 +0000 (16:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Mar 2023 15:23:29 +0000 (16:23 +0100)
added patches:
scripts-tags.sh-fix-incompatibility-with-pcre2.patch
scripts-tags.sh-invoke-realpath-via-xargs.patch

queue-5.15/scripts-tags.sh-fix-incompatibility-with-pcre2.patch [new file with mode: 0644]
queue-5.15/scripts-tags.sh-invoke-realpath-via-xargs.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/scripts-tags.sh-fix-incompatibility-with-pcre2.patch b/queue-5.15/scripts-tags.sh-fix-incompatibility-with-pcre2.patch
new file mode 100644 (file)
index 0000000..18d0172
--- /dev/null
@@ -0,0 +1,53 @@
+From 6ec363fc6142226b9ab5a6528f65333d729d2b6b Mon Sep 17 00:00:00 2001
+From: Carlos Llamas <cmllamas@google.com>
+Date: Wed, 15 Feb 2023 18:38:50 +0000
+Subject: scripts/tags.sh: fix incompatibility with PCRE2
+
+From: Carlos Llamas <cmllamas@google.com>
+
+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 <gregkh@linuxfoundation.org>
+Cc: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
+Cc: Masahiro Yamada <masahiroy@kernel.org>
+Cc: Jialu Xu <xujialu@vimux.org>
+Cc: Vipin Sharma <vipinsh@google.com>
+Cc: stable@vger.kernel.org
+Fixes: 4f491bb6ea2a ("scripts/tags.sh: collect compiled source precisely")
+Signed-off-by: Carlos Llamas <cmllamas@google.com>
+Link: https://lore.kernel.org/r/20230215183850.3353198-1-cmllamas@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/tags.sh |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scripts/tags.sh
++++ b/scripts/tags.sh
+@@ -98,7 +98,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 -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
+       sort -u
diff --git a/queue-5.15/scripts-tags.sh-invoke-realpath-via-xargs.patch b/queue-5.15/scripts-tags.sh-invoke-realpath-via-xargs.patch
new file mode 100644 (file)
index 0000000..082363e
--- /dev/null
@@ -0,0 +1,55 @@
+From 7394d2ebb651a9f62e08c6ab864aac015d27c64d Mon Sep 17 00:00:00 2001
+From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
+Date: Tue, 17 May 2022 02:46:46 +0300
+Subject: scripts/tags.sh: Invoke 'realpath' via 'xargs'
+
+From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
+
+commit 7394d2ebb651a9f62e08c6ab864aac015d27c64d upstream.
+
+When COMPILED_SOURCE is set, running
+
+  make ARCH=x86_64 COMPILED_SOURCE=1 cscope tags
+
+could throw the following errors:
+
+scripts/tags.sh: line 98: /usr/bin/realpath: Argument list too long
+cscope: no source files found
+scripts/tags.sh: line 98: /usr/bin/realpath: Argument list too long
+ctags: No files specified. Try "ctags --help".
+
+This is most likely to happen when the kernel is configured to build a
+large number of modules, which has the consequence of passing too many
+arguments when calling 'realpath' in 'all_compiled_sources()'.
+
+Let's improve this by invoking 'realpath' through 'xargs', which takes
+care of properly limiting the argument list.
+
+Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
+Link: https://lore.kernel.org/r/20220516234646.531208-1-cristian.ciocaltea@collabora.com
+Cc: Carlos Llamas <cmllamas@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/tags.sh |   11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/scripts/tags.sh
++++ b/scripts/tags.sh
+@@ -95,10 +95,13 @@ all_sources()
+ all_compiled_sources()
+ {
+-      realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) \
+-              include/generated/autoconf.h $(find $ignore -name "*.cmd" -exec \
+-              grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
+-              awk '!a[$0]++') | sort -u
++      {
++              echo include/generated/autoconf.h
++              find $ignore -name "*.cmd" -exec \
++                      grep -Poh '(?(?=^source_.* \K).*|(?=^  \K\S).*(?= \\))' {} \+ |
++              awk '!a[$0]++'
++      } | xargs realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
++      sort -u
+ }
+ all_target_sources()
index b3f00e160f5f2f6f0b7ca482c47a03e169fc1b94..983f3a52f2b10e9f1dd22f4410852c5fe5651af4 100644 (file)
@@ -14,3 +14,5 @@ staging-mt7621-dts-change-palmbus-address-to-lower-case.patch
 bpf-bpf_fib_lookup-should-not-return-neigh-in-nud_failed-state.patch
 net-remove-warn_on_once-sk-sk_forward_alloc-from-sk_stream_kill_queues.patch
 vc_screen-don-t-clobber-return-value-in-vcs_read.patch
+scripts-tags.sh-invoke-realpath-via-xargs.patch
+scripts-tags.sh-fix-incompatibility-with-pcre2.patch