From 33dc46322744f08512be1382d48c4ac9a87285de Mon Sep 17 00:00:00 2001 From: Kostadin Shishmanov Date: Sun, 9 Mar 2025 17:31:51 +0200 Subject: [PATCH] games-util/mangohud: only add linker flag if lld is used Currently, the -Wl,--undefined-version linker flag gets added no matter what linker is used. Make it so it's only appended when lld is used, considering that's the only linker which has the symbol issue. Signed-off-by: Kostadin Shishmanov --- games-util/mangohud/mangohud-0.8.1.ebuild | 6 ++++-- games-util/mangohud/mangohud-9999.ebuild | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/games-util/mangohud/mangohud-0.8.1.ebuild b/games-util/mangohud/mangohud-0.8.1.ebuild index c191316b8d..b9aa50af02 100644 --- a/games-util/mangohud/mangohud-0.8.1.ebuild +++ b/games-util/mangohud/mangohud-0.8.1.ebuild @@ -5,7 +5,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{11..13} ) -inherit flag-o-matic python-single-r1 meson-multilib +inherit flag-o-matic python-single-r1 meson-multilib toolchain-funcs MY_PV=$(ver_cut 1-3) [[ -n "$(ver_cut 4)" ]] && MY_PV_REV="-$(ver_cut 4)" @@ -121,7 +121,9 @@ src_prepare() { multilib_src_configure() { # workaround for lld # https://github.com/flightlessmango/MangoHud/issues/1240 - append-ldflags $(test-flags-CCLD -Wl,--undefined-version) + if tc-ld-is-lld; then + append-ldflags -Wl,--undefined-version + fi local emesonargs=( -Dappend_libdir_mangohud=false diff --git a/games-util/mangohud/mangohud-9999.ebuild b/games-util/mangohud/mangohud-9999.ebuild index e10f4d2e21..d2c3380eac 100644 --- a/games-util/mangohud/mangohud-9999.ebuild +++ b/games-util/mangohud/mangohud-9999.ebuild @@ -5,7 +5,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{11..13} ) -inherit flag-o-matic python-single-r1 meson-multilib +inherit flag-o-matic python-single-r1 meson-multilib toolchain-funcs MY_PV=$(ver_cut 1-3) [[ -n "$(ver_cut 4)" ]] && MY_PV_REV="-$(ver_cut 4)" @@ -120,7 +120,9 @@ src_prepare() { multilib_src_configure() { # workaround for lld # https://github.com/flightlessmango/MangoHud/issues/1240 - append-ldflags $(test-flags-CCLD -Wl,--undefined-version) + if tc-ld-is-lld; then + append-ldflags -Wl,--undefined-version + fi local emesonargs=( -Dappend_libdir_mangohud=false