From: Ilya Leoshkevich Date: Mon, 28 Oct 2019 10:20:49 +0000 (+0100) Subject: selftest/bpf: Use -m{little, big}-endian for clang X-Git-Tag: v5.5-rc1~174^2~249^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=313e7f6fb1d9a8814424c2c6878848648c9c090f;p=thirdparty%2Flinux.git selftest/bpf: Use -m{little, big}-endian for clang When cross-compiling tests from x86 to s390, the resulting BPF objects fail to load due to endianness mismatch. Fix by using BPF-GCC endianness check for clang as well. Signed-off-by: Ilya Leoshkevich Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20191028102049.7489-1-iii@linux.ibm.com --- diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 933f393810394..3209c208f3b36 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -131,8 +131,13 @@ $(shell $(1) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') endef +# Determine target endianness. +IS_LITTLE_ENDIAN = $(shell $(CC) -dM -E -