perf build: Always disable stack protection for BPF skeleton objects
PATCH 1/1 perf build: Always disable stack protection for BPF skeleton objects
When the clang toolchain has stack protection enabled, the bpf skeletons build fails with:
error: A call to built-in function '__stack_chk_fail' is not supported.
Since stack-protector makes no sense for the BPF bits, just unconditionally disable it.
See also similar case at 878625e1c7a10dfbb1fdaaaae2c4d2a58fbce627
--- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.perf +1 -1
@@ -1251,7 +1251,7 @@ else endif $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) $(SKEL_OUT)/vmlinux.h | $(SKEL_TMP_OUT) - $(QUIET_CLANG)$(CLANG) -g -O2 --target=bpf $(CLANG_OPTIONS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \ + $(QUIET_CLANG)$(CLANG) -g -O2 -fno-stack-protector --target=bpf $(CLANG_OPTIONS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \ -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ $(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
Signature · 1 line
2.50.1
Hello,
Quoted 11 lines · Federico Pellegrin
When the clang toolchain has stack protection enabled, the bpf skeletons build fails with:
error: A call to built-in function '
__stack_chk_fail' is not supported.Since stack-protector makes no sense for the BPF bits, just unconditionally disable it.
See also similar case at
878625e1c7a10dfbb1fdaaaae2c4d2a58fbce627Signed-off-by Federico Pellegrin <[email protected]>
Applied to perf-tools-next with minor updates.
Thanks,
Namhyung
Quoted 20 lines
--- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/Makefile.perf +1
-1@@ -1251,7 +1251,7 @@ else endif $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) $(SKEL_OUT)/vmlinux.h | $(SKEL_TMP_OUT) - $(QUIET_CLANG)$(CLANG) -g -O2 --target=bpf $(CLANG_OPTIONS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \ + $(QUIET_CLANG)$(CLANG) -g -O2 -fno-stack-protector --target=bpf $(CLANG_OPTIONS) $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \ -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ $(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)Signature · 1 line
2.50.1