mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
sys-libs/glibc: refresh ld.so.cache if natively installing >=2.38 on loong
The 2.38 change is ~loong-only to avoid triggering rebuilds on other arches. Closes: https://github.com/gentoo/gentoo/pull/32470 Reviewed-by: Sam James <sam@gentoo.org> Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
This commit is contained in:
1707
sys-libs/glibc/glibc-2.38-r3.ebuild
Normal file
1707
sys-libs/glibc/glibc-2.38-r3.ebuild
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1638,6 +1638,21 @@ pkg_preinst() {
|
||||
fi
|
||||
}
|
||||
|
||||
glibc_refresh_ldconfig() {
|
||||
if [[ ${MERGE_TYPE} == buildonly ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Version check could be added to avoid unnecessary work, but ldconfig
|
||||
# should finish quickly enough to not matter.
|
||||
ebegin "Refreshing ld.so.cache"
|
||||
ldconfig -i
|
||||
if ! eend $?; then
|
||||
ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken"
|
||||
ewarn "before you manually do so (ldconfig -i)."
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# nothing to do if just installing headers
|
||||
just_headers && return
|
||||
@@ -1648,6 +1663,17 @@ pkg_postinst() {
|
||||
fi
|
||||
|
||||
if ! is_crosscompile && [[ -z ${ROOT} ]] ; then
|
||||
# glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags
|
||||
# handling has changed as well, which means stale ldconfig auxiliary
|
||||
# cache entries and failure to lookup libgcc_s / libstdc++ (breaking
|
||||
# every C++ application) / libgomp etc., among other breakages.
|
||||
#
|
||||
# To fix this, simply refresh the ld.so.cache without using the
|
||||
# auxiliary cache if we're natively installing on loong. This should
|
||||
# be done relatively soon because we want to minimize the breakage
|
||||
# window for the affected programs.
|
||||
use loong && glibc_refresh_ldconfig
|
||||
|
||||
use compile-locales || run_locale_gen "${EROOT}/"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user