Linux build: fix noreturn
and silence spurious falls through
objtools warnings
#17442
+28
−15
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.
Motivation and Context
Follow-up for #17410
Objtool correctly complains that
spl_panic()
andluaD_throw()
are missing anattribute((noreturn))
annotation. Unfortunately, adding the attribute results in a ton of spuriousfalls through to next function
warnings. This is documented [1], so I patchedobjtool
to includespl_panic()
andluaD_throw()
in the globalnoreturn
functions list [2] and indeed all spl related (see below) warnings are gone.Description
Getting the
objtool
maintainer to add our functions to this list isn't likely to be a viable path. Therefore I took a differnet approach and silenced them via the--no-unreachable
objtool
flag, they were false positives anyway. The first commit leaves us withlua{,L}_error()
noreturn
warnings which are also silenced by the second commit. Obviously they should be fixed as well, but I'd rather prefer to do this in a subsequent PR since it's a bit more involved (changing function return types).[1] https://github.com/torvalds/linux/blob/7a912d04415b372324e5a8dfad3360d993d0c23a/tools/objtool/Documentation/objtool.txt#L388-L399
[2] https://github.com/torvalds/linux/blob/v6.15/tools/objtool/noreturns.h
https://github.com/torvalds/linux/blob/7a912d04415b372324e5a8dfad3360d993d0c23a/tools/objtool/check.c#L255-L257
How Has This Been Tested?
Build locally and verified that no
objtool
warnings are left.Types of changes
Checklist:
Signed-off-by
.