summaryrefslogtreecommitdiff
path: root/sys-libs
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/binutils-libs/Manifest4
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.35.1-r10.ebuild (renamed from sys-libs/binutils-libs/binutils-libs-2.34-r314.ebuild)9
-rw-r--r--sys-libs/glibc/Manifest6
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-gcc-10.patch15
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch32
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-compat.patch85
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-hide-pipe2.patch16
-rw-r--r--sys-libs/glibc/files/host.conf-124
-rw-r--r--sys-libs/glibc/files/nscd-185
-rw-r--r--sys-libs/glibc/glibc-2.32-r10.ebuild (renamed from sys-libs/glibc/glibc-2.30-r314.ebuild)192
10 files changed, 383 insertions, 85 deletions
diff --git a/sys-libs/binutils-libs/Manifest b/sys-libs/binutils-libs/Manifest
index 7cea1217..49d69a0b 100644
--- a/sys-libs/binutils-libs/Manifest
+++ b/sys-libs/binutils-libs/Manifest
@@ -1,2 +1,2 @@
-DIST binutils-2.34-patches-1.tar.xz 20388 BLAKE2B 8828505f62259a307de445357320827e7f6bc416a7f4c72140add505f62eef3928c7daec13be158b52c2a7a1d989f539025e4be6ec27ef80ede81477a42c5042 SHA512 951dffcc30ad5706dc48e71995217655c5d96472446ab66a357f19486b57d1868143a9809887eab7ba8c42c33124f8b37d3bab6618388ea8a08b4399d348a645
-DIST binutils-2.34.tar.xz 21637796 BLAKE2B 07dd23916a7d27f71c3f160c8c16abe2bd4fce294c738c665a012a3be6a87dbe8160d0c38740524f9025e01d438e99b2a94bcf9f9f79ee214f5dd033de8aad3d SHA512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd
+DIST binutils-2.35.1-patches-2.tar.xz 72236 BLAKE2B 584cb3edbda28c69171ed64e941535f992150d86f25201cadd07b63daaa36bf76b07dc0aa8a4837da17d1672feb47a7b15f83efdeec5409e695965a10142147a SHA512 b704ebe82c4402f058f9c96991a89256a6b369d28f844bf020ed2c77766894d9a2ca0596cd609de7b389fa8cd52bfab674b6deb10ea2096e50aa57921be2083e
+DIST binutils-2.35.1.tar.xz 22031720 BLAKE2B d3468da90b75e9b5fa7fbd64d3fdb0a4bc445e4cb7da5ae058f73a1e9d948b3e9438bc9f1b5b351db369b76a25960c9c1f58f828fd2c7646f555de45fa3c052b SHA512 94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb
diff --git a/sys-libs/binutils-libs/binutils-libs-2.34-r314.ebuild b/sys-libs/binutils-libs/binutils-libs-2.35.1-r10.ebuild
index c7a02375..2ea27567 100644
--- a/sys-libs/binutils-libs/binutils-libs-2.34-r314.ebuild
+++ b/sys-libs/binutils-libs/binutils-libs-2.35.1-r10.ebuild
@@ -3,8 +3,8 @@
EAPI=7
-PATCH_VER=1
-PATCH_DEV=slyfox
+PATCH_VER=2
+PATCH_DEV=dilfridge
inherit eutils libtool toolchain-funcs multilib-minimal
@@ -21,7 +21,7 @@ SRC_URI="mirror://gnu/binutils/${MY_P}.tar.xz
LICENSE="|| ( GPL-3 LGPL-3 )"
SLOT="0/${PV}"
IUSE="64-bit-bfd multitarget nls static-libs"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
BDEPEND="nls? ( sys-devel/gettext )"
DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
@@ -38,9 +38,6 @@ MULTILIB_WRAPPED_HEADERS=(
src_prepare() {
if [[ ! -z ${PATCH_VER} ]] ; then
- # Use upstream patch to enable development mode
- rm -v "${WORKDIR}/patch"/0000-Gentoo-Git-is-development.patch || die
-
einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
eapply "${WORKDIR}/patch"/*.patch
fi
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
index f1a1af01..d79185b0 100644
--- a/sys-libs/glibc/Manifest
+++ b/sys-libs/glibc/Manifest
@@ -1,3 +1,5 @@
+DIST backport-rv32.txz 26416 BLAKE2B 7a6b593859f88a3c040f06324dace4cc6137d14d4580fad9ea285829666d761c3dd01c190746e86846c219423124c77a55bc57b6e56efe6401a9c99d7fa445cd SHA512 d08dc02c4f0a3c5a15c57fbb5190588121c0e0728e6ab2119483407a98625efe58b3c83b44d750b0146171e63dcf8a6dbb6d1a057d042f794eed9adbd1f0293e
DIST gcc-multilib-bootstrap-20180511.tar.xz 2392908 BLAKE2B f3cf614399368acd8908f60d894c6344a2fa09383b30c1633a0682bc668367c8a2f8c6fec2d41b6e2178d709a2bd8db57e8b2ab56ba263c7d56f819c15acd061 SHA512 98c766e913693ab42ff790557acde2a36a8001e2648046a685b21964200df8d4d52d8452d499c0068c6648284d086ce062c2d36e2c6c2fd8aacd232d193f2853
-DIST glibc-2.30-patches-10.tar.xz 72808 BLAKE2B a7a95c99482524b2896d15539766f1e6b1fe34a22f32119248c6dd44f42632076e86fdcbbdc2d604ec73ceccdd8a7f5936a62a6f4c3d039fae8f6901dfc6be77 SHA512 af5e213ff08bf38f6f529816c36b4e38df27207c2df254609ebe45b2f039ab553bbe563aa6f64b6667d328fd2c120dc21b6e2676540bdd94e58079237089eac3
-DIST glibc-2.30.tar.xz 16576920 BLAKE2B bd5aae4c9854f40785b91f83c3b632de6d48d811027ddfe61651cb1bc617db8017d7914c23a770cdd3feed06fcc316da841eea916cdba54179e7eace4ea45484 SHA512 37483990cd653685873e96c45dd1651b32b441b6d7919a68ebe3bae31a0c3f7ce183fc9b110f0b268b353f80312f18370559a1e7aecea0e5aa755c8f2aef1d6b
+DIST glibc-2.32-patches-2.tar.xz 8588 BLAKE2B 57a85241e3270d14df0332b039a933c5a7ee4d089684d85cca564eeec2d6796735de60b628c5746858757342922d58993d6cf7187ce1d7102b2299ca2cf8513f SHA512 45bbab9e2f813f55cb4a1438dcd9365170b8facff50b11648ba6022da06c20029bb65a4b06fd906af82aa7461b7374f85105fd7eedb7915cec3f1df3779b68a3
+DIST glibc-2.32.tar.xz 16744512 BLAKE2B a56b4afbb35315c5cd6dca0f62e44455dceae3e6e88a8453621f9a5394a60ddf10ca9309b2db0911830c7fd77e3faa5d94694eb94d5b2c05fc5285cef52255da SHA512 8460c155b7003e04f18dabece4ed9ad77445fa2288a7dc08e80a8fc4c418828af29e0649951bd71a54ea2ad2d4da7570aafd9bdfe4a37e9951b772b442afe50b
+DIST locale-gen-2.10.tar.gz 7747 BLAKE2B 49f569c5ae5260fca128503bc6f22d6f6f1cda817920c41fdadadf1527bbb4f3eb161f79fa729830666a4673e9092f99f4685ec8fcac8ddea0b8242bca9c1f4f SHA512 e350e60d458d67638e3090711fca05af6fafac06c51b97648244549f8a0621dab7543f09dc7ad4c62392f13bdae8e5875dc6d0b6c3d83efc29d116bc2eef92db
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-gcc-10.patch b/sys-libs/glibc/files/2.19/glibc-2.19-gcc-10.patch
new file mode 100644
index 00000000..45e8ab80
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-gcc-10.patch
@@ -0,0 +1,15 @@
+Identify gcc-10+ as a good compiler.
+
+Index: work/glibc-2.19/configure
+===================================================================
+--- glibc-2.19/configure
++++ glibc-2.19/configure
+@@ -4710,7 +4710,7 @@ $as_echo_n "checking version of $CC... "
+ ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 4.[4-9].* | 4.[1-9][0-9].* | [5-9].* )
++ 4.[4-9].* | 4.[1-9][0-9].* | [5-9].* | [1-9][0-9].* )
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
new file mode 100644
index 00000000..72a616a0
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/503838
+http://gcc.gnu.org/PR60465
+https://sourceware.org/ml/libc-alpha/2015-12/msg00556.html
+https://trofi.github.io/posts/189-glibc-on-ia64-or-how-relocations-bootstrap.html
+
+newer versions of gcc generate relocations in the elf_get_dynamic_info func
+which glibc relies on to populate some info structs. those structs are then
+used by ldso to process relocations in itself. glibc requires that there are
+no relocations until that point (*after* elf_get_dynamic_info), so we end up
+crashing during elf_get_dynamic_info because the relocation has not yet been
+processed.
+
+this hack shuffles the code in a way that tricks gcc into not generating the
+relocation. we need to figure out something better for upstream.
+
+--- a/elf/get-dynamic-info.h
++++ b/elf/get-dynamic-info.h
+@@ -66,8 +66,12 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
+ info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+ + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
+ else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
+- info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+- + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
++ {
++ d_tag_utype i =
++ DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
++ + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM;
++ info[i] = dyn;
++ }
+ ++dyn;
+ }
+
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-compat.patch b/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-compat.patch
new file mode 100644
index 00000000..bf75f80c
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-compat.patch
@@ -0,0 +1,85 @@
+Remove newer symbols that does not work on linux-2.6.16.
+
+This is only for Prefix standalone.
+
+Index: glibc-2.19/io/sys/stat.h
+===================================================================
+--- glibc-2.19.orig/io/sys/stat.h
++++ glibc-2.19/io/sys/stat.h
+@@ -361,10 +361,6 @@ extern int mkfifoat (int __fd, const cha
+ #ifdef __USE_ATFILE
+ /* Set file access and modification times relative to directory file
+ descriptor. */
+-extern int utimensat (int __fd, const char *__path,
+- const struct timespec __times[2],
+- int __flags)
+- __THROW __nonnull ((2));
+ #endif
+
+ #ifdef __USE_XOPEN2K8
+Index: glibc-2.19/posix/unistd.h
+===================================================================
+--- glibc-2.19.orig/posix/unistd.h
++++ glibc-2.19/posix/unistd.h
+@@ -419,7 +419,6 @@ extern int pipe (int __pipedes[2]) __THR
+ #ifdef __USE_GNU
+ /* Same as pipe but apply flags passed in FLAGS to the new file
+ descriptors. */
+-extern int pipe2 (int __pipedes[2], int __flags) __THROW __wur;
+ #endif
+
+ /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM.
+Index: glibc-2.19/sysdeps/unix/sysv/linux/x86/bits/epoll.h
+===================================================================
+--- glibc-2.19.orig/sysdeps/unix/sysv/linux/x86/bits/epoll.h
++++ glibc-2.19/sysdeps/unix/sysv/linux/x86/bits/epoll.h
+@@ -19,11 +19,5 @@
+ # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
+ #endif
+
+-/* Flags to be passed to epoll_create1. */
+-enum
+- {
+- EPOLL_CLOEXEC = 02000000
+-#define EPOLL_CLOEXEC EPOLL_CLOEXEC
+- };
+
+ #define __EPOLL_PACKED __attribute__ ((__packed__))
+Index: glibc-2.19/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+===================================================================
+--- glibc-2.19.orig/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
++++ glibc-2.19/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+@@ -187,8 +187,6 @@
+ # define F_GETPIPE_SZ 1032 /* Set pipe page size array. */
+ #endif
+ #ifdef __USE_XOPEN2K8
+-# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
+- close-on-exit set. */
+ #endif
+
+ /* For F_[GET|SET]FD. */
+Index: glibc-2.19/sysdeps/unix/sysv/linux/sys/epoll.h
+===================================================================
+--- glibc-2.19.orig/sysdeps/unix/sysv/linux/sys/epoll.h
++++ glibc-2.19/sysdeps/unix/sysv/linux/sys/epoll.h
+@@ -101,7 +101,6 @@ extern int epoll_create (int __size) __T
+
+ /* Same as epoll_create but with an FLAGS parameter. The unused SIZE
+ parameter has been dropped. */
+-extern int epoll_create1 (int __flags) __THROW;
+
+
+ /* Manipulate an epoll instance "epfd". Returns 0 in case of success,
+Index: glibc-2.19/time/sys/time.h
+===================================================================
+--- glibc-2.19.orig/time/sys/time.h
++++ glibc-2.19/time/sys/time.h
+@@ -140,8 +140,6 @@ extern int utimes (const char *__file, c
+
+ #ifdef __USE_BSD
+ /* Same as `utimes', but does not follow symbolic links. */
+-extern int lutimes (const char *__file, const struct timeval __tvp[2])
+- __THROW __nonnull ((1));
+
+ /* Same as `utimes', but takes an open file descriptor instead of a name. */
+ extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-hide-pipe2.patch b/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-hide-pipe2.patch
new file mode 100644
index 00000000..2b9cccec
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-kernel-2.6.16-hide-pipe2.patch
@@ -0,0 +1,16 @@
+Remove the pipe2 symbol from libc.so, otherwise meson will pick it up.
+
+This is a balance. We decide not to strip all the O_CLOEXEC, otherwise
+gtk+ will need to be patched.
+Index: glibc-2.19/sysdeps/unix/make-syscalls.sh
+===================================================================
+--- glibc-2.19.orig/sysdeps/unix/make-syscalls.sh
++++ glibc-2.19/sysdeps/unix/make-syscalls.sh
+@@ -131,6 +131,7 @@ emit_weak_aliases()
+ echo " echo 'libc_hidden_def ($name)'; \\"
+ ;;
+ *)
++ [ $name = pipe2 ] && continue
+ echo " echo 'weak_alias ($strong, $name)'; \\"
+ echo " echo 'libc_hidden_weak ($name)'; \\"
+ ;;
diff --git a/sys-libs/glibc/files/host.conf-1 b/sys-libs/glibc/files/host.conf-1
new file mode 100644
index 00000000..4c58e52d
--- /dev/null
+++ b/sys-libs/glibc/files/host.conf-1
@@ -0,0 +1,24 @@
+# /etc/host.conf:
+# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/host.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $
+
+# The file /etc/host.conf contains configuration information specific to
+# the resolver library. It should contain one configuration keyword per
+# line, followed by appropriate configuration information. The keywords
+# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
+
+
+
+# This keyword specifies how host lookups are to be performed. It
+# should be followed by one or more lookup methods, separated by
+# commas. Valid methods are bind, hosts, and nis.
+#
+order hosts, bind
+
+
+# Valid values are on and off. If set to on, the resolv+ library
+# will return all valid addresses for a host that appears in the
+# /etc/hosts file, instead of only the first. This is off by
+# default, as it may cause a substantial performance loss at sites
+# with large hosts files.
+#
+multi off
diff --git a/sys-libs/glibc/files/nscd-1 b/sys-libs/glibc/files/nscd-1
new file mode 100644
index 00000000..f69c8e2e
--- /dev/null
+++ b/sys-libs/glibc/files/nscd-1
@@ -0,0 +1,85 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="The 'Name Service Cache Daemon' is a daemon that provides a cache"
+description="${description} for the most common name service requests"
+
+extra_started_commands="flush_all flush_hosts flush_group flush_passwd flush_netgroup flush_services"
+
+description_flush_all="Will invalidate hosts, group, passwd, netgroup and services cache"
+description_flush_hosts="Will invalidate hosts cache"
+description_flush_group="Will invalidate group cache"
+description_flush_passwd="Will invalidate passwd cache"
+description_flush_netgroup="Will invalidate netgroup cache"
+description_flush_services="Will invalidate services cache"
+
+pidfile="/run/nscd/nscd.pid"
+command="/usr/sbin/nscd"
+
+depend() {
+ use dns ldap net slapd logger
+}
+
+checkconfig() {
+ if [ ! -d /run/nscd ] ; then
+ checkpath -d -m 755 /run/nscd
+ fi
+
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /run/nscd)" != "755" ] ; then
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /run/nscd"
+ ewarn "chmod a+rw /run/nscd/socket"
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ fi
+
+ if grep -qs '^[[:space:]]*persistent\>' /etc/nscd.conf ; then
+ checkpath -d -m 700 /var/db/nscd
+ fi
+}
+
+_flush() {
+ local table=$1
+
+ ebegin "Flushing ${table} table"
+ ${command} --invalidate ${table}
+ eend $?
+}
+
+flush_all() {
+ local has_errors=0
+
+ ebegin "Flushing all caches"
+
+ local table=
+ for table in passwd group hosts netgroup services; do
+ ${command} --invalidate ${table}
+ [ $? -ne 0 ] && has_errors=1
+ done
+
+ eend ${has_errors}
+}
+
+flush_hosts() {
+ _flush hosts
+}
+
+flush_group() {
+ _flush group
+}
+
+flush_passwd() {
+ _flush passwd
+}
+
+flush_netgroup() {
+ _flush netgroup
+}
+
+flush_services() {
+ _flush services
+}
+
+start_pre() {
+ checkconfig
+}
diff --git a/sys-libs/glibc/glibc-2.30-r314.ebuild b/sys-libs/glibc/glibc-2.32-r10.ebuild
index ca347296..bbb7b0df 100644
--- a/sys-libs/glibc/glibc-2.30-r314.ebuild
+++ b/sys-libs/glibc/glibc-2.32-r10.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7,8,9} )
inherit python-any-r1 prefix eutils toolchain-funcs flag-o-matic gnuconfig \
multilib systemd multiprocessing
@@ -15,26 +15,29 @@ SLOT="2.2"
EMULTILIB_PKG="true"
+# Gentoo patchset (ignored for live ebuilds)
+PATCH_VER=2
+PATCH_DEV=dilfridge
+
if [[ ${PV} == 9999* ]]; then
- EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
inherit git-r3
else
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~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+=" riscv? ( https://dev.gentoo.org/~dilfridge/distfiles/backport-rv32.txz )"
fi
RELEASE_VER=${PV}
GCC_BOOTSTRAP_VER=20180511
-# Gentoo patchset
-PATCH_VER=10
-PATCH_DEV=dilfridge
+LOCALE_GEN_VER=2.10
-SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
+SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz"
SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
-IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib nscd profile selinux +ssp +static-libs suid systemtap test vanilla"
+IUSE="audit caps cet compile-locales +crypt custom-cflags doc gd headers-only +multiarch multilib nscd profile selinux +ssp +static-libs static-pie suid systemtap test vanilla"
# Minimum kernel version that glibc requires
MIN_KERN_VER="3.2.0"
@@ -84,12 +87,21 @@ fi
# We need a new-enough binutils/gcc to match upstream baseline.
# Also we need to make sure our binutils/gcc supports TLS,
# and that gcc already contains the hardened patches.
+# Lastly, let's avoid some openssh nastiness, bug 708224, as
+# convenience to our users.
+
+# gzip, grep, awk are needed by locale-gen, bug 740750
+
BDEPEND="
${PYTHON_DEPS}
>=app-misc/pax-utils-0.1.10
sys-devel/bison
- !<sys-devel/bison-2.7
doc? ( sys-apps/texinfo )
+ !compile-locales? (
+ app-arch/gzip
+ sys-apps/grep
+ virtual/awk
+ )
"
COMMON_DEPEND="
gd? ( media-libs/gd:2= )
@@ -100,11 +112,20 @@ COMMON_DEPEND="
suid? ( caps? ( sys-libs/libcap ) )
selinux? ( sys-libs/libselinux )
systemtap? ( dev-util/systemtap )
+ !<net-misc/openssh-8.1_p1-r2
"
DEPEND="${COMMON_DEPEND}
+ compile-locales? (
+ app-arch/gzip
+ sys-apps/grep
+ virtual/awk
+ )
test? ( >=net-dns/libidn2-2.3.0 )
"
RDEPEND="${COMMON_DEPEND}
+ app-arch/gzip
+ sys-apps/grep
+ virtual/awk
sys-apps/gentoo-functions
"
@@ -135,18 +156,18 @@ GENTOO_GLIBC_XFAIL_TESTS="${GENTOO_GLIBC_XFAIL_TESTS:-yes}"
# The following tests fail due to the Gentoo build system and are thus
# executed but ignored:
XFAIL_TEST_LIST=(
- # 1) Sandbox
- tst-ldconfig-bad-aux-cache
- tst-pldd
- tst-mallocfork2
- tst-nss-db-endgrent
- tst-nss-db-endpwent
- tst-nss-files-hosts-long
- tst-nss-test3
- # 2) Namespaces and cgroup
- tst-locale-locpath
# 9) Failures of unknown origin
tst-latepthread
+
+ # buggy test, assumes /dev/ and /dev/null on a single filesystem
+ # 'mount --bind /dev/null /chroot/dev/null' breaks it.
+ # https://sourceware.org/PR25909
+ tst-support_descriptors
+
+ # Flaky test, known to fail occasionally:
+ # https://sourceware.org/PR19329
+ # https://bugs.gentoo.org/719674#c12
+ tst-stack4
)
#
@@ -219,7 +240,8 @@ do_compile_test() {
rm -f glibc-test*
printf '%b' "$*" > glibc-test.c
- nonfatal emake glibc-test
+ # Most of the time CC is already set, but not in early sanity checks.
+ nonfatal emake glibc-test CC="${CC-$(tc-getCC ${CTARGET})}"
ret=$?
popd >/dev/null
@@ -296,6 +318,14 @@ setup_target_flags() {
# The mips abi cannot support the GNU style hashes. #233233
filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both
;;
+ ppc|ppc64)
+ # Many arch-specific implementations do not work on ppc with
+ # cache-block not equal to 128 bytes. This breaks memset:
+ # https://sourceware.org/PR26522
+ # https://bugs.gentoo.org/737996
+ # Use default -mcpu=. For ppc it means non-multiarch setup.
+ filter-flags '-mcpu=*'
+ ;;
sparc)
# Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though.
filter-flags "-fcall-used-g7"
@@ -503,27 +533,6 @@ glibc_banner() {
echo "${b}"
}
-check_devpts() {
- # Make sure devpts is mounted correctly for use w/out setuid pt_chown.
-
- # If merely building the binary package, then there's nothing to verify.
- [[ ${MERGE_TYPE} == "buildonly" ]] && return
-
- # Only sanity check when installing the native glibc.
- [[ -n ${ROOT} ]] && return
-
- # If they're opting in to the old suid code, then no need to check.
- use suid && return
-
- if awk '$3 == "devpts" && $4 ~ /[, ]gid=5[, ]/ { exit 1 }' /proc/mounts ; then
- eerror "In order to use glibc with USE=-suid, you must make sure that"
- eerror "you have devpts mounted at /dev/pts with the gid=5 option."
- eerror "Openrc should do this for you, so you should check /etc/fstab"
- eerror "and make sure you do not have any invalid settings there."
- die "mount & fix your /dev/pts settings"
- fi
-}
-
# The following Kernel version handling functions are mostly copied from portage
# source. It's better not to use linux-info.eclass here since a) it adds too
# much magic, see bug 326693 for some of the arguments, and b) some of the
@@ -593,9 +602,6 @@ get_kheader_version() {
# pkg_ and src_ phases, so we call this function both in pkg_pretend and in
# src_unpack.
sanity_prechecks() {
- # Make sure devpts is mounted correctly for use w/out setuid pt_chown
- check_devpts
-
# Prevent native builds from downgrading
if [[ ${MERGE_TYPE} != "buildonly" ]] && \
[[ -z ${ROOT} ]] && \
@@ -741,21 +747,44 @@ src_unpack() {
setup_env
- if [[ -n ${EGIT_REPO_URI} ]] ; then
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patches || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
+ EGIT_CHECKOUT_DIR=${S}
git-r3_src_unpack
else
unpack ${P}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
fi
cd "${WORKDIR}" || die
- unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz
+ unpack locale-gen-${LOCALE_GEN_VER}.tar.gz
+ use riscv && unpack backport-rv32.txz
}
src_prepare() {
+ local patchsetname
if ! use vanilla ; then
- elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER}"
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${RELEASE_VER}-${PATCH_VER}"
+ fi
+ elog "Applying Gentoo Glibc Patchset ${patchsetname}"
eapply "${WORKDIR}"/patches
einfo "Done."
+
+ if use riscv ; then
+ elog "Adding rv32 backport patchset for glibc-2.32 (experimental)"
+ eapply "${WORKDIR}"/backport-rv32
+ einfo "Done."
+ fi
fi
default
@@ -765,6 +794,10 @@ src_prepare() {
cd "${WORKDIR}"
find . -name configure -exec touch {} +
+ # move the external locale-gen to its old place
+ mkdir extra || die
+ mv locale-gen-${LOCALE_GEN_VER} extra/locale || die
+
eprefixify extra/locale/locale-gen
# Fix permissions on some of the scripts.
@@ -790,7 +823,7 @@ glibc_do_configure() {
fi
local v
- for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO ; do
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM READELF; do
einfo " $(printf '%15s' ${v}:) ${!v}"
done
@@ -819,6 +852,14 @@ glibc_do_configure() {
fi
einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
+ # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure
+ # can't detect them automatically due to ${CHOST} mismatch and fallbacks
+ # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup().
+ export NM="$(tc-getNM ${CTARGET})"
+ export READELF="$(tc-getREADELF ${CTARGET})"
+ einfo " $(printf '%15s' 'Manual NM:') ${NM}"
+ einfo " $(printf '%15s' 'Manual READELF:') ${READELF}"
+
echo
local myconf=()
@@ -914,8 +955,14 @@ 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)
+
+ # locale data is arch-independent
+ # https://bugs.gentoo.org/753740
+ libc_cv_complocaledir='${exec_prefix}/lib/locale'
+
${EXTRA_ECONF}
)
@@ -1116,7 +1163,10 @@ glibc_src_test() {
done
fi
- emake ${myxfailparams} check
+ # sandbox does not understand unshare() and prevents
+ # writes to /proc/, which makes many tests fail
+
+ SANDBOX_ON=0 LD_PRELOAD= emake ${myxfailparams} check
}
do_src_test() {
@@ -1158,8 +1208,10 @@ run_locale_gen() {
locale_list="${root}/usr/share/i18n/SUPPORTED"
fi
- locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \
+ set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --config "${locale_list}" \
--destdir "${root}"
+ echo "$@"
+ "$@"
popd >/dev/null
}
@@ -1220,6 +1272,8 @@ glibc_do_src_install() {
ppc /lib/ld.so.1
ppc64 /lib64/ld64.so.1
# riscv
+ ilp32d /lib/ld-linux-riscv32-ilp32d.so.1
+ ilp32 /lib/ld-linux-riscv32-ilp32.so.1
lp64d /lib/ld-linux-riscv64-lp64d.so.1
lp64 /lib/ld-linux-riscv64-lp64.so.1
# s390
@@ -1294,36 +1348,21 @@ glibc_do_src_install() {
insinto /etc
doins locale.gen
- # Make sure all the ABI's can find the locales and so we only
- # have to generate one set
- local a
- keepdir /usr/$(get_libdir)/locale
- for a in $(get_install_abis) ; do
- if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
- dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
- fi
- done
-
- # HACK: If we're building for riscv, we need to additionally make sure that
- # we can find the locale archive afterwards
- case ${CTARGET} in
- riscv*)
- if [[ ! -e ${ED}/usr/lib/locale ]] ; then
- dosym ../$(get_libdir)/locale /usr/lib/locale
- fi
- ;;
- *) ;;
- esac
+ keepdir /usr/lib/locale
cd "${S}"
# Install misc network config files
insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
- doins "${WORKDIR}"/extra/etc/*.conf
+ doins posix/gai.conf nss/nsswitch.conf
+
+ # Gentoo-specific
+ newins "${FILESDIR}"/host.conf-1 host.conf
if use nscd ; then
- doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+ doins nscd/nscd.conf
+
+ newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd
local nscd_args=(
-e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
@@ -1333,9 +1372,6 @@ glibc_do_src_install() {
systemd_dounit nscd/nscd.service
systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
- else
- # Do this since extra/etc/*.conf above might have nscd.conf.
- rm -f "${ED}"/etc/nscd.conf
fi
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
@@ -1439,6 +1475,12 @@ pkg_preinst() {
[[ -n ${ROOT} ]] && return 0
[[ -d ${ED}/$(get_libdir) ]] || return 0
[[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+
+ if [[ -L ${EROOT}/usr/lib/locale ]]; then
+ # Help portage migrate this to a directory
+ # https://bugs.gentoo.org/753740
+ rm "${EROOT}"/usr/lib/locale || die
+ fi
}
pkg_postinst() {