[PATCH 1/2] gen_compile_commands: Ignore libgcc.a

0 views
Skip to first unread message

Thomas Weißschuh

unread,
Apr 27, 2026, 12:05:56 PM (4 days ago) Apr 27
to Nathan Chancellor, Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt, Brendan Higgins, David Gow, Rae Moar, linux-...@vger.kernel.org, ll...@lists.linux.dev, linux-...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com, Thomas Weißschuh
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.

Signed-off-by: Thomas Weißschuh <li...@weissschuh.net>
---
scripts/clang-tools/gen_compile_commands.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
index 96e6e46ad1a7..8d14b81efd73 100755
--- a/scripts/clang-tools/gen_compile_commands.py
+++ b/scripts/clang-tools/gen_compile_commands.py
@@ -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'):

--
2.53.0

Nathan Chancellor

unread,
Apr 29, 2026, 2:32:57 PM (2 days ago) Apr 29
to Thomas Weißschuh, Nathan Chancellor, Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt, Brendan Higgins, David Gow, Rae Moar, linux-...@vger.kernel.org, ll...@lists.linux.dev, linux-...@vger.kernel.org, linux-k...@vger.kernel.org, kuni...@googlegroups.com
On Mon, 27 Apr 2026 18:04:56 +0200, Thomas Weißschuh <li...@weissschuh.net> wrote:
> 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.
>
> [...]

Acked-by: Nathan Chancellor <nat...@kernel.org>

--
Cheers,
Nathan

Reply all
Reply to author
Forward
0 new messages