From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
Ian Rogers <irogers@google.com>,
James Clark <james.clark@linaro.org>,
Jiri Olsa <jolsa@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org
Subject: [PATCH v6.19-rc1 1/1] libperf: Compile using -std=gnu17 to deal with visibility attribute issues
Date: Wed, 3 Dec 2025 18:20:08 -0300 [thread overview]
Message-ID: <aTCpiDG6WOzMv7ji@x1> (raw)
We seem to need a more invasive patch using 'extern' on all LIBPERF_API
prefixed functions to be future proof, so use -std=gnu17 which is the
one in gcc 14, present in the distro generation before ubuntu 25.10 (gcc
15).
But to make progress and avoid this on Ubuntu 25.10/gcc 15, lets to with
the easy workaround:
evlist.c: In function 'perf_evlist__purge':
evlist.c:202:17: error: implicit declaration of function 'perf_evsel__delete'; did you mean 'perf_evsel__exit'? [-Wimplicit-function-declaration]
202 | perf_evsel__delete(pos);
| ^~~~~~~~~~~~~~~~~~
| perf_evsel__exit
evlist.c:202:17: error: nested extern declaration of 'perf_evsel__delete' [-Werror=nested-externs]
evlist.c: In function 'perf_evlist__open':
evlist.c:261:23: error: implicit declaration of function 'perf_evsel__open'; did you mean 'perf_evsel__exit'? [-Wimplicit-function-declaration]
261 | err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
| ^~~~~~~~~~~~~~~~
| perf_evsel__exit
evlist.c:261:23: error: nested extern declaration of 'perf_evsel__open' [-Werror=nested-externs]
libbpf doesn't experience this because for some other reason it already
has this line:
override CFLAGS += -std=gnu89
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/perf/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile
index 7fbb50b74c00b3b9..5e12fd97f50c1efb 100644
--- a/tools/lib/perf/Makefile
+++ b/tools/lib/perf/Makefile
@@ -51,6 +51,7 @@ INCLUDES = \
-I$(srctree)/tools/include/uapi
# Append required CFLAGS
+override CFLAGS += -std=gnu17
override CFLAGS += -g -Werror -Wall
override CFLAGS += -fPIC
override CFLAGS += $(INCLUDES)
--
2.52.0
next reply other threads:[~2025-12-03 21:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 21:20 Arnaldo Carvalho de Melo [this message]
2025-12-04 8:41 ` [PATCH v6.19-rc1 1/1] libperf: Compile using -std=gnu17 to deal with visibility attribute issues Namhyung Kim
2025-12-04 14:32 ` Arnaldo Melo
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=aTCpiDG6WOzMv7ji@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--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=namhyung@kernel.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