tools/resolve_btfids: Alter how HOSTCC is forced
authorIan Rogers <irogers@google.com>
Tue, 24 Jan 2023 06:43:24 +0000 (22:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:27 +0000 (09:42 +0200)
commit833a654b510b1dcae258f0c461ab72c57e6feb65
tree764f4470dcbaf8b32b7db7c251c0a96a0a8ae52e
parent2457021a4f07a57134239e10e9c72fe702d15156
tools/resolve_btfids: Alter how HOSTCC is forced

commit 13e07691a16ff31b209fbfce25c01ff296b05e45 upstream.

HOSTCC is always wanted when building. 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.

Also, clear the passed subdir as otherwise an outer build may break by
inadvertently passing an inappropriate value.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20230124064324.672022-2-irogers@google.com
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/bpf/resolve_btfids/Makefile