Re: [PATCH v6 1/5] perf symbols: Fix broken ELF_C_READ_MMAP fallback guard

From: Namhyung Kim

Date: Wed Nov 04 2026 - 21:05:32 EST


On Wed, Oct 28, 2026 at 04:42:32PM -0700, Alireza Haghdoost wrote:
> Commit 22dd1ac91a77 ("tools: Remove feature-libelf-mmap feature
> detection") replaced perf's compile-time feature test with an #ifdef on
> ELF_C_READ_MMAP. ELF_C_READ_MMAP is an Elf_Cmd enumerator rather than a
> preprocessor macro, so the condition is always false and perf silently
> uses ELF_C_READ.
>
> Perf already requires a sufficiently recent elfutils version that
> provides ELF_C_READ_MMAP. Use the enumerator directly instead of
> restoring a feature probe or retaining an unreachable fallback.
>
> Fixes: 22dd1ac91a77 ("tools: Remove feature-libelf-mmap feature detection")
> Signed-off-by: Alireza Haghdoost <haghdoost@xxxxxxxx>
> Reviewed-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Applied to perf-tools-next, thanks!

Best regards
Namhyung