`kernel-tools` is currently built without `cxa-demangle`. This *should* just require adding BRs on gcc-c++ and libstdc++-devel, but somehow the way `perf` is built in the spec, this feature never gets detected (add VF=1 to see more features than in the current build log), while if I drop into a mock shell and run `make VF=1 -f Makefile.perf -C tools/perf fixdep` it is picked up. Seems like some of the extra settings passed or the environment variables set made this fail, but I'm not sure which. `cplus-demangle` is also off - likely for the same reason - despite `HAVE_CPLUS_DEMANGLE=1` being set. Looking at Makefile.config that is not supposed to work anyway, looks like CPLUS_DEMANGLE is only ever configured if DISTRO_BUILD is off. (Also, some of the other parameters passed like NO_GTK2 seem to not be necessary as well - I was trying to remove as much arguments as possible to see if I can get cxa-demangle to work, and to my surprise removing this and NO_BIONIC has no effect - the feature detection still kept them off). Reproducible: Always Steps to Reproduce: 1. Rebuild kernel-tools 2. Search for 'demangle:' in the feature detection 3. Search for util/demangle-cxx.cpp in the log Actual Results: cxa-demangle is OFF. cplus-demangle is also OFF despite HAVE_CPLUS_DEMANGLE being set, which apparently has not worked for a while Expected Results: cxa-demangle should be ON, and demangle-cxx.cpp should be compiled.
The issue seems to be that the building of test-cxa-demangle.cpp fails with "relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE" Adding EXTRA_CXXFLAGS="${CXXFLAGS}" to perf make parameters would fix the issue: diff --git a/kernel-tools.spec b/kernel-tools.spec index 3fae77e..a30bdeb 100644 --- a/kernel-tools.spec +++ b/kernel-tools.spec @@ -251,7 +251,7 @@ cd linux-%{kversion} %endif %global perf_make \ - make %{?make_opts} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" %{?cross_opts} -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBBPF_DYNAMIC=1 LIBTRACEEVENT_DYNAMIC=1 %{?perf_build_extra_opts} prefix=%{_prefix} PYTHON=%{__python3} + make %{?make_opts} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_CXXFLAGS="${CXXFLAGS}" LDFLAGS="%{__global_ldflags}" %{?cross_opts} -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBBPF_DYNAMIC=1 LIBTRACEEVENT_DYNAMIC=1 %{?perf_build_extra_opts} prefix=%{_prefix} PYTHON=%{__python3} NO_LIBPERL=1 # perf # make sure check-headers.sh is executable chmod +x tools/perf/check-headers.sh
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle. Changing version to 40.
Reassigning to the kernel component since kernel-tools is no more. I tried getting this enabled in kernel-tools, but the build system is so janky - hopefully it's easier now that we're building the tools the way upstream intends (though building as part of the kernel is slow, sigh). I'll see if I can produce a build that works and then submit a PR
Not sure this is right, but from what I could tell, the build command was using `HAVE_CPLUS_DEMANGLE` but the sources/Makefile referenced `HAVE_CPLUS_DEMANGLE_SUPPORT` -- I wonder if it's as simple as fixing that? ``` kernel-tools.spec: make %{?make_opts} EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" %{?cross_opts} -C tools/perf V=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 LIBTRACEEVENT_DYNAMIC=1 %{?perf_build_extra_opts} prefix=%{_prefix} PYTHON=%{__python3} linux-6.4/tools/perf/util/symbol-elf.c:#if defined(HAVE_LIBBFD_SUPPORT) || defined(HAVE_CPLUS_DEMANGLE_SUPPORT) linux-6.4/tools/perf/util/symbol-elf.c:#elif defined(HAVE_CPLUS_DEMANGLE_SUPPORT) linux-6.4/tools/perf/Makefile.config: CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT linux-6.4/tools/perf/Makefile.config: CXXFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT linux-6.4/tools/perf/util/demangle-cxx.cpp:#if defined(HAVE_LIBBFD_SUPPORT) || defined(HAVE_CPLUS_DEMANGLE_SUPPORT) linux-6.4/tools/perf/util/demangle-cxx.cpp:#elif defined(HAVE_CPLUS_DEMANGLE_SUPPORT) ```