]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gen_compile_commands: Ignore libgcc.a
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 27 Apr 2026 16:04:56 +0000 (18:04 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 4 May 2026 19:12:55 +0000 (13:12 -0600)
Some architectures link libgcc.a from the toolchain into the kernel.
gen_compile_commands trie to read the kbuild .cmd files of its
constituent object files, which are not available.

Flat out ignore libgcc.a, as it is not built as part of the kernel
anyways.

Link: https://lore.kernel.org/r/20260427-kunit-or1k-v1-1-9d3109e991e8@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
scripts/clang-tools/gen_compile_commands.py

index 96e6e46ad1a702cb0fad5d524a9a02d222b236ec..8d14b81efd73714eab02d7907937b41ac8e7aa71 100755 (executable)
@@ -201,6 +201,8 @@ def main():
         # Modules are listed in modules.order.
         if os.path.isdir(path):
             cmdfiles = cmdfiles_in_dir(path)
+        elif os.path.basename(path) == 'libgcc.a':
+            cmdfiles = []
         elif path.endswith('.a'):
             cmdfiles = cmdfiles_for_a(path, ar)
         elif path.endswith('modules.order'):