Re: [PATCH 1/1] tools build: Don't set libunwind as available if test-all.c build succeeds

From: Ingo Molnar
Date: Sun Apr 06 2025 - 13:36:59 EST



* Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:

> The tools/build/feature/test-all.c file tries to detect the expected,
> most common set of libraries/features we expect to have available to
> build perf with.
>
> At some point libunwind was deemed not to be part of that set of
> libraries, but the patches making it to be opt-in ended up forgetting
> some details, fix one more.
>
> Testing it:
>
> $ rm -rf /tmp/build/$(basename $PWD)/ ; mkdir -p /tmp/build/$(basename $PWD)/
> $ rpm -q libunwind-devel
> libunwind-devel-1.8.0-3.fc40.x86_64
> $ make -k LIBUNWIND=1 CORESIGHT=1 O=/tmp/build/$(basename $PWD)/ -C tools/perf install-bin |& grep unwind && ldd ~/bin/perf | grep unwind
> ... libunwind: [ on ]
> CC /tmp/build/perf-tools-next/arch/x86/tests/dwarf-unwind.o
> CC /tmp/build/perf-tools-next/arch/x86/util/unwind-libunwind.o
> CC /tmp/build/perf-tools-next/util/arm64-frame-pointer-unwind-support.o
> CC /tmp/build/perf-tools-next/tests/dwarf-unwind.o
> CC /tmp/build/perf-tools-next/util/unwind-libunwind-local.o
> CC /tmp/build/perf-tools-next/util/unwind-libunwind.o
> libunwind-x86_64.so.8 => /lib64/libunwind-x86_64.so.8 (0x00007f615a549000)
> libunwind.so.8 => /lib64/libunwind.so.8 (0x00007f615a52f000)
> $ sudo rpm -e libunwind-devel
> $ rm -rf /tmp/build/$(basename $PWD)/ ; mkdir -p /tmp/build/$(basename $PWD)/
> $ make -k LIBUNWIND=1 CORESIGHT=1 O=/tmp/build/$(basename $PWD)/ -C tools/perf install-bin |& grep unwind && ldd ~/bin/perf | grep unwind
> Makefile.config:653: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
> ... libunwind: [ OFF ]
> CC /tmp/build/perf-tools-next/arch/x86/tests/dwarf-unwind.o
> CC /tmp/build/perf-tools-next/arch/x86/util/unwind-libdw.o
> CC /tmp/build/perf-tools-next/util/arm64-frame-pointer-unwind-support.o
> CC /tmp/build/perf-tools-next/tests/dwarf-unwind.o
> CC /tmp/build/perf-tools-next/util/unwind-libdw.o
> $

So I'm not sure whether this is related to my libunwind-OFF build
message bugreport, but in case it is, with this patch applied I still
get this message both before and after applying the patch:

... libunwind: [ OFF ]

Note: I did not add any LIBUNWIND parameters to the build, it's a
standard 'make clean install' perf build:

$ make clean install
...
BUILD: Doing 'make -j128' parallel build
...
... libunwind: [ OFF ]
...

All other feature messages indicate '[ on ]'.

It's on a fairly standard x86-64 Ubuntu 24.10 installation, with
various development libraries installed. Let me know if you need
any debug output or other information!

Thanks,

Ingo