Re: [PATCH v3 3/3] objtool: Alter how HOSTCC is forced

From: Nicolas Schier
Date: Thu Jan 12 2023 - 16:32:46 EST


On Thu, Jan 05, 2023 at 01:01:55AM -0800 Ian Rogers wrote:
> HOSTCC is always wanted when building objtool. Setting CC to HOSTCC
> happens after tools/scripts/Makefile.include is included, meaning
> flags are set assuming say CC is gcc, but then it can be later set to
> HOSTCC which may be clang. tools/scripts/Makefile.include is needed
> for host set up and common macros in objtool's Makefile. Rather than
> override CC to HOSTCC, just pass CC as HOSTCC to Makefile.build, the
> libsubcmd builds and the linkage step. This means the Makefiles don't
> see things like CC changing and tool flag determination, and similar,
> work properly. To avoid mixing CFLAGS from different compilers just
> the objtool CFLAGS are determined with the exception of
> EXTRA_WARNINGS. HOSTCFLAGS is added to these so that command line
> flags can add to the CFLAGS.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> tools/objtool/Makefile | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>

Reviewed-by: Nicolas Schier <nicolas@xxxxxxxxx>

Attachment: signature.asc
Description: PGP signature