Diff glibc-2.37-r7 with a glibc-2.38-r5

/usr/portage/sys-libs/glibc/glibc-2.38-r5.ebuild 2023-10-09 14:52:35.548368503 +0300
6 6
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc
7 7
# Please read & adapt the page as necessary if obsolete.
8 8

  
9
PYTHON_COMPAT=( python3_{9..11} )
9
PYTHON_COMPAT=( python3_{9..12} )
10 10
TMPFILES_OPTIONAL=1
11 11

  
12 12
inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \
......
20 20
EMULTILIB_PKG="true"
21 21

  
22 22
# Gentoo patchset (ignored for live ebuilds)
23
PATCH_VER=10
23
PATCH_VER=5
24 24
PATCH_DEV=dilfridge
25 25

  
26 26
# gcc mulitilib bootstrap files version
......
39 39
if [[ ${PV} == 9999* ]]; then
40 40
	inherit git-r3
41 41
else
42
	KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
42
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
43 43
	SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
44 44
	SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
45 45
fi
......
447 447
	# https://sourceware.org/PR27837
448 448
	filter-ldflags '-Wl,--relax'
449 449

  
450
	# Flag added for cross-prefix, but causes ldconfig to segfault. Not needed
451
	# anyway because glibc already handles this by itself.
452
	filter-ldflags '-Wl,--dynamic-linker=*'
453

  
450 454
	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
451 455
	# we have to do that here already so mips can filter it out again :P
452 456
	if use hash-sysv-compat ; then
......
653 657
	export CXX="${glibc__GLIBC_CXX} ${glibc__abi_CFLAGS} ${CFLAGS}"
654 658

  
655 659
	if is_crosscompile; then
656
		# Assume worst-case bootstrap: glibc is buil first time
657
		# when ${CTARGET}-g++ is not available yet. We avoid
660
		# Assume worst-case bootstrap: glibc is built for the first time
661
		# with ${CTARGET}-g++ not available yet. We avoid
658 662
		# building auxiliary programs that require C++: bug #683074
659 663
		# It should not affect final result.
660 664
		export libc_cv_cxx_link_ok=no
......
1016 1020
	myconf+=(
1017 1021
		--disable-werror
1018 1022
		--enable-bind-now
1023
		--enable-fortify-source
1019 1024
		--build=${CBUILD_OPT:-${CBUILD}}
1020 1025
		--host=${CTARGET_OPT:-${CTARGET}}
1021 1026
		$(use_enable profile)
......
1047 1052
		# https://bugs.gentoo.org/753740
1048 1053
		libc_cv_complocaledir='${exec_prefix}/lib/locale'
1049 1054

  
1050
		# -march= option tricks build system to infer too
1051
		# high ISA level: https://sourceware.org/PR27318
1052
		libc_cv_include_x86_isa_level=no
1053

  
1054
		# Explicit override of https://sourceware.org/PR27991
1055
		# exposes a bug in glibc's configure:
1056
		# https://sourceware.org/PR27991
1057
		libc_cv_have_x86_lahf_sahf=no
1058
		libc_cv_have_x86_movbe=no
1055
		# On aarch64 there is no way to override -mcpu=native, and if
1056
		# the current cpu does not support SVE configure fails.
1057
		# Let's boldly assume our toolchain can always build SVE instructions.
1058
		libc_cv_aarch64_sve_asm=yes
1059 1059

  
1060 1060
		${EXTRA_ECONF}
1061 1061
	)
......
1095 1095
	# add x32 to it, gcc/glibc don't yet support x32.
1096 1096
	#
1097 1097
	if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then
1098
		echo 'main(){}' > "${T}"/test.c
1098
		echo 'int main(void){}' > "${T}"/test.c || die
1099 1099
		if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
1100 1100
			sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
1101 1101
		fi
......
1268 1268
	# we give the tests a bit more time to avoid spurious
1269 1269
	# bug reports on slow arches
1270 1270

  
1271
	SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check
1271
	SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=32 emake ${myxfailparams} check
1272 1272
}
1273 1273

  
1274 1274
src_test() {
......
1638 1638
	fi
1639 1639
}
1640 1640

  
1641
glibc_refresh_ldconfig() {
1642
	if [[ ${MERGE_TYPE} == buildonly ]]; then
1643
		return
1644
	fi
1645

  
1646
	# Version check could be added to avoid unnecessary work, but ldconfig
1647
	# should finish quickly enough to not matter.
1648
	ebegin "Refreshing ld.so.cache"
1649
	ldconfig -i
1650
	if ! eend $?; then
1651
		ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken"
1652
		ewarn "before you manually do so (ldconfig -i)."
1653
	fi
1654
}
1655

  
1641 1656
pkg_postinst() {
1642 1657
	# nothing to do if just installing headers
1643 1658
	just_headers && return
......
1648 1663
	fi
1649 1664

  
1650 1665
	if ! is_crosscompile && [[ -z ${ROOT} ]] ; then
1666
		# glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags
1667
		# handling has changed as well, which means stale ldconfig auxiliary
1668
		# cache entries and failure to lookup libgcc_s / libstdc++ (breaking
1669
		# every C++ application) / libgomp etc., among other breakages.
1670
		#
1671
		# To fix this, simply refresh the ld.so.cache without using the
1672
		# auxiliary cache if we're natively installing on loong. This should
1673
		# be done relatively soon because we want to minimize the breakage
1674
		# window for the affected programs.
1675
		use loong && glibc_refresh_ldconfig
1676

  
1651 1677
		use compile-locales || run_locale_gen "${EROOT}/"
1652 1678
	fi
1653 1679

  
Thank you!