Bug 2256856
| Summary: | Please build perf with cxa-demangle enabled to support demangling C++ symbols | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Michel Lind <michel> |
| Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | acaringi, adscvr, airlied, alciregi, andrewjcg, bskeggs, hdegoede, hpa, jarod, jforbes, josef, jwboyer, kernel-maint, linville, masami256, mchehab, pbrobinson, ptalbert, steved, vheikkin |
| Target Milestone: | --- | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Michel Lind
2024-01-04 21:07:07 UTC
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)
```
|