Merge pull request #2222 from flatcar/krnowak/glibc-2.35

sys-libs/glibc: Update to 2.35
This commit is contained in:
Krzesimir Nowak 2022-11-03 09:06:43 +01:00 committed by GitHub
commit ca3c8d2742
3 changed files with 53 additions and 57 deletions

View File

@ -0,0 +1 @@
- glibc ([2.35](https://savannah.gnu.org/forum/forum.php?forum_id=10111))

View File

@ -1,5 +1,5 @@
DIST gcc-multilib-bootstrap-20201208.tar.xz 5528452 BLAKE2B 16699a6e4df5b2f28a21776ae9e3728b26a9ea251f5580aa5349545ad7c9f6145b9cb6a12ca8f5f96b9cb2a3c70b7e66ca702e4c6f083ac00408e0a20a69e613 SHA512 a243f505e17d0a7e144e8713c077582412f61d6cf7f79baa846de4fb77f5e0f27e11c9a785e14624e04ac52287b32164e7995323aa11caef59113ac438254347
DIST glibc-2.34-patches-17.tar.xz 241584 BLAKE2B e4eea130c331f64ba66e14a6ba318853141ee3e41b455cb45b8fdb702cae071dd307229dafcfcafcc41e5a56982f52c87e31d95295f824f1a2ae689a7e0f5b49 SHA512 c6a51b373be3986e1ad753541ccf73f29515b5df0f80e0450b26bed37e8c505e22e8f13e89554347e551819c8d89d30f306464e5d25cafa4a12400c112578dca
DIST glibc-2.34.tar.xz 17301232 BLAKE2B 874031192f2f5a3b35c3f5b044a467d4be4e67e8593e070e5b49b901ce8ea6bde2f8d2f6c92fa33b3f61eb723572a9e5f2b45e56064168df80a96d3fdb6fa30c SHA512 15252affd9ef4523a8001db16d497f4fdcb3ddf4cde7fe80e075df0bd3cc6524dc29fbe20229dbf5f97af580556e6b1fac0de321a5fe25322bc3e72f93beb624
DIST glibc-2.35-patches-9.tar.xz 183612 BLAKE2B 921664953ed39560ab850754209dbda1f71fbcc5bcc9ec21c187385ea659b90ea055e60961eca266ab3cc81213ed04747aa925dd96a352676fa19d2e63306968 SHA512 24c9ecb6ad890c95bc0e7db3e0c1f20768c728ac0590450fad05aed578623bc33d256d2c4d14a8d8e5c5e9fed7acfab3683053d236f51886cd5a6de93f925ddc
DIST glibc-2.35.tar.xz 18165952 BLAKE2B 623c728884f070cd87ffeb9203f74206197c52405ac9bc44f3dd519a3468b8e8ae2536c883e5d17d94417dbd1e91775de2e674314e4ff7424f9720026d6b7063 SHA512 e7336ce27561be5d7c217832a1136fb327e057bd8d3f92925b35c97e3e9f9e486948b5a1e03e5e4090772ef06437a074d10b82e68f17f1ad8f22077ee39e1b66
DIST glibc-systemd-20210729.tar.gz 1480 BLAKE2B 37722c7579df782d890e44dbab99c3de52ab466eb9de80d82405e9bb5620bf39ffc8c5f466a435bdb86ef6d36dd7019c0736573916bda6c67d02a2581e0ec979 SHA512 efd75af58b50522c28cdac7abd1fc56555bc1bb042512c90d8340c1ec09c5791b3872a305bf83723252bbde5855b75d958c041083457765c4cfd170732d09238
DIST locale-gen-2.22.tar.gz 7971 BLAKE2B 2dc66fa69bf51799d0c34459b654fba6998b80a7e322e9b670036c967e269ad921f50195e6e34c4a83c1f0bad191fd5aa3f37defb82271b73acbca07b7e49d08 SHA512 9798b10dbbc792345a7b7a121dec5f4bba9839a8aec010f01a09f3402fd5bf2376f79e03a6a19bc357010db780037a8811c381136ce19be1f1370374906dff38

View File

@ -6,7 +6,7 @@ EAPI=7
# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc
# Please read & adapt the page as necessary if obsolete.
PYTHON_COMPAT=( python3_{8..10} )
PYTHON_COMPAT=( python3_{8..11} )
TMPFILES_OPTIONAL=1
inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \
@ -20,15 +20,16 @@ SLOT="2.2"
EMULTILIB_PKG="true"
# Gentoo patchset (ignored for live ebuilds)
PATCH_VER=17
PATCH_VER=9
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
inherit git-r3
else
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
SRC_URI+=" experimental-loong? ( https://dev.gentoo.org/~xen0n/distfiles/glibc-2.35-loongarch-patches-20220522.tar.xz )"
fi
RELEASE_VER=${PV}
@ -43,7 +44,7 @@ SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${L
SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )"
IUSE="audit caps cet +clone3 compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp +static-libs static-pie suid systemd systemtap test vanilla"
IUSE="audit caps cet +clone3 compile-locales +crypt custom-cflags doc experimental-loong gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla"
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
@ -144,13 +145,13 @@ RESTRICT="!test? ( test )"
if [[ ${CATEGORY} == cross-* ]] ; then
BDEPEND+=" !headers-only? (
>=${CATEGORY}/binutils-2.27
>=${CATEGORY}/gcc-6
>=${CATEGORY}/gcc-6.2
)"
[[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
else
BDEPEND+="
>=sys-devel/binutils-2.27
>=sys-devel/gcc-6
>=sys-devel/gcc-6.2
"
DEPEND+=" virtual/os-headers "
RDEPEND+="
@ -248,8 +249,8 @@ do_compile_test() {
rm -f glibc-test*
printf '%b' "$*" > glibc-test.c
# Most of the time CC is already set, but not in early sanity checks.
nonfatal emake glibc-test CC="${CC-$(tc-getCC ${CTARGET})}"
# We assume CC is already set up.
nonfatal emake glibc-test
ret=$?
popd >/dev/null
@ -304,30 +305,33 @@ setup_target_flags() {
export CFLAGS="-march=${t} ${CFLAGS}"
einfo "Auto adding -march=${t} to CFLAGS #185404"
fi
# For compatibility with older binaries at slight performance cost.
use stack-realign && export CFLAGS+=" -mstackrealign"
;;
amd64)
# -march needed for #185404 #199334
# TODO: See cross-compile issues listed above for x86.
[[ ${ABI} == x86 ]] &&
if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then
local t=${CTARGET_OPT:-${CTARGET}}
t=${t%%-*}
# Normally the target is x86_64-xxx, so turn that into the -march that
# gcc actually accepts. #528708
[[ ${t} == "x86_64" ]] && t="x86-64"
filter-flags '-march=*'
# ugly, ugly, ugly. ugly.
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
fi
if [[ ${ABI} == x86 ]]; then
if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then
local t=${CTARGET_OPT:-${CTARGET}}
t=${t%%-*}
# Normally the target is x86_64-xxx, so turn that into the -march that
# gcc actually accepts. #528708
[[ ${t} == "x86_64" ]] && t="x86-64"
filter-flags '-march=*'
# ugly, ugly, ugly. ugly.
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
fi
# For compatibility with older binaries at slight performance cost.
use stack-realign && export CFLAGS_x86+=" -mstackrealign"
# Workaround for https://bugs.gentoo.org/823780. This really should
# be removed when the upstream bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275
# is fixed in our tree, either via 11.3 or an 11.2p2 patch set.
if [[ ${ABI} == x86 ]] && tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)); then
export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f"
einfo "Auto adding -mno-avx512f to CFLAGS_x86 (bug #823780) (ABI=${ABI})"
# Workaround for bug #823780.
if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then
export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f"
einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})"
fi
fi
;;
mips)
@ -533,6 +537,7 @@ setup_env() {
einfo "Overriding clang configuration, since it won't work here"
export CC="${current_gcc_path}/gcc"
export CPP="${current_gcc_path}/cpp"
export CXX="${current_gcc_path}/g++"
export LD="${current_binutils_path}/ld.bfd"
export AR="${current_binutils_path}/ar"
@ -744,7 +749,7 @@ sanity_prechecks() {
ebegin "Checking that IA32 emulation is enabled in the running kernel"
echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c"
local STAT
if "${CC-${CHOST}-gcc}" ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then
if ${CC-${CHOST}-gcc} ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then
"${T}/check-ia32-emulation.elf32"
STAT=$?
else
@ -818,12 +823,7 @@ upgrade_warning() {
# pkg_pretend
# Flatcar: Skip sanity checks at pretend time because we don't ship a compiler
# in the OS image. This test fails when installing the glibc binpkg and no
# compiler is present.
pkg_pretend() {
einfo "Flatcar: Skipping sanity_prechecks for binpkg installation. src_unpack will take care of compile-time prechecks."
# sanity_prechecks
upgrade_warning
}
@ -835,13 +835,13 @@ pkg_setup() {
# src_unpack
src_unpack() {
# Consistency is not guaranteed between pkg_ and src_ ...
setup_env
einfo "Checking general environment sanity."
sanity_prechecks
use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz
setup_env
if [[ ${PV} == 9999* ]] ; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git"
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
@ -856,6 +856,7 @@ src_unpack() {
cd "${WORKDIR}" || die
unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
use experimental-loong && unpack glibc-2.35-loongarch-patches-20220522.tar.xz
fi
cd "${WORKDIR}" || die
@ -874,6 +875,12 @@ src_prepare() {
einfo "Applying Gentoo Glibc Patchset ${patchsetname}"
eapply "${WORKDIR}"/patches
einfo "Done."
if use experimental-loong ; then
einfo "Applying experimental LoongArch patchset"
eapply "${WORKDIR}"/loongarch-2.35
einfo "Done."
fi
fi
if use clone3 ; then
@ -913,21 +920,9 @@ glibc_do_configure() {
echo
local myconf=()
case ${CTARGET} in
m68k*)
# setjmp() is not compatible with stack protection:
# https://sourceware.org/PR24202
myconf+=( --enable-stack-protector=no )
;;
*)
# Use '=strong' instead of '=all' to protect only functions
# worth protecting from stack smashes.
# '=all' is also known to have a problem in IFUNC resolution
# tests: https://sourceware.org/PR25680, bug #712356.
myconf+=( --enable-stack-protector=$(usex ssp strong no) )
;;
esac
myconf+=( --enable-stackguard-randomization )
# Use '=strong' instead of '=all' to protect only functions
# worth protecting from stack smashes.
myconf+=( --enable-stack-protector=$(usex ssp strong no) )
# Keep a whitelist of targets supporing IFUNC. glibc's ./configure
# is not robust enough to detect proper support:
@ -977,7 +972,6 @@ glibc_do_configure() {
fi
myconf+=(
--without-cvs
--disable-werror
--enable-bind-now
--build=${CBUILD_OPT:-${CBUILD}}
@ -996,7 +990,6 @@ glibc_do_configure() {
--with-pkgversion="$(glibc_banner)"
$(use_enable crypt)
$(use_multiarch || echo --disable-multi-arch)
$(use_enable static-pie)
$(use_enable systemtap)
$(use_enable nscd)
@ -1144,7 +1137,6 @@ glibc_headers_configure() {
myconf+=(
--disable-sanity-checks
--enable-hacker-mode
--without-cvs
--disable-werror
--enable-bind-now
--build=${CBUILD_OPT:-${CBUILD}}
@ -1212,7 +1204,10 @@ glibc_src_test() {
# sandbox does not understand unshare() and prevents
# writes to /proc/, which makes many tests fail
SANDBOX_ON=0 LD_PRELOAD= emake ${myxfailparams} check
# we give the tests a bit more time to avoid spurious
# bug reports on slow arches
SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check
}
do_src_test() {