Re: [PATCH v2 1/3] objtool: Make objtool check actually fatal upon fatal errors

From: Ingo Molnar
Date: Mon Jan 08 2024 - 04:15:49 EST



* Dimitri John Ledkov <dimitri.ledkov@xxxxxxxxxxxxx> wrote:

> Currently function calls within check() are sensitive to fatal errors
> (negative return codes) and abort execution prematurely. However, in
> all such cases the check() function still returns 0, and thus
> resulting in a successful kernel build.
>
> The only correct code paths were the ones that escpae the control flow
> with `return ret`.
>
> Make the check() function return `ret` status code, and make all
> negative return codes goto that instruction. This makes fatal errors
> (not warnings) from various function calls actually fail the
> build. E.g. if create_retpoline_sites_sections() fails to create elf
> section pair retpoline_sites the tool now exits with an error code.
>
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@xxxxxxxxxxxxx>

So, is this not expected to be the case anymore:

> out:
> - /*
> - * For now, don't fail the kernel build on fatal warnings. These
> - * errors are still fairly common due to the growing matrix of
> - * supported toolchains and their recent pace of change.
> - */
> - return 0;

?

How about making it only fatal if CONFIG_WERROR=y, ie. an analogue to our
treatment of compiler warnings?

Thanks,

Ingo