linux/tools
Florent Revest b539a287ba selftests/bpf: Fix cross compilation with CLANG_CROSS_FLAGS
I cross-compile my BPF selftests with the following command:

CLANG_CROSS_FLAGS="--target=aarch64-linux-gnu --sysroot=/sysroot/" \
  make LLVM=1 CC=clang CROSS_COMPILE=aarch64-linux-gnu- SRCARCH=arm64

(Note the use of CLANG_CROSS_FLAGS to specify a custom sysroot instead
of letting clang use gcc's default sysroot)

However, CLANG_CROSS_FLAGS gets propagated to host tools builds (libbpf
and bpftool) and because they reference it directly in their Makefiles,
they end up cross-compiling host objects which results in linking
errors.

This patch ensures that CLANG_CROSS_FLAGS is reset if CROSS_COMPILE
isn't set (for example when reaching a BPF host tool build).

Signed-off-by: Florent Revest <revest@chromium.org>
Link: https://lore.kernel.org/r/20230217151832.27784-1-revest@chromium.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-22 13:04:55 -08:00
..
accounting
arch selftests/bpf: Remove not used headers 2023-02-22 13:01:34 -08:00
bootconfig
bpf bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd() 2023-02-16 15:32:45 -08:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-01-27 14:05:46 +01:00
hv
iio
include bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup 2023-02-17 22:12:04 +01:00
io_uring
kvm/kvm_stat
laptop
leds
lib Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
memory-model
net/ynl tools: net: use python3 explicitly 2023-01-31 20:36:03 -08:00
objtool xen: branch for v6.3-rc1 2023-02-21 17:07:39 -08:00
pci
pcmcia
perf perf test build-id: Fix test check for PE file 2023-01-18 10:52:06 -03:00
power platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
rcu
scripts selftests/bpf: Fix cross compilation with CLANG_CROSS_FLAGS 2023-02-22 13:04:55 -08:00
spi
testing selftests/bpf: Tests for uninitialized stack reads 2023-02-22 12:34:50 -08:00
thermal
time
tracing rtla: Fix exit status when returning from calls to usage() 2022-12-09 18:06:24 -05:00
usb
verification Tracing fix for 6.2: 2022-12-21 19:03:42 -08:00
virtio tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
vm MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
wmi
Makefile