tools features: Don't check for libunwind devel files by default
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 3 Dec 2024 20:52:33 +0000 (17:52 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Dec 2024 20:51:53 +0000 (17:51 -0300)
commit176c9d1e6a06f2fa62c1b9743369ab35c724d2c4
treef58ccb5f585826d7c1674847e992907271bef23c
parent40384c840ea1944d7c5a392e8975ed088ecf0b37
tools features: Don't check for libunwind devel files by default

Since 13e17c9ff49119aa ("perf build: Make libunwind opt-in rather than
opt-out"), so we shouldn't by default be testing for its availability at
build time in tools/build/features/test-all.c.

That test was designed to test the features we expect to be the most
common ones in most builds, so if we test build just that file, then we
assume the features there are present and will not test one by one.

Removing it from test-all.c gets rid of the first impediment for
test-all.c to build successfully:

  $ cat /tmp/build/perf-tools-next/feature/test-all.make.output
  In file included from test-all.c:62:
  test-libunwind.c:2:10: fatal error: libunwind.h: No such file or directory
      2 | #include <libunwind.h>
        |          ^~~~~~~~~~~~~
  compilation terminated.
  $

We then get to:

  $ cat /tmp/build/perf-tools-next/feature/test-all.make.output
  /usr/bin/ld: cannot find -lunwind-x86_64: No such file or directory
  /usr/bin/ld: cannot find -lunwind: No such file or directory
  collect2: error: ld returned 1 exit status
  $

So make all the logic related to setting CFLAGS, LDFLAGS, etc for
libunwind to be conditional on NO_LIBWUNWIND=1, which is now the
default, now we get a faster build:

  $ cat /tmp/build/perf-tools-next/feature/test-all.make.output
  $ ldd /tmp/build/perf-tools-next/feature/test-all.bin
   linux-vdso.so.1 (0x00007fef04cde000)
   libdw.so.1 => /lib64/libdw.so.1 (0x00007fef04a49000)
   libpython3.12.so.1.0 => /lib64/libpython3.12.so.1.0 (0x00007fef04478000)
   libm.so.6 => /lib64/libm.so.6 (0x00007fef04394000)
   libtraceevent.so.1 => /lib64/libtraceevent.so.1 (0x00007fef0436c000)
   libtracefs.so.1 => /lib64/libtracefs.so.1 (0x00007fef04345000)
   libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007fef03e95000)
   libz.so.1 => /lib64/libz.so.1 (0x00007fef03e72000)
   libelf.so.1 => /lib64/libelf.so.1 (0x00007fef03e56000)
   libnuma.so.1 => /lib64/libnuma.so.1 (0x00007fef03e48000)
   libslang.so.2 => /lib64/libslang.so.2 (0x00007fef03b65000)
   libperl.so.5.38 => /lib64/libperl.so.5.38 (0x00007fef037c6000)
   libc.so.6 => /lib64/libc.so.6 (0x00007fef035d5000)
   liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fef035a0000)
   libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fef034e1000)
   libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fef034cd000)
   /lib64/ld-linux-x86-64.so.2 (0x00007fef04ce0000)
   libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007fef03495000)
  $

Fixes: 13e17c9ff49119aa ("perf build: Make libunwind opt-in rather than opt-out")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/Z09zTztD8X8qIWCX@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/build/feature/test-all.c
tools/perf/Makefile.config