commit:     4ef45fcf6e98371d3daab6f48472812ed932e89d
Author:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  5 10:09:34 2025 +0000
Commit:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
CommitDate: Sat Apr  5 10:30:47 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ef45fcf

dev-util/perf: fix build failure with LTO

Closes: https://bugs.gentoo.org/951151
Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>

 dev-util/perf/files/perf-6.14-lto.patch | 17 +++++++++++++++++
 dev-util/perf/perf-6.14.ebuild          |  1 +
 2 files changed, 18 insertions(+)

diff --git a/dev-util/perf/files/perf-6.14-lto.patch 
b/dev-util/perf/files/perf-6.14-lto.patch
new file mode 100644
index 000000000000..e5e54fd00b22
--- /dev/null
+++ b/dev-util/perf/files/perf-6.14-lto.patch
@@ -0,0 +1,17 @@
+
+Adapted to v6.14 from patch submitted upstream:
+https://lore.kernel.org/all/[email protected]/
+
+Bug: https://bugs.gentoo.org/951151
+
+--- a/tools/perf/Makefile.config
++++ b/tools/perf/Makefile.config
+@@ -820,7 +820,7 @@ else
+   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
+   PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
+   PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
+-  PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, 
$(PERL_EMBED_CCOPTS))
++  PERL_EMBED_CCOPTS := $(filter-out -flto=% -ffat-lto-objects, 
$(PERL_EMBED_CCOPTS))
+   PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
+   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
+

diff --git a/dev-util/perf/perf-6.14.ebuild b/dev-util/perf/perf-6.14.ebuild
index 853641e48508..99e4b1b918ce 100644
--- a/dev-util/perf/perf-6.14.ebuild
+++ b/dev-util/perf/perf-6.14.ebuild
@@ -185,6 +185,7 @@ src_prepare() {
 
        pushd "${S_K}" >/dev/null || die
        # Gentoo patches go here
+               eapply "${FILESDIR}"/${P}-lto.patch
        popd || die
 
        # Drop some upstream too-developer-oriented flags and fix the

Reply via email to