perf build: Warn for BPF skeletons if endian mismatches
Done as a warning as I'm not fully confident of the test's robustness of comparing the macro definition of __BYTE_ORDER__. v2. Is a rebase following patch 1 being merged. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andrii Nakryiko <andrii@kernel.org> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20230410160905.3052640-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
ea0c52399d
commit
51924ae69e
@@ -663,14 +663,17 @@ ifndef NO_BPF_SKEL
|
|||||||
$(call feature_check,clang-bpf-co-re)
|
$(call feature_check,clang-bpf-co-re)
|
||||||
ifeq ($(feature-clang-bpf-co-re), 0)
|
ifeq ($(feature-clang-bpf-co-re), 0)
|
||||||
dummy := $(error: ERROR: BPF skeletons unsupported. clang too old/not installed or build with NO_BPF_SKEL=1.)
|
dummy := $(error: ERROR: BPF skeletons unsupported. clang too old/not installed or build with NO_BPF_SKEL=1.)
|
||||||
else
|
|
||||||
ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
|
|
||||||
dummy := $(error: ERROR: BPF skeletons unsupported. BPF skeleton support requires libbpf or build with NO_BPF_SKEL=1.)
|
|
||||||
else
|
|
||||||
$(call detected,CONFIG_PERF_BPF_SKEL)
|
|
||||||
CFLAGS += -DHAVE_BPF_SKEL
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
|
||||||
|
dummy := $(error: ERROR: BPF skeletons unsupported. BPF skeleton support requires libbpf or build with NO_BPF_SKEL=1.)
|
||||||
|
endif
|
||||||
|
host_byte_order=$(echo ""|$(HOSTCC) -dM -E -|grep __BYTE_ORDER__)
|
||||||
|
target_byte_order=$(echo ""|$(CC) -dM -E -|grep __BYTE_ORDER__)
|
||||||
|
ifneq ($(host_byte_order), $(target_byte_order))
|
||||||
|
$(warning Possibly mismatched host and target endianness may break BPF skeletons)
|
||||||
|
endif
|
||||||
|
$(call detected,CONFIG_PERF_BPF_SKEL)
|
||||||
|
CFLAGS += -DHAVE_BPF_SKEL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dwarf-post-unwind := 1
|
dwarf-post-unwind := 1
|
||||||
|
|||||||
Reference in New Issue
Block a user