Skip to content

Commit 2eeb09f

Browse files
acmelnamhyung
authored andcommitted
libperf: Use 'extern' in LIBPERF_API visibility macro
Use 'extern' on LIBPERF_API to address this issue that started appearing with gcc 15, first seen in ubuntu 25.10: 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] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent d509d14 commit 2eeb09f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • tools/lib/perf/include/perf

tools/lib/perf/include/perf/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <stdarg.h>
66

77
#ifndef LIBPERF_API
8-
#define LIBPERF_API __attribute__((visibility("default")))
8+
#define LIBPERF_API extern __attribute__((visibility("default")))
99
#endif
1010

1111
enum libperf_print_level {

0 commit comments

Comments
 (0)