mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
When the kernel build fails due to an objtool segfault, the error
message is a bit obtuse and confusing:
make[5]: *** [scripts/Makefile.build:503: drivers/scsi/qla2xxx/qla2xxx.o] Error 139
^^^^^^^^^
make[5]: *** Deleting file 'drivers/scsi/qla2xxx/qla2xxx.o'
make[4]: *** [scripts/Makefile.build:556: drivers/scsi/qla2xxx] Error 2
make[3]: *** [scripts/Makefile.build:556: drivers/scsi] Error 2
make[2]: *** [scripts/Makefile.build:556: drivers] Error 2
make[1]: *** [/home/jpoimboe/git/linux/Makefile:2013: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Add a signal handler to objtool which prints an error message like if
the local stack has overflown (for which there's a chance as objtool
makes heavy use of recursion):
drivers/scsi/qla2xxx/qla2xxx.o: error: SIGSEGV: objtool stack overflow!
or:
drivers/scsi/qla2xxx/qla2xxx.o: error: SIGSEGV: objtool crash!
Also, re-raise the signal so the core dump still gets triggered.
[ mingo: Applied a build fix, added more comments and prettified the code. ]
Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Alexandre Chartre <alexandre.chartre@oracle.com>
Cc: David Laight <david.laight.linux@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://patch.msgid.link/mi4tihk4dbncn7belrhp6ooudhpw4vdggerktu5333w3gqf3uf@vqlhc3y667mg
38 lines
860 B
Plaintext
38 lines
860 B
Plaintext
objtool-y += arch/$(SRCARCH)/
|
|
|
|
objtool-y += weak.o
|
|
|
|
objtool-y += check.o
|
|
objtool-y += special.o
|
|
objtool-y += builtin-check.o
|
|
objtool-y += elf.o
|
|
objtool-y += objtool.o
|
|
|
|
objtool-$(BUILD_DISAS) += disas.o
|
|
objtool-$(BUILD_DISAS) += trace.o
|
|
|
|
objtool-$(BUILD_ORC) += orc_gen.o orc_dump.o
|
|
objtool-$(BUILD_KLP) += builtin-klp.o klp-diff.o klp-post-link.o
|
|
|
|
objtool-y += libstring.o
|
|
objtool-y += libctype.o
|
|
objtool-y += str_error_r.o
|
|
objtool-y += librbtree.o
|
|
objtool-y += signal.o
|
|
|
|
$(OUTPUT)libstring.o: ../lib/string.c FORCE
|
|
$(call rule_mkdir)
|
|
$(call if_changed_dep,cc_o_c)
|
|
|
|
$(OUTPUT)libctype.o: ../lib/ctype.c FORCE
|
|
$(call rule_mkdir)
|
|
$(call if_changed_dep,cc_o_c)
|
|
|
|
$(OUTPUT)str_error_r.o: ../lib/str_error_r.c FORCE
|
|
$(call rule_mkdir)
|
|
$(call if_changed_dep,cc_o_c)
|
|
|
|
$(OUTPUT)librbtree.o: ../lib/rbtree.c FORCE
|
|
$(call rule_mkdir)
|
|
$(call if_changed_dep,cc_o_c)
|