[PATCH 4/4] perf symbol: Add missing libgen.h include to get basename() prototype
From: Arnaldo Carvalho de Melo
Date: Wed Apr 01 2026 - 20:23:50 EST
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
This works in some places because there are tricks to prefer a GNU
version instead of the XPG version, but started breaking in some musl
libc systems due to some unrelated change that made libgen.h stop being
included by chance.
Since symbol.h is using basename(), make it include libgen.h.
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/symbol.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index c67814d6d6d6f64a..b37ecc2e90f77efe 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -10,6 +10,7 @@
#include <linux/rbtree.h>
#include <stdio.h>
#include <errno.h>
+#include <libgen.h>
#include "addr_location.h"
#include "path.h"
#include "symbol_conf.h"
--
2.53.0