Skip to contentSkip to conversation

perf genelf: Fix NO_LIBDW=1 build

PATCH Applied Ian Rogers 2 participants 3 messages Jul 2, 2025 – Jul 3, 2025 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf genelf: Fix NO_LIBDW=1 build

With NO_LIBDW=1 a new unused-parameter warning/error has appeared:

```
util/genelf.c: In function ‘jit_write_elf’:
util/genelf.c:163:32: error: unused parameter ‘load_addr’ [-Werror=unused-parameter]
  163 | jit_write_elf(int fd, uint64_t load_addr, const char *sym,
```
Fixes e3f612c1d8f3 ("perf genelf: Remove libcrypto dependency and use built-in sha1()")
---
 tools/perf/util/genelf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/genelf.c +1 -1
index fcf86a27f69e..591548b10e34 100644
@@ -160,7 +160,7 @@ jit_add_eh_frame_info(Elf *e, void* unwinding, uint64_t unwinding_header_size,
  * csize: the code size in bytes
  */
 int
-jit_write_elf(int fd, uint64_t load_addr, const char *sym,
+jit_write_elf(int fd, uint64_t load_addr __maybe_unused, const char *sym,
 	      const void *code, int csize,
 	      void *debug __maybe_unused, int nr_debug_entries __maybe_unused,
 	      void *unwinding, uint64_t unwinding_header_size, uint64_t unwinding_size)
Signature · 1 line
2.50.0.727.gbf7dc18ff4-goog
maintainer
#1 lore raw
Quoted 6 lines · Ian Rogers

With NO_LIBDW=1 a new unused-parameter warning/error has appeared:

```
util/genelf.c: In function ‘jit_write_elf’:
util/genelf.c:163:32: error: unused parameter ‘load_addr’ [-Werror=unused-parameter]
  163 | jit_write_elf(int fd, uint64_t load_addr, const char *sym,
```

Thanks for the fix.

And I found there's no entry for NO_LIBDW=1 in the build-test. Can you please add one?

Thanks,
Namhyung

Quoted 23 lines
Fixes e3f612c1d8f3 ("perf genelf: Remove libcrypto dependency and use built-in sha1()")
---
 tools/perf/util/genelf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/genelf.c +1 -1
index fcf86a27f69e..591548b10e34 100644
@@ -160,7 +160,7 @@ jit_add_eh_frame_info(Elf *e, void* unwinding, uint64_t unwinding_header_size,
  * csize: the code size in bytes
  */
 int
-jit_write_elf(int fd, uint64_t load_addr, const char *sym,
+jit_write_elf(int fd, uint64_t load_addr __maybe_unused, const char *sym,
 	      const void *code, int csize,
 	      void *debug __maybe_unused, int nr_debug_entries __maybe_unused,
 	      void *unwinding, uint64_t unwinding_header_size, uint64_t unwinding_size)
Signature · 1 line
2.50.0.727.gbf7dc18ff4-goog
maintainer Applied
#2 lore raw
In reply to Ian Rogers
Quoted 8 lines · Ian Rogers

With NO_LIBDW=1 a new unused-parameter warning/error has appeared:

```
util/genelf.c: In function ‘jit_write_elf’:
util/genelf.c:163:32: error: unused parameter ‘load_addr’ [-Werror=unused-parameter]
  163 | jit_write_elf(int fd, uint64_t load_addr, const char *sym,
```

[...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung