mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 01/11] perf aslr: Add missing includes and sort headers
@ 2026-09-17  4:53 Ian Rogers
  2026-09-17  4:53 ` [PATCH v1 02/11] perf bench messaging: " Ian Rogers
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Ian Rogers @ 2026-09-17  4:53 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim, Jiri Olsa, Ian Rogers,
	Adrian Hunter, James Clark, linux-perf-users, linux-kernel
  Cc: sashiko-bot

Sashiko reported:

  When building the perf utility against strict C standard libraries
  such as musl libc, compilation fails in tools/perf/util/aslr.c due
  to missing explicit inclusions of <stdlib.h> and <string.h>.

  The implementation relies on standard memory management and string
  functions like malloc(), free(), memcpy(), and memset() in routines
  such as aslr_tool__findnew_mapping(), aslr_tool__process_sample(),
  and aslr_tool__delete(). Because the required headers are omitted,
  the compiler must resolve these calls via implicit function
  declarations. While glibc may transitively provide these definitions
  via other headers, musl libc does not. This violates strict C99+
  standard compliance and triggers fatal build errors under modern
  compiler configurations.

Add the header files and use git clang-format to sort.

Reported-by: sashiko-bot@kernel.org
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/aslr.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/tools/perf/util/aslr.c b/tools/perf/util/aslr.c
index 027695d96779..f49e965243aa 100644
--- a/tools/perf/util/aslr.c
+++ b/tools/perf/util/aslr.c
@@ -1,28 +1,32 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "aslr.h"
 
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <byteswap.h>
+#include <linux/compiler.h>
+#include <linux/zalloc.h>
+#include <unistd.h>
+
+#include <internal/lib.h> /* page_size */
+
 #include "addr_location.h"
+#include "data.h"
 #include "debug.h"
+#include "dso.h"
 #include "event.h"
-#include "evsel.h"
 #include "evlist.h"
+#include "evsel.h"
 #include "machine.h"
 #include "map.h"
-#include "thread.h"
-#include "tool.h"
-#include "session.h"
-#include "data.h"
-#include "dso.h"
 #include "pmu.h"
 #include "pmus.h"
-
-#include <internal/lib.h>  /* page_size */
-#include <linux/compiler.h>
-#include <linux/zalloc.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <byteswap.h>
+#include "session.h"
+#include "thread.h"
+#include "tool.h"
 
 /**
  * struct remap_addresses_key - Key for mapping original addresses to remapped ones.
-- 
2.55.0.1082.g2b9226bbc0-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-09-17  4:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17  4:53 [PATCH v1 01/11] perf aslr: Add missing includes and sort headers Ian Rogers
2026-09-17  4:53 ` [PATCH v1 02/11] perf bench messaging: " Ian Rogers
2026-09-17  4:53 ` [PATCH v1 03/11] perf unwind-libdw: missing <stdlib.h> in libdw_set_initial_registers() Ian Rogers
2026-09-17  4:53 ` [PATCH v1 04/11] perf llvm: missing explicit POSIX headers in symbol__disassemble_llvm() Ian Rogers
2026-09-17  4:53 ` [PATCH v1 05/11] perf dso: missing POSIX headers string.h and limits.h Ian Rogers
2026-09-17  4:53 ` [PATCH v1 06/11] perf test: missing stdio.h and signal.h inclusions in cmd_test() Ian Rogers
2026-09-17  4:53 ` [PATCH v1 07/11] perf ui annotate-data: missing explicit inclusion of stdlib.h and stdio.h Ian Rogers
2026-09-17  4:53 ` [PATCH v1 08/11] perf annotate-data: missing <string.h> inclusion for libc string functions Ian Rogers
2026-09-17  4:53 ` [PATCH v1 09/11] perf mem: missing stdio.h and limits.h in mem-events.c Ian Rogers
2026-09-17  4:53 ` [PATCH v1 10/11] perf config: undeclared PATH_MAX due to missing <limits.h> inclusion Ian Rogers
2026-09-17  4:53 ` [PATCH v1 11/11] perf mem: missing standard POSIX headers in builtin-mem.c Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®