Fix vmlinux.unstripped error block detection in kbuild parser#23
Merged
Conversation
4aab865 to
bd7d253
Compare
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>
bd7d253 to
31a05cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.