Skip to contentSkip to conversation

perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT

PATCH In review Arnaldo Carvalho de Melo 2 participants 2 messages Aug 9, 2024 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

PATCH 1/1 perf debuginfo: Fix the build with !HAVE_DWARF_SUPPORT

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 <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>

---

I have this in perf-tools-next.

---
 tools/perf/util/debuginfo.h | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/debuginfo.h +2 -0
index 4d65b8c605fc5445..ad6422c3f8ca3ef6 100644
@@ -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)
Signature · 1 line
2.45.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Arnaldo Carvalho de Melo

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....

Quoted 6 lines
Cc Adrian Hunter <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>
Quoted 3 lines

---

I have this in perf-tools-next.

Thanks,
Namhyung

Quoted 21 lines
---
 tools/perf/util/debuginfo.h | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/debuginfo.h +2 -1
index 4d65b8c605fc5445..ad6422c3f8ca3ef6 100644
@@ -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