[PATCH v2] scripts/tags.sh: fix "make COMPILED_SOURCE=1 cscope" command ends up with *.rlib, *.rmeta, *.so filenames in cscope.files

From: Sergei Litvin

Date: Sat May 30 2026 - 05:01:17 EST


When executing the command `make COMPILED_SOURCE=1 cscope`, the `cscope.files`
file generated by it includes filenames with the extensions *.rlib, *.rmeta,
and *.so (taken from *.cmd files, which, in turn, are generated from *.d
dependency files by the `fixdep` utility).

Signed-off-by: Sergei Litvin <litvindev@xxxxxxxxx>
---
scripts/tags.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 243373683f98..9a58fed694b7 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -84,15 +84,20 @@ find_other_sources()
all_sources()
{
find_arch_include_sources ${SRCARCH} '*.[chS]'
+ find_arch_include_sources ${SRCARCH} '*.rs'
if [ -n "$archinclude" ]; then
find_arch_include_sources $archinclude '*.[chS]'
+ find_arch_include_sources $archinclude '*.rs'
fi
find_include_sources '*.[chS]'
+ find_include_sources '*.rs'
for arch in $ALLSOURCE_ARCHS
do
find_arch_sources $arch '*.[chS]'
+ find_arch_sources $arch '*.rs'
done
find_other_sources '*.[chS]'
+ find_other_sources '*.rs'
}

all_compiled_sources()
@@ -100,7 +105,7 @@ all_compiled_sources()
{
echo include/generated/autoconf.h
find $ignore -name "*.cmd" -exec \
- grep -Poh '(?<=^ )\S+|(?<== )\S+[^\\](?=$)' {} \+ |
+ grep -Poh '(?<=^ )\S+\.([chS]|rs)|(?<== )\S+\.(?1)(?=$)' {} \+ |
awk '!a[$0]++'
} | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
sort -u
--
2.54.0