BPF List
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org, bpf@vger.kernel.org
Subject: [PATCH 2/2] perf tools: Disable BPF skeleton if no libopenssl found
Date: Wed,  3 Dec 2025 15:29:24 -0800	[thread overview]
Message-ID: <20251203232924.1119206-2-namhyung@kernel.org> (raw)
In-Reply-To: <20251203232924.1119206-1-namhyung@kernel.org>

The libopenssl is required by bpftool which is needed to generate BPF
skeleton.  Disable it by setting BUILD_BPF_SKEL to 0 otherwise it'll see
build errors like below:

    CC      /build/util/bpf_skel/.tmp/bootstrap/sign.o
  sign.c:16:10: fatal error: openssl/opensslv.h: No such file or directory
     16 | #include <openssl/opensslv.h>
        |          ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  make[3]: *** [Makefile:256: /build/util/bpf_skel/.tmp/bootstrap/sign.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [Makefile.perf:1211: /build/util/bpf_skel/.tmp/bootstrap/bpftool] Error 2
  make[1]: *** [Makefile.perf:287: sub-make] Error 2
  make: *** [Makefile:76: all] Error 2

Now it'll skip the build with the following message:

  Makefile.config:729: Warning: Disabled BPF skeletons as libopenssl is required

Closes: https://lore.kernel.org/r/aP7uq6eVieG8v_v4@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Makefile.config | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 6b62fea21a0ad1ca..fd72bfbc83b38b3c 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -704,6 +704,11 @@ ifndef NO_LIBBPF
   endif
 endif
 
+ifeq ($(feature-libopenssl), 1)
+  $(call detected,CONFIG_LIBOPENSSL)
+  CFLAGS += -DHAVE_LIBOPENSSL_SUPPORT
+endif
+
 ifndef BUILD_BPF_SKEL
   # BPF skeletons control a large number of perf features, by default
   # they are enabled.
@@ -720,6 +725,9 @@ ifeq ($(BUILD_BPF_SKEL),1)
   else ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
     $(warning Warning: Disabled BPF skeletons as libbpf is required)
     BUILD_BPF_SKEL := 0
+  else ifeq ($(filter -DHAVE_LIBOPENSSL_SUPPORT, $(CFLAGS)),)
+    $(warning Warning: Disabled BPF skeletons as libopenssl is required)
+    BUILD_BPF_SKEL := 0
   else ifeq ($(call get-executable,$(CLANG)),)
     $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) is missing)
     BUILD_BPF_SKEL := 0
-- 
2.52.0.177.g9f829587af-goog


  reply	other threads:[~2025-12-03 23:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 23:29 [PATCH 1/2] tools/build: Add a feature test for libopenssl Namhyung Kim
2025-12-03 23:29 ` Namhyung Kim [this message]
2025-12-04  0:34 ` Ian Rogers
2025-12-04  7:52   ` Namhyung Kim
2025-12-04 16:16   ` Arnaldo Carvalho de Melo
2025-12-04 23:52     ` Namhyung Kim
2025-12-05  6:27       ` Ian Rogers
2025-12-05 10:28         ` Quentin Monnet
2025-12-16  6:19           ` Namhyung Kim
2025-12-23 18:17 ` Namhyung Kim

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=20251203232924.1119206-2-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox