]> git.baikalelectronics.ru Git - kernel.git/commit
tools/resolve_btfids: Build with host flags
authorConnor O'Brien <connoro@google.com>
Wed, 12 Jan 2022 00:25:03 +0000 (00:25 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Sat, 15 Jan 2022 00:53:23 +0000 (16:53 -0800)
commitcdabca7e5ee3ad71e888c77bc888c98c233879b8
tree5bcfa4b8ba801c404e883cbf71d3b9022ce14e66
parent53f5667c33fd49d438b0255a27ba5608f50765c1
tools/resolve_btfids: Build with host flags

resolve_btfids is built using $(HOSTCC) and $(HOSTLD) but does not
pick up the corresponding flags. As a result, host-specific settings
(such as a sysroot specified via HOSTCFLAGS=--sysroot=..., or a linker
specified via HOSTLDFLAGS=-fuse-ld=...) will not be respected.

Fix this by setting CFLAGS to KBUILD_HOSTCFLAGS and LDFLAGS to
KBUILD_HOSTLDFLAGS.

Also pass the cflags through to libbpf via EXTRA_CFLAGS to ensure that
the host libbpf is built with flags consistent with resolve_btfids.

Signed-off-by: Connor O'Brien <connoro@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20220112002503.115968-1-connoro@google.com
tools/bpf/resolve_btfids/Makefile