tools/resolve_btfids: Alter how HOSTCC is forced
authorIan Rogers <irogers@google.com>
Tue, 24 Jan 2023 06:43:24 +0000 (22:43 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 25 Jan 2023 17:28:14 +0000 (18:28 +0100)
commit13e07691a16ff31b209fbfce25c01ff296b05e45
tree17fd1f291539ed5cdc540a15dcce700a64b878fa
parentaf03299d8536d62b49c7f3cb929349eb2d66bcd5
tools/resolve_btfids: Alter how HOSTCC is forced

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
tools/bpf/resolve_btfids/Makefile