summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro_gentoo@matoro.tk>2024-01-04 22:46:54 -0500
committerSam James <sam@gentoo.org>2024-01-05 05:29:57 +0000
commit4cdc03559b16a0a303ebf5634487d93bf91d0298 (patch)
tree39b81238784c4e3452617bc0c12b2f06617e7c2d /dev-util/perf
parentmedia-sound/fluidsynth: Stabilize 2.3.4 ppc64, #921338 (diff)
downloadgentoo-4cdc03559b16a0a303ebf5634487d93bf91d0298.tar.gz
gentoo-4cdc03559b16a0a303ebf5634487d93bf91d0298.tar.bz2
gentoo-4cdc03559b16a0a303ebf5634487d93bf91d0298.zip
dev-util/perf: explicitly specify linker emulation for mips
perf directly invokes LD for linking rather than going through CC, which on mips requires explicitly specifying the emulation. This is a port of the below buildroot patch. See: https://patchwork.ozlabs.org/project/buildroot/patch/20170217105905.32151-1-Vincent.Riera@imgtec.com/ Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/gentoo/pull/34648 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/perf')
-rw-r--r--dev-util/perf/perf-6.6.ebuild24
1 files changed, 21 insertions, 3 deletions
diff --git a/dev-util/perf/perf-6.6.ebuild b/dev-util/perf/perf-6.6.ebuild
index 5f93ba5de347..206b06714a2f 100644
--- a/dev-util/perf/perf-6.6.ebuild
+++ b/dev-util/perf/perf-6.6.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -31,7 +31,7 @@ SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
-IUSE="audit babeltrace bpf caps crypt debug +doc gtk java libpfm +libtraceevent +libtracefs lzma numa perl python slang systemtap tcmalloc unwind zstd"
+IUSE="abi_mips_o32 abi_mips_n32 abi_mips_n64 audit babeltrace big-endian bpf caps crypt debug +doc gtk java libpfm +libtraceevent +libtracefs lzma numa perl python slang systemtap tcmalloc unwind zstd"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
@@ -223,11 +223,29 @@ perf_make() {
disable_libdw=1
fi
+ # perf directly invokes LD for linking without going through CC, on mips
+ # it is required to specify the emulation. port of below buildroot patch
+ # https://patchwork.ozlabs.org/project/buildroot/patch/20170217105905.32151-1-Vincent.Riera@imgtec.com/
+ local linker="$(tc-getLD)"
+ if use mips
+ then
+ if use big-endian
+ then
+ use abi_mips_n64 && linker+=" -m elf64btsmip"
+ use abi_mips_n32 && linker+=" -m elf32btsmipn32"
+ use abi_mips_o32 && linker+=" -m elf32btsmip"
+ else
+ use abi_mips_n64 && linker+=" -m elf64ltsmip"
+ use abi_mips_n32 && linker+=" -m elf32ltsmipn32"
+ use abi_mips_o32 && linker+=" -m elf32ltsmip"
+ fi
+ fi
+
# FIXME: NO_CORESIGHT
local emakeargs=(
V=1 VF=1
HOSTCC="$(tc-getBUILD_CC)" HOSTLD="$(tc-getBUILD_LD)"
- CC="$(tc-getCC)" CXX="$(tc-getCXX)" AR="$(tc-getAR)" LD="$(tc-getLD)" NM="$(tc-getNM)"
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" AR="$(tc-getAR)" LD="${linker}" NM="$(tc-getNM)"
PKG_CONFIG="$(tc-getPKG_CONFIG)"
prefix="${EPREFIX}/usr" bindir_relative="bin"
tipdir="share/doc/${PF}"