From: Björn Töpel Date: Tue, 15 Nov 2022 18:20:51 +0000 (+0100) Subject: selftests/bpf: Pass target triple to get_sys_includes macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=98b2afc8a67f651ed01fc7d5a7e2528e63dd4e08;p=linux.git selftests/bpf: Pass target triple to get_sys_includes macro When cross-compiling [1], the get_sys_includes make macro should use the target system include path, and not the build hosts system include path. Make clang honor the CROSS_COMPILE triple. [1] e.g. "ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- make" Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Tested-by: Anders Roxell Link: https://lore.kernel.org/bpf/20221115182051.582962-2-bjorn@kernel.org --- diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index aa4e29315f4a7..6a0f043dc4109 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -310,9 +310,9 @@ $(RESOLVE_BTFIDS): $(HOST_BPFOBJ) | $(HOST_BUILD_DIR)/resolve_btfids \ # Use '-idirafter': Don't interfere with include mechanics except where the # build would have failed anyways. define get_sys_includes -$(shell $(1) -v -E - &1 \ +$(shell $(1) $(2) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ -$(shell $(1) -dM -E -