toolchain.eclass: workaround Go build failure if libruntime.so exists

Workaround a build failure in libgo if libruntime.so exists (which
dev-cpp/fbthrift provides).

This could be refined to only be done if the current slot lacks
USE=go, as it's only needed for the initial install of a slot.

Bug: https://gcc.gnu.org/PR121877
Closes: https://bugs.gentoo.org/972774
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2026-04-26 20:14:02 +01:00
parent 80e2178526
commit aca68afea6
+6
View File
@@ -1176,6 +1176,12 @@ toolchain_src_configure() {
export ac_cv_std_swap_in_utility=no
fi
if is_go && [[ -f "${ESYSROOT}/usr/$(get_libdir)/libruntime.so" ]] ; then
# https://gcc.gnu.org/PR121877 (bug #972774)
export lt_cv_prog_compiler_c_o_GO=yes
export lt_cv_prog_compiler_pic_works_GO=yes
fi
local flag
for flag in $(all-flag-vars) ; do
[[ -n ${!flag} ]] && einfo "${flag}=\"${!flag}\""