mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Safonov via B4 Relay <devnull+dima.arista.com@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	 Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	 James Clark <james.clark@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	 linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Dmitry Safonov <0x7f454c46@gmail.com>
Subject: [PATCH] perf/build: Include linux/string.h by jitdump.c for strlcpy()
Date: Thu, 26 Nov 2026 06:08:35 +0000	[thread overview]
Message-ID: <20261126-perf-string-h-v1-1-8f5c39ff30f0@arista.com> (raw)

From: Dmitry Safonov <dima@arista.com>

jit_open() now calls strlcpy(), but jitdump.c only includes the libc
<string.h>. With glibc older than 2.38, that header does not declare
strlcpy(), causing the build to fail:

util/jitdump.c:246:17: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Wimplicit-function-declaration]
  246 |                 strlcpy(jd->dir, dname, sizeof(jd->dir));
      |                 ^~~~~~~
      |                 strncpy

Current mainline gets the declaration indirectly through symbol.h after
commit 5a9dd835894c ("perf symbols: skip livepatch symbols when loading
kallsyms"). Stable trees are affected, in my case it's v6.12.119 with
stable backport/commit 649bf062b91d ("perf jitdump: Use dirname()
return value in jit_open()")

Replace <string.h> with <linux/string.h>, which includes the libc header
and declares the tools strlcpy() implementation.

Fixes: 4eddf7d9e341 ("perf jitdump: Use dirname() return value in jit_open()")
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 tools/perf/util/jitdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 45a05316b3ca..626a12280ca3 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -5,7 +5,6 @@
 #include <libgen.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <inttypes.h>
@@ -16,6 +15,7 @@
 #include <linux/stringify.h>
 #include <linux/kernel.h>
 #include <linux/unaligned.h>
+#include <linux/string.h>
 
 #include "event.h"
 #include "debug.h"

---
base-commit: 40212b29a6f718d4e7fb3275cede181cb8e137cf
change-id: 20261126-perf-string-h-0a61ba363e65

Best regards,
--  
Dmitry Safonov <dima@arista.com>



                 reply	other threads:[~2026-11-26  6:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261126-perf-string-h-v1-1-8f5c39ff30f0@arista.com \
    --to=devnull+dima.arista.com@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dima@arista.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=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@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

all inboxes | Powered by JetHome®