Skip to content

Fix vmlinux.unstripped error block detection in kbuild parser#23

Merged
padovan merged 1 commit into
kernelci:mainfrom
padovan:kbuild-vmlinux-fix
Aug 19, 2025
Merged

Fix vmlinux.unstripped error block detection in kbuild parser#23
padovan merged 1 commit into
kernelci:mainfrom
padovan:kbuild-vmlinux-fix

Conversation

@padovan

@padovan padovan commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

The _find_error_block() function was incorrectly identifying error blocks for vmlinux.unstripped targets. It used a generic search for any line containing "vmlinux", which would match irrelevant lines like ".vmlinux.export.c:(___ksymtab+__builtin_memcmp+0x>" instead of the actual LD command that was failing.

When building vmlinux.unstripped, the kernel build process involves multiple intermediate steps where the actual linking step that can fail is "LD .tmp_vmlinux1". The fix adds special handling for vmlinux-related targets to look specifically for LD commands using regex patterns that match the actual build steps.

The solution:

  • Detects targets ending in .unstripped or vmlinux
  • Searches for specific LD command patterns (LD .tmp_vmlinux1, LD vmlinux.o, etc.)
  • Finds the chronologically last LD command before the error
  • Falls back to original logic for other targets

This ensures accurate error parsing for complex kernel linking scenarios while maintaining compatibility with existing functionality.

Added comprehensive test case for kbuild_019.log to verify the fix and prevent regressions.

@padovan padovan requested a review from nuclearcat August 12, 2025 22:12
@padovan padovan force-pushed the kbuild-vmlinux-fix branch from 4aab865 to bd7d253 Compare August 12, 2025 22:14
Comment thread logspec/errors/kbuild.py Outdated
The _find_error_block() function was incorrectly identifying error blocks
for vmlinux.unstripped targets. It used a generic search for any line
containing "vmlinux", which would match irrelevant lines like
".vmlinux.export.c:(___ksymtab+__builtin_memcmp+0x>" instead of the actual
LD command that was failing.

When building vmlinux.unstripped, the kernel build process involves multiple
intermediate steps where the actual linking step that can fail is
"LD .tmp_vmlinux1". The fix adds special handling for vmlinux-related
targets to look specifically for LD commands using regex patterns that
match the actual build steps.

The solution:
- Detects targets ending in .unstripped or vmlinux
- Searches for specific LD command patterns (LD .tmp_vmlinux1, LD vmlinux.o, etc.)
- Finds the chronologically last LD command before the error
- Falls back to original logic for other targets

This ensures accurate error parsing for complex kernel linking scenarios
while maintaining compatibility with existing functionality.

Added comprehensive test case for kbuild_019.log to verify the fix and
prevent regressions.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
@padovan padovan force-pushed the kbuild-vmlinux-fix branch from bd7d253 to 31a05cd Compare August 19, 2025 11:53
@padovan padovan merged commit 0104995 into kernelci:main Aug 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants