From: Eduard Zingerman Date: Fri, 13 Dec 2024 00:32:24 +0000 (-0800) Subject: selftests/bpf: make BPF_TARGET_ENDIAN non-recursive to speed up *.bpf.o build X-Git-Tag: v6.14-rc1~133^2~47 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5506b7d7bbdb7622959d80a4a2fc18985a01d512;p=linux-block.git selftests/bpf: make BPF_TARGET_ENDIAN non-recursive to speed up *.bpf.o build BPF_TARGET_ENDIAN is used in CLANG_BPF_BUILD_RULE and co macros. It is defined as a recursively expanded variable, meaning that it is recomputed each time the value is needed. Thus, it is recomputed for each *.bpf.o file compilation. The variable is computed by running a C compiler in a shell. This significantly hinders parallel build performance for *.bpf.o files. This commit changes BPF_TARGET_ENDIAN to be a simply expanded variable. # Build performance stats before this commit $ git clean -xfd; time make -j12 real 1m0.000s ... # Build performance stats after this commit $ git clean -xfd; time make -j12 real 0m43.605s ... Signed-off-by: Eduard Zingerman Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20241213003224.837030-1-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov --- diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index bb8cf8f5bf11..9e870e519c30 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -461,10 +461,10 @@ $(shell $(1) $(2) -dM -E -