Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Fix runqslower cross-endian build

The runqslower binary from a cross-endian build currently fails to run
because the included skeleton has host endianness. Fix this by passing the
target BPF endianness to the runqslower sub-make.

Fixes: 5a63c33d6f00 ("selftests/bpf: Support cross-endian building")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250125071423.2603588-1-itugrok@yahoo.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Tony Ambardar and committed by
Alexei Starovoitov
cb3ade56 0a7c2a84

+3 -1
+2 -1
tools/bpf/runqslower/Makefile
··· 6 6 BPFTOOL_OUTPUT := $(OUTPUT)bpftool/ 7 7 DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bootstrap/bpftool 8 8 BPFTOOL ?= $(DEFAULT_BPFTOOL) 9 + BPF_TARGET_ENDIAN ?= --target=bpf 9 10 LIBBPF_SRC := $(abspath ../../lib/bpf) 10 11 BPFOBJ_OUTPUT := $(OUTPUT)libbpf/ 11 12 BPFOBJ := $(BPFOBJ_OUTPUT)libbpf.a ··· 64 63 $(QUIET_GEN)$(BPFTOOL) gen skeleton $< > $@ 65 64 66 65 $(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT) 67 - $(QUIET_GEN)$(CLANG) -g -O2 --target=bpf $(INCLUDES) \ 66 + $(QUIET_GEN)$(CLANG) -g -O2 $(BPF_TARGET_ENDIAN) $(INCLUDES) \ 68 67 -c $(filter %.c,$^) -o $@ && \ 69 68 $(LLVM_STRIP) -g $@ 70 69
+1
tools/testing/selftests/bpf/Makefile
··· 306 306 BPFTOOL_OUTPUT=$(HOST_BUILD_DIR)/bpftool/ \ 307 307 BPFOBJ_OUTPUT=$(BUILD_DIR)/libbpf/ \ 308 308 BPFOBJ=$(BPFOBJ) BPF_INCLUDE=$(INCLUDE_DIR) \ 309 + BPF_TARGET_ENDIAN=$(BPF_TARGET_ENDIAN) \ 309 310 EXTRA_CFLAGS='-g $(OPT_FLAGS) $(SAN_CFLAGS) $(EXTRA_CFLAGS)' \ 310 311 EXTRA_LDFLAGS='$(SAN_LDFLAGS) $(EXTRA_LDFLAGS)' && \ 311 312 cp $(RUNQSLOWER_OUTPUT)runqslower $@