mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT
@ 2024-08-09 14:47 Arnaldo Carvalho de Melo
  2024-08-09 19:39 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-09 14:47 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Adrian Hunter, Ian Rogers, Jiri Olsa, Kan Liang,
	Linux Kernel Mailing List

In that case we have a set of placeholder functions, one of them uses a
'Dwarf_Addr' type that is not present as it is defined in the missing
DWARF libraries, so provide a placeholder typedef for that as well.

The build error before this patch, a static build out of 'make -C tools/perf build-test':

  In file included from util/annotate.c:28:
  util/debuginfo.h:44:46: error: unknown type name ‘Dwarf_Addr’
     44 |                                              Dwarf_Addr *offs __maybe_unused,
        |                                              ^~~~~~~~~~
  make[6]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:106: util/annotate.o] Error 1
  make[6]: *** Waiting for unfinished jobs....

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---

I have this in perf-tools-next.

---
 tools/perf/util/debuginfo.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/debuginfo.h b/tools/perf/util/debuginfo.h
index 4d65b8c605fc5445..ad6422c3f8ca3ef6 100644
--- a/tools/perf/util/debuginfo.h
+++ b/tools/perf/util/debuginfo.h
@@ -40,6 +40,8 @@ static inline void debuginfo__delete(struct debuginfo *dbg __maybe_unused)
 {
 }
 
+typedef void Dwarf_Addr;
+
 static inline int debuginfo__get_text_offset(struct debuginfo *dbg __maybe_unused,
 					     Dwarf_Addr *offs __maybe_unused,
 					     bool adjust_offset __maybe_unused)
-- 
2.45.2


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

* Re: [PATCH 1/1] perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT
  2024-08-09 14:47 [PATCH 1/1] perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT Arnaldo Carvalho de Melo
@ 2024-08-09 19:39 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2024-08-09 19:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Ian Rogers, Jiri Olsa, Kan Liang,
	Linux Kernel Mailing List

On Fri, Aug 9, 2024 at 7:47 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> In that case we have a set of placeholder functions, one of them uses a
> 'Dwarf_Addr' type that is not present as it is defined in the missing
> DWARF libraries, so provide a placeholder typedef for that as well.
>
> The build error before this patch, a static build out of 'make -C tools/perf build-test':
>
>   In file included from util/annotate.c:28:
>   util/debuginfo.h:44:46: error: unknown type name ‘Dwarf_Addr’
>      44 |                                              Dwarf_Addr *offs __maybe_unused,
>         |                                              ^~~~~~~~~~
>   make[6]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:106: util/annotate.o] Error 1
>   make[6]: *** Waiting for unfinished jobs....
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

> ---
>
> I have this in perf-tools-next.

Thanks,
Namhyung

>
> ---
>  tools/perf/util/debuginfo.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/debuginfo.h b/tools/perf/util/debuginfo.h
> index 4d65b8c605fc5445..ad6422c3f8ca3ef6 100644
> --- a/tools/perf/util/debuginfo.h
> +++ b/tools/perf/util/debuginfo.h
> @@ -40,6 +40,8 @@ static inline void debuginfo__delete(struct debuginfo *dbg __maybe_unused)
>  {
>  }
>
> +typedef void Dwarf_Addr;
> +
>  static inline int debuginfo__get_text_offset(struct debuginfo *dbg __maybe_unused,
>                                              Dwarf_Addr *offs __maybe_unused,
>                                              bool adjust_offset __maybe_unused)
> --
> 2.45.2
>

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

end of thread, other threads:[~2024-08-09 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-09 14:47 [PATCH 1/1] perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT Arnaldo Carvalho de Melo
2024-08-09 19:39 ` Namhyung Kim

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®