From: Namhyung Kim <namhyung@kernel.org>
To: Federico Pellegrin <fede@evolware.org>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/1] perf build: Always disable stack protection for BPF skeleton objects
Date: Tue, 22 Jul 2025 17:37:13 -0700 [thread overview]
Message-ID: <aIAuuVM-VYIF0Lsl@google.com> (raw)
In-Reply-To: <20250718041224.12389-1-fede@evolware.org>
Hello,
On Fri, Jul 18, 2025 at 06:12:24AM +0200, Federico Pellegrin wrote:
> 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
>
> Signed-off-by: Federico Pellegrin <fede@evolware.org>
Applied to perf-tools-next with minor updates.
Thanks,
Namhyung
> ---
> tools/perf/Makefile.perf | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index d4c7031b01a7..ca7dc65a3182 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -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)
> --
> 2.50.1
>
prev parent reply other threads:[~2025-07-23 0:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 4:12 [PATCH 1/1] perf build: Always disable stack protection for BPF skeleton objects Federico Pellegrin
2025-07-23 0:37 ` Namhyung Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aIAuuVM-VYIF0Lsl@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=fede@evolware.org \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.