* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2020-05-13 8:52 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2020-05-13 8:52 UTC (permalink / raw
To: gentoo-commits
commit: 5cf00cd5c6760d2c32640fe4e1e329c1808a0ae8
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed May 13 08:51:31 2020 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed May 13 08:51:56 2020 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=5cf00cd5
Drop sandbox-specific fixes; consolidate patches
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
... => 0001-Disable-ldconfig-during-install.patch} | 6 +-
...entoo-support-running-tests-under-sandbox.patch | 67 ----------
...ps-posix-getaddrinfo.c-gaih_inet-Only-us.patch} | 24 +++-
...dapt-to-Gentoo-specific-etc-mail-aliases.patch} | 33 ++++-
...-locale.patch => 0004-Add-C.UTF-8-locale.patch} | 4 +-
...0-in-conform-tests-to-survive-CC-changes.patch} | 5 +-
...o-disable-tests-that-fail-only-in-sandbox.patch | 144 ---------------------
...ble-test-that-fails-because-of-the-gethos.patch | 25 ----
...Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 32 -----
9 files changed, 51 insertions(+), 289 deletions(-)
diff --git a/9999/0001-Gentoo-disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
similarity index 83%
rename from 9999/0001-Gentoo-disable-ldconfig-during-install.patch
rename to 9999/0001-Disable-ldconfig-during-install.patch
index c5595aa..0dbdd9a 100644
--- a/9999/0001-Gentoo-disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From c42be799cdc293c6f454e26124f30f87d9bb69a9 Mon Sep 17 00:00:00 2001
+From 8831dc046682b2f3fca8a0dc831e53afdebd4469 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Wed, 1 Apr 2009 02:15:48 -0400
-Subject: [PATCH 01/12] Gentoo: disable ldconfig during install
+Subject: [PATCH 1/5] Disable ldconfig during install
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -15,7 +15,7 @@ https://bugs.gentoo.org/431038
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index 8f0a93aceb..7c3887d5c4 100644
+index 6dcfe40c25..68259babda 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,7 @@ install-symbolic-link: subdir_install
diff --git a/9999/0002-Gentoo-support-running-tests-under-sandbox.patch b/9999/0002-Gentoo-support-running-tests-under-sandbox.patch
deleted file mode 100644
index 1bc7be2..0000000
--- a/9999/0002-Gentoo-support-running-tests-under-sandbox.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From a4ec232302f8b30f6fc7eb7a53aadf99b3fad312 Mon Sep 17 00:00:00 2001
-From: "Stephanie J. Lockwood-Childs" <wormo@gentoo.org>
-Date: Tue, 13 Mar 2007 01:57:21 -0400
-Subject: [PATCH 02/12] Gentoo: support running tests under sandbox
-
-when glibc runs its tests, it does so by invoking the local library loader.
-in Gentoo, we build/run inside of our "sandbox" which itself is linked against
-libdl (so that it can load libraries and pull out symbols). the trouble
-is that when you upgrade from an older glibc to the new one, often times
-internal symbols change name or abi. this is normally OK as you cannot use
-libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
-we always say "keep all of the glibc libraries from the same build". but
-when glibc runs its tests, it uses dynamic paths to point to its new local
-copies of libraries. if the test doesnt use libdl, then glibc doesnt add
-its path, and when sandbox triggers the loading of libdl, glibc does so
-from the host system system. this gets us into the case of all libraries
-are from the locally compiled version of glibc except for libdl.so.
-
-http://bugs.gentoo.org/56898
----
- Makeconfig | 2 +-
- iconvdata/run-iconv-test.sh | 2 +-
- nptl/tst-tls6.sh | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Makeconfig b/Makeconfig
-index f252842979..5076902c87 100644
---- a/Makeconfig
-+++ b/Makeconfig
-@@ -728,7 +728,7 @@ comma = ,
- sysdep-library-path = \
- $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
- $(filter -Wl$(comma)-rpath-link=%,\
-- $(sysdep-LDFLAGS)))))
-+ $(sysdep-LDFLAGS)))) $(common-objpfx)/dlfcn)
- # $(run-via-rtld-prefix) is a command that, when prepended to the name
- # of a program built with the newly built library, produces a command
- # that, executed on the host for which the library is built, runs that
-diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
-index 56b6630a6d..be74dbf302 100755
---- a/iconvdata/run-iconv-test.sh
-+++ b/iconvdata/run-iconv-test.sh
-@@ -31,7 +31,7 @@ temp2=$codir/iconvdata/iconv-test.yyy
- trap "rm -f $temp1 $temp2" 1 2 3 15
-
- # We have to have some directories in the library path.
--LIBPATH=$codir:$codir/iconvdata
-+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
-
- # How the start the iconv(1) program.
- ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
-diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh
-index e6dc20572a..a25b167b2d 100755
---- a/nptl/tst-tls6.sh
-+++ b/nptl/tst-tls6.sh
-@@ -26,7 +26,7 @@ run_program_env=$1; shift
- logfile=$common_objpfx/nptl/tst-tls6.out
-
- # We have to find libc and nptl
--library_path=${common_objpfx}:${common_objpfx}nptl
-+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
- tst_tls5="${test_via_rtld_prefix} ${common_objpfx}/nptl/tst-tls5"
-
- > $logfile
---
-2.26.2
-
diff --git a/9999/0004-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
similarity index 60%
rename from 9999/0004-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
rename to 9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
index 4002a64..5604d9f 100644
--- a/9999/0004-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
@@ -1,8 +1,8 @@
-From 493fd65c116f423e9bb0a374314775fd475575c3 Mon Sep 17 00:00:00 2001
+From cc789d18e5f6bb39ecca6ee8ec2872bd7a737160 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Tue, 29 Aug 2017 22:58:50 +0200
-Subject: [PATCH 04/12] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet):
- Only use gethostbyname4_r"
+Subject: [PATCH 2/5] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
+ use gethostbyname4_r"
This reverts commit 8479f23aa1d5e5477a37f46823856bdafaedfa46.
@@ -10,12 +10,24 @@ See for the background
https://sourceware.org/bugzilla/show_bug.cgi?id=16826
https://bugs.gentoo.org/show_bug.cgi?id=600632
-This makes test resolv/tst-res_use_inet6 fail. Disable it.
-(cherry picked from commit 06a2a073a2c6fb3e1489af96e125daca248d0a03)
+This makes tst-nss-files-hosts-multi fail. Disable it.
---
+ nss/Makefile | 1 -
sysdeps/posix/getaddrinfo.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+diff --git a/nss/Makefile b/nss/Makefile
+index 97bab5bb75..7a6ddebde2 100644
+--- a/nss/Makefile
++++ b/nss/Makefile
+@@ -68,7 +68,6 @@ tests-container = \
+ # Tests which need libdl
+ ifeq (yes,$(build-shared))
+ tests += tst-nss-files-hosts-erange
+-tests += tst-nss-files-hosts-multi
+ tests += tst-nss-files-hosts-getent
+ tests += tst-nss-files-alias-leak
+ tests += tst-nss-files-alias-truncated
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index ed04e564f9..ce9e0d342d 100644
--- a/sysdeps/posix/getaddrinfo.c
diff --git a/9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
similarity index 75%
rename from 9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch
rename to 9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index bcf87ab..13ff145 100644
--- a/9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,15 +1,34 @@
-From 96f7387cdee162005d2373cbdcd1f7b65dfccd2c Mon Sep 17 00:00:00 2001
-From: "Andreas K. Huettel" <dilfridge@gentoo.org>
-Date: Sat, 21 Mar 2020 15:54:14 +0100
-Subject: [PATCH 10/12] Gentoo: Adapt tests to /etc/mail/alias location
+From dbe134e9eed77bfbbbbf80fa97f2b02b869bcf9c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Mon, 22 Oct 2018 22:34:13 +0200
+Subject: [PATCH 3/5] Adapt to Gentoo-specific /etc/mail/aliases
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
-Signed-off-by: Andreas K. Huettel <dilfridge@gentoo.org>
-(cherry picked from commit 03fb405d759b9806fa150813f04dfe1aaa658ac6)
+Patch by pacho2
+
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+(cherry picked from commit 4e616cda056f471b799beba2b1cedc787ad4ecc0)
---
+ nss/nss_files/files-alias.c | 2 +-
nss/tst-nss-files-alias-leak.c | 18 +++++++++---------
support/support_chroot.c | 8 +++++++-
- 2 files changed, 16 insertions(+), 10 deletions(-)
+ 3 files changed, 17 insertions(+), 11 deletions(-)
+diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
+index 6aff7b4c10..bb6d9b5765 100644
+--- a/nss/nss_files/files-alias.c
++++ b/nss/nss_files/files-alias.c
+@@ -49,7 +49,7 @@ internal_setent (FILE **stream)
+
+ if (*stream == NULL)
+ {
+- *stream = fopen ("/etc/aliases", "rce");
++ *stream = fopen ("/etc/mail/aliases", "rce");
+
+ if (*stream == NULL)
+ status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
index daebbf4ed4..095bb753a6 100644
--- a/nss/tst-nss-files-alias-leak.c
diff --git a/9999/0008-Gentoo-Add-a-C.UTF-8-locale.patch b/9999/0004-Add-C.UTF-8-locale.patch
similarity index 98%
rename from 9999/0008-Gentoo-Add-a-C.UTF-8-locale.patch
rename to 9999/0004-Add-C.UTF-8-locale.patch
index 31903b6..deea332 100644
--- a/9999/0008-Gentoo-Add-a-C.UTF-8-locale.patch
+++ b/9999/0004-Add-C.UTF-8-locale.patch
@@ -1,7 +1,7 @@
-From baeb7948ba8b6cc25059cf9659d045e24cd7d879 Mon Sep 17 00:00:00 2001
+From 776636b6940ed6f3e08b0a67c290f241885384cb Mon Sep 17 00:00:00 2001
From: Mike FABIAN <mfabian@redhat.com>
Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH 08/12] Gentoo: Add a C.UTF-8 locale
+Subject: [PATCH 4/5] Add C.UTF-8 locale
Source:
https://src.fedoraproject.org/rpms/glibc/raw/master/f/glibc-c-utf8-locale.patch
diff --git a/9999/0009-Gentoo-force-O0-in-conform-tests-to-survive-CC-chang.patch b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
similarity index 94%
rename from 9999/0009-Gentoo-force-O0-in-conform-tests-to-survive-CC-chang.patch
rename to 9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index 9504792..02532cd 100644
--- a/9999/0009-Gentoo-force-O0-in-conform-tests-to-survive-CC-chang.patch
+++ b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,8 +1,7 @@
-From 1c39b1dd8ad727a48cb3c9fbcd9d005f690752eb Mon Sep 17 00:00:00 2001
+From 84d03a910e28bb804453dad3e7600afe5e70256d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 09/12] Gentoo: force -O0 in conform tests to survive $CC
- changes
+Subject: [PATCH 5/5] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --git a/9999/0005-Gentoo-disable-tests-that-fail-only-in-sandbox.patch b/9999/0005-Gentoo-disable-tests-that-fail-only-in-sandbox.patch
deleted file mode 100644
index f0b00a5..0000000
--- a/9999/0005-Gentoo-disable-tests-that-fail-only-in-sandbox.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From 8c012e90bf4645d37cb022d273d814b3fbc33a94 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Mon, 11 Sep 2017 13:14:46 +0200
-Subject: [PATCH 05/12] Gentoo: disable tests that fail only in sandbox
-
----
- elf/Makefile | 16 +---------------
- io/Makefile | 2 +-
- nptl/Makefile | 7 +++++--
- posix/Makefile | 4 ++--
- resolv/Makefile | 2 --
- sysdeps/unix/sysv/linux/Makefile | 2 +-
- 6 files changed, 10 insertions(+), 23 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index da689a2c7b..dcf29d47b9 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -413,8 +413,7 @@ tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \
- $(objpfx)tst-array4-cmp.out $(objpfx)tst-array5-cmp.out \
- $(objpfx)tst-array5-static-cmp.out $(objpfx)order2-cmp.out \
- $(objpfx)tst-initorder-cmp.out \
-- $(objpfx)tst-initorder2-cmp.out $(objpfx)tst-unused-dep.out \
-- $(objpfx)tst-unused-dep-cmp.out
-+ $(objpfx)tst-initorder2-cmp.out
- endif
-
- check-abi: $(objpfx)check-abi-ld.out
-@@ -1461,19 +1460,6 @@ $(objpfx)tst-relsort1mod2.so: $(libm)
- $(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
- $(objpfx)tst-relsort1mod2.so
-
--$(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
-- $(test-wrapper-env) \
-- LD_TRACE_LOADED_OBJECTS=1 \
-- LD_DEBUG=unused \
-- LD_PRELOAD= \
-- $(rtld-prefix) \
-- $< > $@; \
-- $(evaluate-test)
--
--$(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
-- cmp $< /dev/null > $@; \
-- $(evaluate-test)
--
- $(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so
- $(objpfx)tst-audit11: $(libdl)
- tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so
-diff --git a/io/Makefile b/io/Makefile
-index cf380f3516..b6fe301f77 100644
---- a/io/Makefile
-+++ b/io/Makefile
-@@ -73,7 +73,7 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
- tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \
- tst-posix_fallocate tst-posix_fallocate64 \
- tst-fts tst-fts-lfs tst-open-tmpfile \
-- tst-copy_file_range tst-getcwd-abspath tst-lockf \
-+ tst-getcwd-abspath tst-lockf \
- tst-ftw-lnk tst-file_change_detection tst-lchmod
-
- # Likewise for statx, but we do not need static linking here.
-diff --git a/nptl/Makefile b/nptl/Makefile
-index e554a3898d..8373b6989d 100644
---- a/nptl/Makefile
-+++ b/nptl/Makefile
-@@ -282,7 +282,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
- tst-atfork1 \
- tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel4_1 \
- tst-cancel4_2 tst-cancel5 \
-- tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
-+ tst-cancel6 tst-cancel8 tst-cancel9 tst-cancel10 \
- tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \
- tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \
- tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 \
-@@ -319,6 +319,9 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
- tst-robust-fork tst-create-detached tst-memstream \
- tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
- tst-minstack-throw \
-+ tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
-+ tst-cnd-timedwait tst-thrd-detach tst-mtx-basic tst-thrd-sleep \
-+ tst-mtx-recursive tst-call-once tst-mtx-timedlock \
- tst-rwlock-pwn \
- tst-unwind-thread
-
-@@ -384,7 +387,7 @@ CFLAGS-tst-cleanup2.c += -fno-builtin
- CFLAGS-tst-cleanupx2.c += -fno-builtin
-
- tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \
-- tst-cancelx6 tst-cancelx7 tst-cancelx8 tst-cancelx9 tst-cancelx10 \
-+ tst-cancelx6 tst-cancelx8 tst-cancelx9 tst-cancelx10 \
- tst-cancelx11 tst-cancelx12 tst-cancelx13 tst-cancelx14 tst-cancelx15 \
- tst-cancelx16 tst-cancelx17 tst-cancelx18 tst-cancelx20 tst-cancelx21 \
- tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 tst-cleanupx4
-diff --git a/posix/Makefile b/posix/Makefile
-index 4507d84bf1..28075ed5bf 100644
---- a/posix/Makefile
-+++ b/posix/Makefile
-@@ -68,7 +68,7 @@ routines := \
- streams-compat
-
- aux := init-posix environ
--tests := test-errno tstgetopt testfnm runtests runptests \
-+tests := tstgetopt testfnm runtests runptests \
- tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
- tst-mmap tst-mmap-offset tst-getaddrinfo tst-truncate \
- tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
-@@ -89,7 +89,7 @@ tests := test-errno tstgetopt testfnm runtests runptests \
- tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
- tst-execvp3 tst-execvp4 \
- tst-execvpe1 tst-execvpe2 tst-execvpe3 tst-execvpe4 \
-- tst-execvpe5 tst-execvpe6 \
-+ tst-execvpe6 \
- tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \
- bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
- bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \
-diff --git a/resolv/Makefile b/resolv/Makefile
-index f131e4b014..6ee6570345 100644
---- a/resolv/Makefile
-+++ b/resolv/Makefile
-@@ -72,8 +72,6 @@ tests += \
-
- # Needs resolv_context.
- tests-internal += \
-- tst-resolv-res_init \
-- tst-resolv-res_init-thread \
- tst-resolv-res_ninit \
- tst-resolv-threads \
-
-diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 60dc5cf9e5..158b2be0d2 100644
---- a/sysdeps/unix/sysv/linux/Makefile
-+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -95,7 +95,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
- bits/ipc-perm.h
-
- tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
-- tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
-+ tst-quota tst-sync_file_range tst-sysconf-iov_max \
- test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
- tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
- tst-tgkill
---
-2.26.2
-
diff --git a/9999/0006-Gentoo-Disable-test-that-fails-because-of-the-gethos.patch b/9999/0006-Gentoo-Disable-test-that-fails-because-of-the-gethos.patch
deleted file mode 100644
index 30b2308..0000000
--- a/9999/0006-Gentoo-Disable-test-that-fails-because-of-the-gethos.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 3b6603fa966a37830261f1452d83f0aa80a1ec7d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Wed, 17 Jan 2018 01:02:19 +0100
-Subject: [PATCH 06/12] Gentoo: Disable test that fails because of the
- gethostbyname4_r revert
-
----
- nss/Makefile | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/nss/Makefile b/nss/Makefile
-index 97bab5bb75..7a6ddebde2 100644
---- a/nss/Makefile
-+++ b/nss/Makefile
-@@ -68,7 +68,6 @@ tests-container = \
- # Tests which need libdl
- ifeq (yes,$(build-shared))
- tests += tst-nss-files-hosts-erange
--tests += tst-nss-files-hosts-multi
- tests += tst-nss-files-hosts-getent
- tests += tst-nss-files-alias-leak
- tests += tst-nss-files-alias-truncated
---
-2.26.2
-
diff --git a/9999/0007-Gentoo-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0007-Gentoo-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
deleted file mode 100644
index 0196398..0000000
--- a/9999/0007-Gentoo-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 9de1a12253bcbec66b56b5058fcc04e775f59e75 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 07/12] Gentoo: Adapt to Gentoo-specific /etc/mail/aliases
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Patch by pacho2
-
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-(cherry picked from commit 4e616cda056f471b799beba2b1cedc787ad4ecc0)
----
- nss/nss_files/files-alias.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 6aff7b4c10..bb6d9b5765 100644
---- a/nss/nss_files/files-alias.c
-+++ b/nss/nss_files/files-alias.c
-@@ -49,7 +49,7 @@ internal_setent (FILE **stream)
-
- if (*stream == NULL)
- {
-- *stream = fopen ("/etc/aliases", "rce");
-+ *stream = fopen ("/etc/mail/aliases", "rce");
-
- if (*stream == NULL)
- status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
---
-2.26.2
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2020-07-18 16:23 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2020-07-18 16:23 UTC (permalink / raw
To: gentoo-commits
commit: 35cb82bd164e19b0b37a90b1a62da71dd4ddd950
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 18 16:22:30 2020 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Jul 18 16:23:02 2020 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=35cb82bd
Add ia64 gcc-10 miscompilation fix; didn't go anywhere upstream yet
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../0100-Fix-miscompilation-on-ia64-s-gcc-10.patch | 32 ++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
new file mode 100644
index 0000000..45ce958
--- /dev/null
+++ b/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -0,0 +1,32 @@
+From 902100a88969641673e91408ff41352d08fa2aa7 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat, 11 Jul 2020 20:06:51 +0300
+Subject: [PATCH] Fix miscompilation on ia64's gcc-10
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: https://bugs.gentoo.org/723268
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+---
+ sysdeps/unix/sysv/linux/ia64/dl-sysdep.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+index 78fa6dd2c9..e526e02ff4 100644
+--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
++++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+@@ -32,7 +32,9 @@
+ #ifndef __ASSEMBLER__
+ /* Don't declare this as a function---we want it's entry-point, not
+ it's function descriptor... */
+-extern int _dl_sysinfo_break attribute_hidden;
++/* Use section ".text" to force far GPREL64 relocation instead of
++ GPREL22 . */
++extern int _dl_sysinfo_break attribute_hidden __attribute__((section(".text")));
+ # define DL_SYSINFO_DEFAULT ((uintptr_t) &_dl_sysinfo_break)
+ # define DL_SYSINFO_IMPLEMENTATION \
+ asm (".text\n\t" \
+--
+2.26.2
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2020-07-23 23:20 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2020-07-23 23:20 UTC (permalink / raw
To: gentoo-commits
commit: f56f0822023ff6b66707732d1becc075c111b63e
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 23 23:19:29 2020 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jul 23 23:20:02 2020 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=f56f0822
Fix etc-mail-aliases patch after changes in master
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 13ff145..ca428cf 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
From dbe134e9eed77bfbbbbf80fa97f2b02b869bcf9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 3/5] Adapt to Gentoo-specific /etc/mail/aliases
+Subject: Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -17,15 +17,15 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 6aff7b4c10..bb6d9b5765 100644
+index 43fb2c49a5..26b2cc86ad 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
-@@ -49,7 +49,7 @@ internal_setent (FILE **stream)
+@@ -50,7 +50,7 @@ internal_setent (FILE **stream)
if (*stream == NULL)
{
-- *stream = fopen ("/etc/aliases", "rce");
-+ *stream = fopen ("/etc/mail/aliases", "rce");
+- *stream = __nss_files_fopen ("/etc/aliases");
++ *stream = __nss_files_fopen ("/etc/mail/aliases");
if (*stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
@@ -103,6 +103,3 @@ index 4f435c1ac1..e7ca2c714b 100644
/* valgrind needs a temporary directory in the chroot. */
{
---
-2.26.2
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-02-27 19:18 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-02-27 19:18 UTC (permalink / raw
To: gentoo-commits
commit: 97053bc58d693b5d8f2ba8d64e680c4860bdee1e
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 27 17:51:10 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Feb 27 17:51:10 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=97053bc5
Add some systemd love
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../0050-Enable-nss-systemd-in-nsswitch.conf.patch | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch b/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
new file mode 100644
index 0000000..507a6f7
--- /dev/null
+++ b/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
@@ -0,0 +1,42 @@
+From bd0e6361082106bd0a053244610a66063b91baed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Sat, 27 Feb 2021 18:37:33 +0100
+Subject: [PATCH] Enable nss-systemd in nsswitch.conf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+See
+https://bugs.gentoo.org/768366
+https://www.freedesktop.org/software/systemd/man/nss-systemd.html
+
+Bug: https://bugs.gentoo.org/768366
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+---
+ nss/nsswitch.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
+index 40030d1dd7..c767b0b929 100644
+--- a/nss/nsswitch.conf
++++ b/nss/nsswitch.conf
+@@ -53,14 +53,14 @@
+ # In alphabetical order. Re-order as required to optimize peformance.
+ aliases: files
+ ethers: files
+-group: files
++group: files [SUCCESS=merge] systemd
+ gshadow: files
+ hosts: files dns
+ # Allow initgroups to default to the setting for group.
+ # initgroups: files
+ netgroup: files
+ networks: files dns
+-passwd: files
++passwd: files systemd
+ protocols: files
+ publickey: files
+ rpc: files
+--
+2.30.1
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-04-10 15:34 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-04-10 15:34 UTC (permalink / raw
To: gentoo-commits
commit: b4e0182029d37d9a1a6f77ea180c51c8324bb926
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 10 15:33:50 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Apr 10 15:33:50 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=b4e01820
Extend nss-systemd patch by an explanatory comment
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../0050-Enable-nss-systemd-in-nsswitch.conf.patch | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch b/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
index 507a6f7..af5796a 100644
--- a/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
+++ b/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
@@ -1,4 +1,4 @@
-From bd0e6361082106bd0a053244610a66063b91baed Mon Sep 17 00:00:00 2001
+From eab439ef67e7749f0e0a159e373e54b5f4dbe887 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Sat, 27 Feb 2021 18:37:33 +0100
Subject: [PATCH] Enable nss-systemd in nsswitch.conf
@@ -13,14 +13,24 @@ https://www.freedesktop.org/software/systemd/man/nss-systemd.html
Bug: https://bugs.gentoo.org/768366
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
- nss/nsswitch.conf | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ nss/nsswitch.conf | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
-index 40030d1dd7..c767b0b929 100644
+index 40030d1dd7..0faf5e71fe 100644
--- a/nss/nsswitch.conf
+++ b/nss/nsswitch.conf
-@@ -53,14 +53,14 @@
+@@ -50,17 +50,24 @@
+ # shadow: db files
+ # group: db files
+
++# If you encounter slowdowns of file operations and do not use
++# systemd-generated users and groups, you can disable the corresponding
++# lookups by replacing the group and passwd lines with, e.g.,
++# group: files
++# passwd: files
++# See also https://bugs.gentoo.org/773436
++
# In alphabetical order. Re-order as required to optimize peformance.
aliases: files
ethers: files
@@ -38,5 +48,5 @@ index 40030d1dd7..c767b0b929 100644
publickey: files
rpc: files
--
-2.30.1
+2.26.3
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-05-25 20:30 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-05-25 20:30 UTC (permalink / raw
To: gentoo-commits
commit: 8fbd57a97a76eaf57be638dc0f9bd019a7bf19ab
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue May 25 20:30:14 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Tue May 25 20:30:14 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=8fbd57a9
Add systemd also to gshadow and shadow lines
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...itch.conf-Add-nss-systemd-hook-also-to-sh.patch | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch b/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch
new file mode 100644
index 0000000..27cff54
--- /dev/null
+++ b/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch
@@ -0,0 +1,35 @@
+From c834ea3358e6a3d74ed45b96168338f31dd0f080 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Tue, 25 May 2021 22:24:20 +0200
+Subject: [PATCH] Gentoo: nsswitch.conf: Add nss-systemd hook also to shadow
+ and gshadow
+
+See-also: https://github.com/systemd/systemd/pull/19545
+See-also: https://github.com/systemd/systemd/commit/f43a19ecd6e3415ec223f245204b4eaaff739af4
+---
+ nss/nsswitch.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
+index 0faf5e71fe..17aa6db22b 100644
+--- a/nss/nsswitch.conf
++++ b/nss/nsswitch.conf
+@@ -61,7 +61,7 @@
+ aliases: files
+ ethers: files
+ group: files [SUCCESS=merge] systemd
+-gshadow: files
++gshadow: files systemd
+ hosts: files dns
+ # Allow initgroups to default to the setting for group.
+ # initgroups: files
+@@ -71,5 +71,5 @@ passwd: files systemd
+ protocols: files
+ publickey: files
+ rpc: files
+-shadow: files
++shadow: files systemd
+ services: files
+--
+2.26.3
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-07-22 23:17 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-07-22 23:17 UTC (permalink / raw
To: gentoo-commits
commit: a56f83db1f3f42de563e2669afdc67ae708a4f78
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 22 23:10:22 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jul 22 23:10:22 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=a56f83db
Drop systemd-related config file patches, this will be done conditionally
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../0050-Enable-nss-systemd-in-nsswitch.conf.patch | 52 ----------------------
...itch.conf-Add-nss-systemd-hook-also-to-sh.patch | 35 ---------------
2 files changed, 87 deletions(-)
diff --git a/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch b/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
deleted file mode 100644
index af5796a..0000000
--- a/9999/0050-Enable-nss-systemd-in-nsswitch.conf.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From eab439ef67e7749f0e0a159e373e54b5f4dbe887 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Sat, 27 Feb 2021 18:37:33 +0100
-Subject: [PATCH] Enable nss-systemd in nsswitch.conf
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-See
-https://bugs.gentoo.org/768366
-https://www.freedesktop.org/software/systemd/man/nss-systemd.html
-
-Bug: https://bugs.gentoo.org/768366
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
----
- nss/nsswitch.conf | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
-index 40030d1dd7..0faf5e71fe 100644
---- a/nss/nsswitch.conf
-+++ b/nss/nsswitch.conf
-@@ -50,17 +50,24 @@
- # shadow: db files
- # group: db files
-
-+# If you encounter slowdowns of file operations and do not use
-+# systemd-generated users and groups, you can disable the corresponding
-+# lookups by replacing the group and passwd lines with, e.g.,
-+# group: files
-+# passwd: files
-+# See also https://bugs.gentoo.org/773436
-+
- # In alphabetical order. Re-order as required to optimize peformance.
- aliases: files
- ethers: files
--group: files
-+group: files [SUCCESS=merge] systemd
- gshadow: files
- hosts: files dns
- # Allow initgroups to default to the setting for group.
- # initgroups: files
- netgroup: files
- networks: files dns
--passwd: files
-+passwd: files systemd
- protocols: files
- publickey: files
- rpc: files
---
-2.26.3
-
diff --git a/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch b/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch
deleted file mode 100644
index 27cff54..0000000
--- a/9999/0051-Gentoo-nsswitch.conf-Add-nss-systemd-hook-also-to-sh.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From c834ea3358e6a3d74ed45b96168338f31dd0f080 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Tue, 25 May 2021 22:24:20 +0200
-Subject: [PATCH] Gentoo: nsswitch.conf: Add nss-systemd hook also to shadow
- and gshadow
-
-See-also: https://github.com/systemd/systemd/pull/19545
-See-also: https://github.com/systemd/systemd/commit/f43a19ecd6e3415ec223f245204b4eaaff739af4
----
- nss/nsswitch.conf | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
-index 0faf5e71fe..17aa6db22b 100644
---- a/nss/nsswitch.conf
-+++ b/nss/nsswitch.conf
-@@ -61,7 +61,7 @@
- aliases: files
- ethers: files
- group: files [SUCCESS=merge] systemd
--gshadow: files
-+gshadow: files systemd
- hosts: files dns
- # Allow initgroups to default to the setting for group.
- # initgroups: files
-@@ -71,5 +71,5 @@ passwd: files systemd
- protocols: files
- publickey: files
- rpc: files
--shadow: files
-+shadow: files systemd
- services: files
---
-2.26.3
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-08-02 22:41 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-08-02 22:41 UTC (permalink / raw
To: gentoo-commits
commit: 7687599f6fe13945dad001942ea107d3b648a263
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 2 22:41:09 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Aug 2 22:41:09 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=7687599f
Regenerate patches at 2.37 release
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 16 ++++++++--------
...t-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch | 14 +++++++-------
.../0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 15 +++++++++------
9999/0004-Add-C.UTF-8-locale.patch | 6 +++---
...Force-O0-in-conform-tests-to-survive-CC-changes.patch | 10 +++++-----
...ch => 0006-Fix-miscompilation-on-ia64-s-gcc-10.patch} | 8 ++++----
6 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 0dbdd9a..6080ceb 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From 8831dc046682b2f3fca8a0dc831e53afdebd4469 Mon Sep 17 00:00:00 2001
+From 479864345ca9f13e439b68681e13beb3dce60f7c Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 1 Apr 2009 02:15:48 -0400
-Subject: [PATCH 1/5] Disable ldconfig during install
+Date: Tue, 3 Aug 2021 00:34:59 +0200
+Subject: [PATCH 1/6] Disable ldconfig during install
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -15,17 +15,17 @@ https://bugs.gentoo.org/431038
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index 6dcfe40c25..68259babda 100644
+index f98d5a9e67..ef0077677c 100644
--- a/Makefile
+++ b/Makefile
-@@ -116,6 +116,7 @@ install-symbolic-link: subdir_install
- rm -f $(symbolic-link-list)
-
+@@ -110,6 +110,7 @@ elf/ldso_install:
+ ifeq (no,$(cross-compiling))
+ ifeq (yes,$(build-shared))
install:
+dont-bother-with-destdir:
-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.26.2
+2.31.1
diff --git a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
index 5604d9f..b256229 100644
--- a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
@@ -1,7 +1,7 @@
-From cc789d18e5f6bb39ecca6ee8ec2872bd7a737160 Mon Sep 17 00:00:00 2001
+From 10aed4ee2c685613d190434649bbac896b364680 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Tue, 29 Aug 2017 22:58:50 +0200
-Subject: [PATCH 2/5] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
+Subject: [PATCH 2/6] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
use gethostbyname4_r"
This reverts commit 8479f23aa1d5e5477a37f46823856bdafaedfa46.
@@ -17,10 +17,10 @@ This makes tst-nss-files-hosts-multi fail. Disable it.
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/nss/Makefile b/nss/Makefile
-index 97bab5bb75..7a6ddebde2 100644
+index bccf9f2806..c90fee2e4c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
-@@ -68,7 +68,6 @@ tests-container = \
+@@ -74,7 +74,6 @@ tests-container = \
# Tests which need libdl
ifeq (yes,$(build-shared))
tests += tst-nss-files-hosts-erange
@@ -29,10 +29,10 @@ index 97bab5bb75..7a6ddebde2 100644
tests += tst-nss-files-alias-leak
tests += tst-nss-files-alias-truncated
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index ed04e564f9..ce9e0d342d 100644
+index 838a68f022..1bb2263225 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
-@@ -739,13 +739,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
+@@ -733,13 +733,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
while (!no_more)
{
no_data = 0;
@@ -49,5 +49,5 @@ index ed04e564f9..ce9e0d342d 100644
{
while (1)
--
-2.26.2
+2.31.1
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index ca428cf..9588b09 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From dbe134e9eed77bfbbbbf80fa97f2b02b869bcf9c Mon Sep 17 00:00:00 2001
+From 60c8192d7a9245a2d1ad491d73b2677564d41374 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 3/6] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -17,10 +17,10 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 43fb2c49a5..26b2cc86ad 100644
+index 2a4023b9a9..42c2a76d2f 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
-@@ -50,7 +50,7 @@ internal_setent (FILE **stream)
+@@ -43,7 +43,7 @@ internal_setent (FILE **stream)
if (*stream == NULL)
{
@@ -30,7 +30,7 @@ index 43fb2c49a5..26b2cc86ad 100644
if (*stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
-index daebbf4ed4..095bb753a6 100644
+index 3b8af66294..91312d2552 100644
--- a/nss/tst-nss-files-alias-leak.c
+++ b/nss/tst-nss-files-alias-leak.c
@@ -45,27 +45,27 @@ prepare (int argc, char **argv)
@@ -79,7 +79,7 @@ index daebbf4ed4..095bb753a6 100644
FILE *fp = xfopen (path, "w");
for (int i = 0; i < many_aliases; ++i)
diff --git a/support/support_chroot.c b/support/support_chroot.c
-index 4f435c1ac1..e7ca2c714b 100644
+index e1628eb53b..4c58eba6a4 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -52,13 +52,19 @@ support_chroot_create (struct support_chroot_configuration conf)
@@ -103,3 +103,6 @@ index 4f435c1ac1..e7ca2c714b 100644
/* valgrind needs a temporary directory in the chroot. */
{
+--
+2.31.1
+
diff --git a/9999/0004-Add-C.UTF-8-locale.patch b/9999/0004-Add-C.UTF-8-locale.patch
index deea332..a9c3e22 100644
--- a/9999/0004-Add-C.UTF-8-locale.patch
+++ b/9999/0004-Add-C.UTF-8-locale.patch
@@ -1,7 +1,7 @@
-From 776636b6940ed6f3e08b0a67c290f241885384cb Mon Sep 17 00:00:00 2001
+From 5d65bb98c9ec8d3657b5566e9fb50d46319f65a3 Mon Sep 17 00:00:00 2001
From: Mike FABIAN <mfabian@redhat.com>
Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH 4/5] Add C.UTF-8 locale
+Subject: [PATCH 4/6] Add C.UTF-8 locale
Source:
https://src.fedoraproject.org/rpms/glibc/raw/master/f/glibc-c-utf8-locale.patch
@@ -283,5 +283,5 @@ index 0000000000..b2c2d1dc41
+END LC_MEASUREMENT
+
--
-2.26.2
+2.31.1
diff --git a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index 02532cd..1262b6b 100644
--- a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From 84d03a910e28bb804453dad3e7600afe5e70256d Mon Sep 17 00:00:00 2001
+From 21bbee17488159cff563f90ed83aee59703cb21e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 5/5] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 5/6] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -22,7 +22,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/conform/conformtest.py b/conform/conformtest.py
-index cb2bd97eca..6076b615df 100644
+index f0405b7186..14d342e4c4 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -562,7 +562,7 @@ class HeaderTests(object):
@@ -46,7 +46,7 @@ index cb2bd97eca..6076b615df 100644
subprocess.check_call(cmd, shell=True)
bad_tokens = set()
diff --git a/conform/linknamespace.py b/conform/linknamespace.py
-index 1d27e4cfba..b0d2b9bbc2 100644
+index 66b16e244a..78c80d7645 100644
--- a/conform/linknamespace.py
+++ b/conform/linknamespace.py
@@ -157,7 +157,9 @@ def main():
@@ -61,5 +61,5 @@ index 1d27e4cfba..b0d2b9bbc2 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.26.2
+2.31.1
diff --git a/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
similarity index 86%
rename from 9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
rename to 9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 45ce958..9f1148b 100644
--- a/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From 902100a88969641673e91408ff41352d08fa2aa7 Mon Sep 17 00:00:00 2001
+From 83b7893377b93d84e8bea1be08686b96cb98024d Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 6/6] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,7 +13,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index 78fa6dd2c9..e526e02ff4 100644
+index 24650ce31f..20294e6ff0 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
@@ -28,5 +28,5 @@ index 78fa6dd2c9..e526e02ff4 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.26.2
+2.31.1
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-08-02 22:42 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-08-02 22:42 UTC (permalink / raw
To: gentoo-commits
commit: a62c3b78888d5e647aefb2a33f28088700e62d7b
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 2 22:41:09 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Aug 2 22:41:56 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=a62c3b78
Regenerate patches at 2.34 release
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 16 ++++++++--------
...t-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch | 14 +++++++-------
.../0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 15 +++++++++------
9999/0004-Add-C.UTF-8-locale.patch | 6 +++---
...Force-O0-in-conform-tests-to-survive-CC-changes.patch | 10 +++++-----
...ch => 0006-Fix-miscompilation-on-ia64-s-gcc-10.patch} | 8 ++++----
6 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 0dbdd9a..6080ceb 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From 8831dc046682b2f3fca8a0dc831e53afdebd4469 Mon Sep 17 00:00:00 2001
+From 479864345ca9f13e439b68681e13beb3dce60f7c Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 1 Apr 2009 02:15:48 -0400
-Subject: [PATCH 1/5] Disable ldconfig during install
+Date: Tue, 3 Aug 2021 00:34:59 +0200
+Subject: [PATCH 1/6] Disable ldconfig during install
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -15,17 +15,17 @@ https://bugs.gentoo.org/431038
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index 6dcfe40c25..68259babda 100644
+index f98d5a9e67..ef0077677c 100644
--- a/Makefile
+++ b/Makefile
-@@ -116,6 +116,7 @@ install-symbolic-link: subdir_install
- rm -f $(symbolic-link-list)
-
+@@ -110,6 +110,7 @@ elf/ldso_install:
+ ifeq (no,$(cross-compiling))
+ ifeq (yes,$(build-shared))
install:
+dont-bother-with-destdir:
-test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.26.2
+2.31.1
diff --git a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
index 5604d9f..b256229 100644
--- a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
@@ -1,7 +1,7 @@
-From cc789d18e5f6bb39ecca6ee8ec2872bd7a737160 Mon Sep 17 00:00:00 2001
+From 10aed4ee2c685613d190434649bbac896b364680 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Tue, 29 Aug 2017 22:58:50 +0200
-Subject: [PATCH 2/5] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
+Subject: [PATCH 2/6] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
use gethostbyname4_r"
This reverts commit 8479f23aa1d5e5477a37f46823856bdafaedfa46.
@@ -17,10 +17,10 @@ This makes tst-nss-files-hosts-multi fail. Disable it.
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/nss/Makefile b/nss/Makefile
-index 97bab5bb75..7a6ddebde2 100644
+index bccf9f2806..c90fee2e4c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
-@@ -68,7 +68,6 @@ tests-container = \
+@@ -74,7 +74,6 @@ tests-container = \
# Tests which need libdl
ifeq (yes,$(build-shared))
tests += tst-nss-files-hosts-erange
@@ -29,10 +29,10 @@ index 97bab5bb75..7a6ddebde2 100644
tests += tst-nss-files-alias-leak
tests += tst-nss-files-alias-truncated
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index ed04e564f9..ce9e0d342d 100644
+index 838a68f022..1bb2263225 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
-@@ -739,13 +739,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
+@@ -733,13 +733,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
while (!no_more)
{
no_data = 0;
@@ -49,5 +49,5 @@ index ed04e564f9..ce9e0d342d 100644
{
while (1)
--
-2.26.2
+2.31.1
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index ca428cf..9588b09 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From dbe134e9eed77bfbbbbf80fa97f2b02b869bcf9c Mon Sep 17 00:00:00 2001
+From 60c8192d7a9245a2d1ad491d73b2677564d41374 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 3/6] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -17,10 +17,10 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 43fb2c49a5..26b2cc86ad 100644
+index 2a4023b9a9..42c2a76d2f 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
-@@ -50,7 +50,7 @@ internal_setent (FILE **stream)
+@@ -43,7 +43,7 @@ internal_setent (FILE **stream)
if (*stream == NULL)
{
@@ -30,7 +30,7 @@ index 43fb2c49a5..26b2cc86ad 100644
if (*stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
-index daebbf4ed4..095bb753a6 100644
+index 3b8af66294..91312d2552 100644
--- a/nss/tst-nss-files-alias-leak.c
+++ b/nss/tst-nss-files-alias-leak.c
@@ -45,27 +45,27 @@ prepare (int argc, char **argv)
@@ -79,7 +79,7 @@ index daebbf4ed4..095bb753a6 100644
FILE *fp = xfopen (path, "w");
for (int i = 0; i < many_aliases; ++i)
diff --git a/support/support_chroot.c b/support/support_chroot.c
-index 4f435c1ac1..e7ca2c714b 100644
+index e1628eb53b..4c58eba6a4 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -52,13 +52,19 @@ support_chroot_create (struct support_chroot_configuration conf)
@@ -103,3 +103,6 @@ index 4f435c1ac1..e7ca2c714b 100644
/* valgrind needs a temporary directory in the chroot. */
{
+--
+2.31.1
+
diff --git a/9999/0004-Add-C.UTF-8-locale.patch b/9999/0004-Add-C.UTF-8-locale.patch
index deea332..a9c3e22 100644
--- a/9999/0004-Add-C.UTF-8-locale.patch
+++ b/9999/0004-Add-C.UTF-8-locale.patch
@@ -1,7 +1,7 @@
-From 776636b6940ed6f3e08b0a67c290f241885384cb Mon Sep 17 00:00:00 2001
+From 5d65bb98c9ec8d3657b5566e9fb50d46319f65a3 Mon Sep 17 00:00:00 2001
From: Mike FABIAN <mfabian@redhat.com>
Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH 4/5] Add C.UTF-8 locale
+Subject: [PATCH 4/6] Add C.UTF-8 locale
Source:
https://src.fedoraproject.org/rpms/glibc/raw/master/f/glibc-c-utf8-locale.patch
@@ -283,5 +283,5 @@ index 0000000000..b2c2d1dc41
+END LC_MEASUREMENT
+
--
-2.26.2
+2.31.1
diff --git a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index 02532cd..1262b6b 100644
--- a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From 84d03a910e28bb804453dad3e7600afe5e70256d Mon Sep 17 00:00:00 2001
+From 21bbee17488159cff563f90ed83aee59703cb21e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 5/5] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 5/6] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -22,7 +22,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/conform/conformtest.py b/conform/conformtest.py
-index cb2bd97eca..6076b615df 100644
+index f0405b7186..14d342e4c4 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -562,7 +562,7 @@ class HeaderTests(object):
@@ -46,7 +46,7 @@ index cb2bd97eca..6076b615df 100644
subprocess.check_call(cmd, shell=True)
bad_tokens = set()
diff --git a/conform/linknamespace.py b/conform/linknamespace.py
-index 1d27e4cfba..b0d2b9bbc2 100644
+index 66b16e244a..78c80d7645 100644
--- a/conform/linknamespace.py
+++ b/conform/linknamespace.py
@@ -157,7 +157,9 @@ def main():
@@ -61,5 +61,5 @@ index 1d27e4cfba..b0d2b9bbc2 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.26.2
+2.31.1
diff --git a/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
similarity index 86%
rename from 9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
rename to 9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 45ce958..9f1148b 100644
--- a/9999/0100-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From 902100a88969641673e91408ff41352d08fa2aa7 Mon Sep 17 00:00:00 2001
+From 83b7893377b93d84e8bea1be08686b96cb98024d Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 6/6] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,7 +13,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index 78fa6dd2c9..e526e02ff4 100644
+index 24650ce31f..20294e6ff0 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
@@ -28,5 +28,5 @@ index 78fa6dd2c9..e526e02ff4 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.26.2
+2.31.1
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-12-01 16:17 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-12-01 16:17 UTC (permalink / raw
To: gentoo-commits
commit: a322f1dc93f32dcf4af8441f7bc7214e8694290c
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 1 16:16:49 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Dec 1 16:16:49 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=a322f1dc
Add patch to make clone3 optional
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0020-make-clone3-syscall-optional.patch | 48 ++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0020-make-clone3-syscall-optional.patch
new file mode 100644
index 0000000..33aa08f
--- /dev/null
+++ b/9999/0020-make-clone3-syscall-optional.patch
@@ -0,0 +1,48 @@
+From 1f714c474eb248b3fa2c84f3b0f22cc509c0e6c9 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 1 Dec 2021 14:58:40 +0000
+Subject: [PATCH] clone-internal.c: make clone3 syscall optional
+
+We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
+compatibility with applications using older Electron.
+
+Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
+revert back to always using clone3.
+
+This was impacting e.g. Discord and Skype. This patch stops glibc from using
+clone3 internally (which is the only real use of it) and falls back to the old
+behaviour.
+
+Specifically, we want https://github.com/electron/electron/pull/31091
+to work its way downstream to various Electron applications.
+
+https://bugs.gentoo.org/819045
+https://bugs.gentoo.org/827386
+
+https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch
+
+This is the same as the patch that was considered but ultimately rejected
+for 2.34 because Docker got sorted out in time:
+https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
+index 979f7880be..c5566daf73 100644
+--- a/sysdeps/unix/sysv/linux/clone-internal.c
++++ b/sysdeps/unix/sysv/linux/clone-internal.c
+@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
+ int (*func) (void *arg), void *arg)
+ {
+ int ret;
+-#ifdef HAVE_CLONE3_WRAPPER
++#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
+ /* Try clone3 first. */
+ int saved_errno = errno;
+ ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
+--
+2.32.0
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2021-12-01 16:30 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2021-12-01 16:30 UTC (permalink / raw
To: gentoo-commits
commit: f6fb1f58ff4e8f52d7872e4a7e1a40100ceaf660
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 1 16:23:33 2021 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Dec 1 16:23:33 2021 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=f6fb1f58
Drop C.UTF8 patch, finally that locale has been added upstream
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0004-Add-C.UTF-8-locale.patch | 287 -------------------------------------
1 file changed, 287 deletions(-)
diff --git a/9999/0004-Add-C.UTF-8-locale.patch b/9999/0004-Add-C.UTF-8-locale.patch
deleted file mode 100644
index a9c3e22..0000000
--- a/9999/0004-Add-C.UTF-8-locale.patch
+++ /dev/null
@@ -1,287 +0,0 @@
-From 5d65bb98c9ec8d3657b5566e9fb50d46319f65a3 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 10 Aug 2015 15:58:12 +0200
-Subject: [PATCH 4/6] Add C.UTF-8 locale
-
-Source:
-https://src.fedoraproject.org/rpms/glibc/raw/master/f/glibc-c-utf8-locale.patch
-
-Notes from there:
-This patch needs to upstream as part of Carlos O'Donell
-<carlos@redhat.com>'s work on enabling upstream C.UTF-8 support. This
-work is currently blocked on cleaning up the test results to prove that
-full code-point sorting is working as intended.
-Note that this patch does not provide full code-point sorting as
-expected.
-This patch needs to upstream as soon as possible since it would be nice
-to have this in F29 and fixed.
-
-Further information:
-https://bugzilla.redhat.com/show_bug.cgi?id=902094
-https://sourceware.org/bugzilla/show_bug.cgi?id=17318
-https://bugs.gentoo.org/671024
----
- localedata/SUPPORTED | 1 +
- localedata/locales/C | 238 +++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 239 insertions(+)
- create mode 100644 localedata/locales/C
-
-diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED
-index 1ee5b5e8c8..5fa87f1315 100644
---- a/localedata/SUPPORTED
-+++ b/localedata/SUPPORTED
-@@ -1,6 +1,7 @@
- # This file names the currently supported and somewhat tested locales.
- # If you have any additions please file a glibc bug report.
- SUPPORTED-LOCALES=\
-+C.UTF-8/UTF-8 \
- aa_DJ.UTF-8/UTF-8 \
- aa_DJ/ISO-8859-1 \
- aa_ER/UTF-8 \
-diff --git a/localedata/locales/C b/localedata/locales/C
-new file mode 100644
-index 0000000000..b2c2d1dc41
---- /dev/null
-+++ b/localedata/locales/C
-@@ -0,0 +1,238 @@
-+escape_char /
-+comment_char %
-+% Locale for C locale in UTF-8
-+
-+LC_IDENTIFICATION
-+title "C locale"
-+source ""
-+address ""
-+contact ""
-+email "mfabian@redhat.com"
-+tel ""
-+fax ""
-+language "C"
-+territory ""
-+revision "1.0"
-+date "2015-08-10"
-+%
-+category "i18n:2012";LC_IDENTIFICATION
-+category "i18n:2012";LC_CTYPE
-+category "i18n:2012";LC_COLLATE
-+category "i18n:2012";LC_TIME
-+category "i18n:2012";LC_NUMERIC
-+category "i18n:2012";LC_MONETARY
-+category "i18n:2012";LC_MESSAGES
-+category "i18n:2012";LC_PAPER
-+category "i18n:2012";LC_NAME
-+category "i18n:2012";LC_ADDRESS
-+category "i18n:2012";LC_TELEPHONE
-+category "i18n:2012";LC_MEASUREMENT
-+END LC_IDENTIFICATION
-+
-+LC_CTYPE
-+copy "i18n"
-+
-+translit_start
-+include "translit_combining";""
-+translit_end
-+
-+END LC_CTYPE
-+
-+LC_COLLATE
-+order_start forward
-+<U0000>
-+..
-+<UFFFF>
-+<U10000>
-+..
-+<U1FFFF>
-+<U20000>
-+..
-+<U2FFFF>
-+<UE0000>
-+..
-+<UEFFFF>
-+<UF0000>
-+..
-+<UFFFFF>
-+<U100000>
-+..
-+<U10FFFF>
-+UNDEFINED
-+order_end
-+END LC_COLLATE
-+
-+LC_MONETARY
-+% This is the 14652 i18n fdcc-set definition for
-+% the LC_MONETARY category
-+% (except for the int_curr_symbol and currency_symbol, they are empty in
-+% the 14652 i18n fdcc-set definition and also empty in
-+% glibc/locale/C-monetary.c. But localedef complains in that case).
-+%
-+% Using "USD" for int_curr_symbol. But maybe "XXX" would be better?
-+% XXX is "No currency" (https://en.wikipedia.org/wiki/ISO_4217)
-+int_curr_symbol "<U0055><U0053><U0044><U0020>"
-+% Using "$" for currency_symbol. But maybe <U00A4> would be better?
-+% U+00A4 is the "generic currency symbol"
-+% (https://en.wikipedia.org/wiki/Currency_sign_%28typography%29)
-+currency_symbol "<U0024>"
-+mon_decimal_point "<U002E>"
-+mon_thousands_sep ""
-+mon_grouping -1
-+positive_sign ""
-+negative_sign "<U002D>"
-+int_frac_digits -1
-+frac_digits -1
-+p_cs_precedes -1
-+int_p_sep_by_space -1
-+p_sep_by_space -1
-+n_cs_precedes -1
-+int_n_sep_by_space -1
-+n_sep_by_space -1
-+p_sign_posn -1
-+n_sign_posn -1
-+%
-+END LC_MONETARY
-+
-+LC_NUMERIC
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+decimal_point "<U002E>"
-+thousands_sep ""
-+grouping -1
-+END LC_NUMERIC
-+
-+LC_TIME
-+% This is the POSIX Locale definition for
-+% the LC_TIME category.
-+%
-+% Abbreviated weekday names (%a)
-+abday "<U0053><U0075><U006E>";"<U004D><U006F><U006E>";/
-+ "<U0054><U0075><U0065>";"<U0057><U0065><U0064>";/
-+ "<U0054><U0068><U0075>";"<U0046><U0072><U0069>";/
-+ "<U0053><U0061><U0074>"
-+
-+% Full weekday names (%A)
-+day "<U0053><U0075><U006E><U0064><U0061><U0079>";/
-+ "<U004D><U006F><U006E><U0064><U0061><U0079>";/
-+ "<U0054><U0075><U0065><U0073><U0064><U0061><U0079>";/
-+ "<U0057><U0065><U0064><U006E><U0065><U0073><U0064><U0061><U0079>";/
-+ "<U0054><U0068><U0075><U0072><U0073><U0064><U0061><U0079>";/
-+ "<U0046><U0072><U0069><U0064><U0061><U0079>";/
-+ "<U0053><U0061><U0074><U0075><U0072><U0064><U0061><U0079>"
-+
-+% Abbreviated month names (%b)
-+abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/
-+ "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/
-+ "<U004D><U0061><U0079>";"<U004A><U0075><U006E>";/
-+ "<U004A><U0075><U006C>";"<U0041><U0075><U0067>";/
-+ "<U0053><U0065><U0070>";"<U004F><U0063><U0074>";/
-+ "<U004E><U006F><U0076>";"<U0044><U0065><U0063>"
-+
-+% Full month names (%B)
-+mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/
-+ "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0079>";/
-+ "<U004D><U0061><U0072><U0063><U0068>";/
-+ "<U0041><U0070><U0072><U0069><U006C>";/
-+ "<U004D><U0061><U0079>";/
-+ "<U004A><U0075><U006E><U0065>";/
-+ "<U004A><U0075><U006C><U0079>";/
-+ "<U0041><U0075><U0067><U0075><U0073><U0074>";/
-+ "<U0053><U0065><U0070><U0074><U0065><U006D><U0062><U0065><U0072>";/
-+ "<U004F><U0063><U0074><U006F><U0062><U0065><U0072>";/
-+ "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/
-+ "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>"
-+
-+% Week description, consists of three fields:
-+% 1. Number of days in a week.
-+% 2. Gregorian date that is a first weekday (19971130 for Sunday, 19971201 for Monday).
-+% 3. The weekday number to be contained in the first week of the year.
-+%
-+% ISO 8601 conforming applications should use the values 7, 19971201 (a
-+% Monday), and 4 (Thursday), respectively.
-+week 7;19971201;4
-+first_weekday 1
-+first_workday 1
-+
-+% Appropriate date and time representation (%c)
-+% "%a %b %e %H:%M:%S %Y"
-+d_t_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0059>"
-+
-+% Appropriate date representation (%x)
-+% "%m/%d/%y"
-+d_fmt "<U0025><U006D><U002F><U0025><U0064><U002F><U0025><U0079>"
-+
-+% Appropriate time representation (%X)
-+% "%H:%M:%S"
-+t_fmt "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-+
-+% Appropriate AM/PM time representation (%r)
-+% "%I:%M:%S %p"
-+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
-+
-+% Equivalent of AM/PM (%p) "AM"/"PM"
-+%
-+am_pm "<U0041><U004D>";"<U0050><U004D>"
-+
-+% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y"
-+date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>"
-+END LC_TIME
-+
-+LC_MESSAGES
-+% This is the POSIX Locale definition for
-+% the LC_NUMERIC category.
-+%
-+yesexpr "<U005E><U005B><U0079><U0059><U005D>"
-+noexpr "<U005E><U005B><U006E><U004E><U005D>"
-+yesstr "<U0059><U0065><U0073>"
-+nostr "<U004E><U006F>"
-+END LC_MESSAGES
-+
-+LC_PAPER
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_PAPER category.
-+% (A4 paper, this is also used in the built in C/POSIX
-+% locale in glibc/locale/C-paper.c)
-+height 297
-+width 210
-+END LC_PAPER
-+
-+LC_NAME
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_NAME category.
-+% "%p%t%g%t%m%t%f"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-name.c)
-+name_fmt "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
-+<U0025><U006D><U0025><U0074><U0025><U0066>"
-+END LC_NAME
-+
-+LC_ADDRESS
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_ADDRESS category.
-+% "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
-+postal_fmt "<U0025><U0061><U0025><U004E><U0025><U0066><U0025><U004E>/
-+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
-+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
-+<U004E><U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025>/
-+<U004E><U0025><U0063><U0025><U004E>"
-+END LC_ADDRESS
-+
-+LC_TELEPHONE
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_TELEPHONE category.
-+% "+%c %a %l"
-+tel_int_fmt "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
-+<U006C>"
-+% (also used in the built in C/POSIX locale in glibc/locale/C-telephone.c)
-+END LC_TELEPHONE
-+
-+LC_MEASUREMENT
-+% This is the ISO/IEC 14652 "i18n" definition for
-+% the LC_MEASUREMENT category.
-+% (same as in the built in C/POSIX locale in glibc/locale/C-measurement.c)
-+%metric
-+measurement 1
-+END LC_MEASUREMENT
-+
---
-2.31.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-01-04 11:00 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-01-04 11:00 UTC (permalink / raw
To: gentoo-commits
commit: fb003cf688e133a0fe792bee345b400735b7c333
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 4 10:58:39 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Tue Jan 4 10:58:39 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=fb003cf6
Add patch series from azanella to fix 32bit qemu on 64bit filesystem regression
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...t-skip-entries-with-zero-d_ino-values-BZ-.patch | 182 ++++++++
...2-linux-Use-getdents64-on-non-LFS-readdir.patch | 204 +++++++++
...nternal-DIR-filepos-as-off64_t-BZ-23960-B.patch | 494 +++++++++++++++++++++
9999/0204-linux-Add-__readdir64_unlocked.patch | 181 ++++++++
9999/0205-linux-Add-__old_readdir64_unlocked.patch | 184 ++++++++
...etdents64-on-readdir64-compat-implementat.patch | 297 +++++++++++++
9999/0207-dirent-Deprecate-getdirentries.patch | 101 +++++
7 files changed, 1643 insertions(+)
diff --git a/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch b/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
new file mode 100644
index 0000000..5325a91
--- /dev/null
+++ b/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
@@ -0,0 +1,182 @@
+From 7856a2b7ae88602bc9ee65e08fe652b6a6ad5f7e Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 20 Oct 2020 12:18:56 -0300
+Subject: [PATCH 1/7] linux: Do not skip entries with zero d_ino values [BZ
+ #12165]
+
+According to Linux commit 2adc376c55194 (vfs: avoid creation of inode
+number 0 in get_next_ino) Linux did not treat d_ino == 0 as a special
+case (it is a valid inode number).
+
+This patch fixes readdir{64} by not ignoring entried with d_ino being
+0.
+
+Checked on x86_64-linux-gnu and i686-linux-gnu.
+---
+ sysdeps/unix/sysv/linux/readdir.c | 59 +++++++++++------------------
+ sysdeps/unix/sysv/linux/readdir64.c | 59 +++++++++++------------------
+ 2 files changed, 44 insertions(+), 74 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
+index b480135164..c0619ce06f 100644
+--- a/sysdeps/unix/sysv/linux/readdir.c
++++ b/sysdeps/unix/sysv/linux/readdir.c
+@@ -25,51 +25,36 @@
+ struct dirent *
+ __readdir_unlocked (DIR *dirp)
+ {
+- struct dirent *dp;
+- int saved_errno = errno;
++ const int saved_errno = errno;
+
+- do
++ if (dirp->offset >= dirp->size)
+ {
+- size_t reclen;
+-
+- if (dirp->offset >= dirp->size)
++ /* We've emptied out our buffer. Refill it. */
++ ssize_t bytes = __getdents (dirp->fd, dirp->data, dirp->allocation);
++ if (bytes <= 0)
+ {
+- /* We've emptied out our buffer. Refill it. */
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- bytes = __getdents (dirp->fd, dirp->data, maxread);
+- if (bytes <= 0)
+- {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- bytes = 0;
+-
+- /* Don't modifiy errno when reaching EOF. */
+- if (bytes == 0)
+- __set_errno (saved_errno);
+- dp = NULL;
+- break;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
++ /* On some systems getdents fails with ENOENT when the
++ open directory has been rmdir'd already. POSIX.1
++ requires that we treat this condition like normal EOF. */
++ if (bytes < 0 && errno == ENOENT)
++ bytes = 0;
++
++ /* Don't modifiy errno when reaching EOF. */
++ if (bytes == 0)
++ __set_errno (saved_errno);
++ return NULL;
+ }
++ dirp->size = bytes;
+
+- dp = (struct dirent *) &dirp->data[dirp->offset];
+-
+- reclen = dp->d_reclen;
++ /* Reset the offset into the buffer. */
++ dirp->offset = 0;
++ }
+
+- dirp->offset += reclen;
++ struct dirent *dp = (struct dirent *) &dirp->data[dirp->offset];
+
+- dirp->filepos = dp->d_off;
++ dirp->offset += dp->d_reclen;
+
+- /* Skip deleted files. */
+- } while (dp->d_ino == 0);
++ dirp->filepos = dp->d_off;
+
+ return dp;
+ }
+diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
+index 52b11eb9d9..3aea0b1df1 100644
+--- a/sysdeps/unix/sysv/linux/readdir64.c
++++ b/sysdeps/unix/sysv/linux/readdir64.c
+@@ -30,55 +30,40 @@
+ struct dirent64 *
+ __readdir64 (DIR *dirp)
+ {
+- struct dirent64 *dp;
+- int saved_errno = errno;
++ const int saved_errno = errno;
+
+ #if IS_IN (libc)
+ __libc_lock_lock (dirp->lock);
+ #endif
+
+- do
++ if (dirp->offset >= dirp->size)
+ {
+- size_t reclen;
+-
+- if (dirp->offset >= dirp->size)
++ /* We've emptied out our buffer. Refill it. */
++ ssize_t bytes = __getdents64 (dirp->fd, dirp->data, dirp->allocation);
++ if (bytes <= 0)
+ {
+- /* We've emptied out our buffer. Refill it. */
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- bytes = __getdents64 (dirp->fd, dirp->data, maxread);
+- if (bytes <= 0)
+- {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- bytes = 0;
+-
+- /* Don't modifiy errno when reaching EOF. */
+- if (bytes == 0)
+- __set_errno (saved_errno);
+- dp = NULL;
+- break;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
++ /* On some systems getdents fails with ENOENT when the
++ open directory has been rmdir'd already. POSIX.1
++ requires that we treat this condition like normal EOF. */
++ if (bytes < 0 && errno == ENOENT)
++ bytes = 0;
++
++ /* Don't modifiy errno when reaching EOF. */
++ if (bytes == 0)
++ __set_errno (saved_errno);
++ return NULL;
+ }
++ dirp->size = bytes;
+
+- dp = (struct dirent64 *) &dirp->data[dirp->offset];
+-
+- reclen = dp->d_reclen;
++ /* Reset the offset into the buffer. */
++ dirp->offset = 0;
++ }
+
+- dirp->offset += reclen;
++ struct dirent64 *dp = (struct dirent64 *) &dirp->data[dirp->offset];
+
+- dirp->filepos = dp->d_off;
++ dirp->offset += dp->d_reclen;
+
+- /* Skip deleted files. */
+- } while (dp->d_ino == 0);
++ dirp->filepos = dp->d_off;
+
+ #if IS_IN (libc)
+ __libc_lock_unlock (dirp->lock);
+--
+2.32.0
+
diff --git a/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
new file mode 100644
index 0000000..90910a6
--- /dev/null
+++ b/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -0,0 +1,204 @@
+From 5180512e6c81b1b0423572594983c74c499b7e1e Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 20 Oct 2020 13:37:15 -0300
+Subject: [PATCH 2/7] linux: Use getdents64 on non-LFS readdir
+
+The opendir allocates a translation buffer to be used to return the
+non-LFS readdir entry. The obtained dirent64 struct is translated
+to the temporary buffer on each readdir call.
+
+Entries that overflow d_off/d_ino and the buffer reallocation failure
+(in case of large d_name) are ignored.
+
+Checked on x86_64-linux-gnu and i686-linux-gnu.
+---
+ sysdeps/unix/sysv/linux/closedir.c | 4 ++
+ sysdeps/unix/sysv/linux/dirstream.h | 5 ++
+ sysdeps/unix/sysv/linux/opendir.c | 21 +++++++
+ sysdeps/unix/sysv/linux/readdir.c | 97 +++++++++++++++++++++--------
+ 4 files changed, 101 insertions(+), 26 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
+index 4bb5274b00..1f71445ad9 100644
+--- a/sysdeps/unix/sysv/linux/closedir.c
++++ b/sysdeps/unix/sysv/linux/closedir.c
+@@ -47,6 +47,10 @@ __closedir (DIR *dirp)
+ __libc_lock_fini (dirp->lock);
+ #endif
+
++#if !_DIRENT_MATCHES_DIRENT64
++ free (dirp->tbuffer);
++#endif
++
+ free ((void *) dirp);
+
+ return __close_nocancel (fd);
+diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
+index b5e1db8db0..64b1495ba0 100644
+--- a/sysdeps/unix/sysv/linux/dirstream.h
++++ b/sysdeps/unix/sysv/linux/dirstream.h
+@@ -41,6 +41,11 @@ struct __dirstream
+
+ int errcode; /* Delayed error code. */
+
++#if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
++ char *tbuffer; /* Translation buffer for non-LFS calls. */
++ size_t tbuffer_size; /* Size of translation buffer. */
++#endif
++
+ /* Directory block. We must make sure that this block starts
+ at an address that is aligned adequately enough to store
+ dirent entries. Using the alignment of "void *" is not
+diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
+index 48f254d169..d7df13575e 100644
+--- a/sysdeps/unix/sysv/linux/opendir.c
++++ b/sysdeps/unix/sysv/linux/opendir.c
+@@ -120,6 +120,27 @@ __alloc_dir (int fd, bool close_fd, int flags,
+ return NULL;
+ }
+
++#if !_DIRENT_MATCHES_DIRENT64
++ /* Allocates a translation buffer to use as the returned 'struct direct'
++ for non-LFS 'readdir' calls.
++
++ The initial NAME_MAX size should handle most cases, while readdir might
++ expand the buffer if required. */
++ enum
++ {
++ tbuffer_size = sizeof (struct dirent) + NAME_MAX + 1
++ };
++ dirp->tbuffer = malloc (tbuffer_size);
++ if (dirp->tbuffer == NULL)
++ {
++ free (dirp);
++ if (close_fd)
++ __close_nocancel_nostatus (fd);
++ return NULL;
++ }
++ dirp->tbuffer_size = tbuffer_size;
++#endif
++
+ dirp->fd = fd;
+ #if IS_IN (libc)
+ __libc_lock_init (dirp->lock);
+diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
+index c0619ce06f..8647bb0aef 100644
+--- a/sysdeps/unix/sysv/linux/readdir.c
++++ b/sysdeps/unix/sysv/linux/readdir.c
+@@ -21,42 +21,87 @@
+ #if !_DIRENT_MATCHES_DIRENT64
+ #include <dirstream.h>
+
++/* Translate the DP64 entry to the non-LFS one in the translation buffer
++ at dirstream DS. Return true is the translation was possible or
++ false if either an internal fields can be represented in the non-LFS
++ entry or if the translation can not be resized. */
++static bool
++dirstream_entry (struct __dirstream *ds, const struct dirent64 *dp64)
++{
++ off_t d_off = dp64->d_off;
++ if (d_off != dp64->d_off)
++ return false;
++ ino_t d_ino = dp64->d_ino;
++ if (d_ino != dp64->d_ino)
++ return false;
++
++ /* Expand the translation buffer to hold the new name size. */
++ size_t new_reclen = sizeof (struct dirent)
++ + dp64->d_reclen - offsetof (struct dirent64, d_name);
++ if (new_reclen > ds->tbuffer_size)
++ {
++ char *newbuffer = realloc (ds->tbuffer, new_reclen);
++ if (newbuffer == NULL)
++ return false;
++ ds->tbuffer = newbuffer;
++ ds->tbuffer_size = new_reclen;
++ }
++
++ struct dirent *dp = (struct dirent *) ds->tbuffer;
++
++ dp->d_off = d_off;
++ dp->d_ino = d_ino;
++ dp->d_reclen = new_reclen;
++ dp->d_type = dp64->d_type;
++ memcpy (dp->d_name, dp64->d_name,
++ dp64->d_reclen - offsetof (struct dirent64, d_name));
++
++ return true;
++}
++
+ /* Read a directory entry from DIRP. */
+ struct dirent *
+ __readdir_unlocked (DIR *dirp)
+ {
+ const int saved_errno = errno;
+
+- if (dirp->offset >= dirp->size)
++ while (1)
+ {
+- /* We've emptied out our buffer. Refill it. */
+- ssize_t bytes = __getdents (dirp->fd, dirp->data, dirp->allocation);
+- if (bytes <= 0)
++ if (dirp->offset >= dirp->size)
+ {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- bytes = 0;
+-
+- /* Don't modifiy errno when reaching EOF. */
+- if (bytes == 0)
+- __set_errno (saved_errno);
+- return NULL;
++ /* We've emptied out our buffer. Refill it. */
++ ssize_t bytes = __getdents64 (dirp->fd, dirp->data,
++ dirp->allocation);
++ if (bytes <= 0)
++ {
++ /* On some systems getdents fails with ENOENT when the
++ open directory has been rmdir'd already. POSIX.1
++ requires that we treat this condition like normal EOF. */
++ if (bytes < 0 && errno == ENOENT)
++ bytes = 0;
++
++ /* Don't modifiy errno when reaching EOF. */
++ if (bytes == 0)
++ __set_errno (saved_errno);
++ return NULL;
++ }
++ dirp->size = bytes;
++
++ /* Reset the offset into the buffer. */
++ dirp->offset = 0;
++ }
++
++ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
++ dirp->offset += dp64->d_reclen;
++
++ /* Skip entries which might overflow d_off/d_ino or if the translation
++ buffer can't be resized. */
++ if (dirstream_entry (dirp, dp64))
++ {
++ dirp->filepos = dp64->d_off;
++ return (struct dirent *) dirp->tbuffer;
+ }
+- dirp->size = bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
+ }
+-
+- struct dirent *dp = (struct dirent *) &dirp->data[dirp->offset];
+-
+- dirp->offset += dp->d_reclen;
+-
+- dirp->filepos = dp->d_off;
+-
+- return dp;
+ }
+
+ struct dirent *
+--
+2.32.0
+
diff --git a/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
new file mode 100644
index 0000000..06e8d14
--- /dev/null
+++ b/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -0,0 +1,494 @@
+From 7d2845e6ed10f2109d2e0f6432932b6693f0037d Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 13 Apr 2020 18:09:20 -0300
+Subject: [PATCH 3/7] linux: Set internal DIR filepos as off64_t [BZ #23960, BZ
+ #24050]
+
+It allows to obtain the expected entry offset on telldir and set
+it correctly on seekdir on platforms where long int is smaller
+than off64_t.
+
+On such cases telldir will mantain an internal list that maps the
+DIR object off64_t offsets to the returned long int (the function
+return value). The seekdir will then set the correct offset from
+the internal list using the telldir as the list key.
+
+It also removes the overflow check on readdir and the returned value
+will be truncated by the non-LFS off_t size. As Joseph has noted
+in BZ #23960 comment #22, d_off is an opaque value and since
+telldir/seekdir works regardless of the returned dirent d_off value.
+
+Finally it removed the requirement to check for overflow values on
+telldir (BZ #24050).
+
+Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu,
+and arm-linux-gnueabihf.
+---
+ dirent/Makefile | 2 +-
+ dirent/tst-seekdir2.c | 158 ++++++++++++++++++++++++++++
+ sysdeps/unix/sysv/linux/closedir.c | 4 +
+ sysdeps/unix/sysv/linux/dirstream.h | 6 +-
+ sysdeps/unix/sysv/linux/opendir.c | 3 +
+ sysdeps/unix/sysv/linux/readdir.c | 1 +
+ sysdeps/unix/sysv/linux/rewinddir.c | 5 +
+ sysdeps/unix/sysv/linux/seekdir.c | 36 ++++++-
+ sysdeps/unix/sysv/linux/telldir.c | 47 ++++++++-
+ sysdeps/unix/sysv/linux/telldir.h | 64 +++++++++++
+ 10 files changed, 317 insertions(+), 9 deletions(-)
+ create mode 100644 dirent/tst-seekdir2.c
+ create mode 100644 sysdeps/unix/sysv/linux/telldir.h
+
+diff --git a/dirent/Makefile b/dirent/Makefile
+index afc7226a5b..c7f046b3f7 100644
+--- a/dirent/Makefile
++++ b/dirent/Makefile
+@@ -31,7 +31,7 @@ routines := opendir closedir readdir readdir_r rewinddir \
+ scandir-cancel scandir-tail scandir64-tail
+
+ tests := list tst-seekdir opendir-tst1 bug-readdir1 tst-fdopendir \
+- tst-fdopendir2 tst-scandir tst-scandir64
++ tst-fdopendir2 tst-scandir tst-scandir64 tst-seekdir2
+
+ CFLAGS-scandir.c += $(uses-callbacks)
+ CFLAGS-scandir64.c += $(uses-callbacks)
+diff --git a/dirent/tst-seekdir2.c b/dirent/tst-seekdir2.c
+new file mode 100644
+index 0000000000..3e01b361e5
+--- /dev/null
++++ b/dirent/tst-seekdir2.c
+@@ -0,0 +1,158 @@
++/* Check multiple telldir and seekdir.
++ Copyright (C) 2020 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include <dirent.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <stdio.h>
++#include <string.h>
++
++#include <support/temp_file.h>
++#include <support/support.h>
++#include <support/check.h>
++
++/* Some filesystems returns a arbitrary value for d_off direnty entry (ext4
++ for instance, where the value is an internal hash key). The idea of
++ create a large number of file is to try trigger a overflow d_off value
++ in a entry to check if telldir/seekdir does work corretly in such
++ case. */
++static const char *dirname;
++static const size_t nfiles = 10240;
++
++static void
++do_prepare (int argc, char *argv[])
++{
++ dirname = support_create_temp_directory ("tst-seekdir2-");
++
++ for (size_t i = 0; i < nfiles; i++)
++ {
++ int fd = create_temp_file_in_dir ("tempfile.", dirname, NULL);
++ TEST_VERIFY_EXIT (fd > 0);
++ close (fd);
++ }
++}
++#define PREPARE do_prepare
++
++/* Check for old non Large File Support (LFS). */
++static int
++do_test_not_lfs (void)
++{
++ DIR *dirp = opendir (dirname);
++ TEST_VERIFY_EXIT (dirp != NULL);
++
++ size_t dirp_count = 0;
++ for (struct dirent *dp = readdir (dirp);
++ dp != NULL;
++ dp = readdir (dirp))
++ dirp_count++;
++
++ /* The 2 extra files are '.' and '..'. */
++ TEST_COMPARE (dirp_count, nfiles + 2);
++
++ rewinddir (dirp);
++
++ long *tdirp = xmalloc (dirp_count * sizeof (long));
++ struct dirent **ddirp = xmalloc (dirp_count * sizeof (struct dirent *));
++
++ size_t i = 0;
++ do
++ {
++ tdirp[i] = telldir (dirp);
++ struct dirent *dp = readdir (dirp);
++ TEST_VERIFY_EXIT (dp != NULL);
++ ddirp[i] = xmalloc (dp->d_reclen);
++ memcpy (ddirp[i], dp, dp->d_reclen);
++ } while (++i < dirp_count);
++
++ for (i = 0; i < dirp_count - 1; i++)
++ {
++ seekdir (dirp, tdirp[i]);
++ struct dirent *dp = readdir (dirp);
++ TEST_COMPARE (strcmp (dp->d_name, ddirp[i]->d_name), 0);
++ TEST_COMPARE (dp->d_ino, ddirp[i]->d_ino);
++ TEST_COMPARE (dp->d_off, ddirp[i]->d_off);
++ }
++
++ closedir (dirp);
++ free (tdirp);
++ for (i = 0; i < dirp_count; i++)
++ free (ddirp[i]);
++ free (ddirp);
++
++ return 0;
++}
++
++/* Same as before but with LFS support. */
++static int
++do_test_lfs (void)
++{
++ DIR *dirp = opendir (dirname);
++ TEST_VERIFY_EXIT (dirp != NULL);
++
++ size_t dirp_count = 0;
++ for (struct dirent64 * dp = readdir64 (dirp);
++ dp != NULL;
++ dp = readdir64 (dirp))
++ dirp_count++;
++
++ /* The 2 extra files are '.' and '..'. */
++ TEST_COMPARE (dirp_count, nfiles + 2);
++
++ rewinddir (dirp);
++
++ long *tdirp = xmalloc (dirp_count * sizeof (long));
++ struct dirent64 **ddirp = xmalloc (dirp_count * sizeof (struct dirent64 *));
++
++ size_t i = 0;
++ do
++ {
++ tdirp[i] = telldir (dirp);
++ struct dirent64 *dp = readdir64 (dirp);
++ TEST_VERIFY_EXIT (dp != NULL);
++ ddirp[i] = xmalloc (dp->d_reclen);
++ memcpy (ddirp[i], dp, dp->d_reclen);
++ } while (++i < dirp_count);
++
++ for (i = 0; i < dirp_count - 1; i++)
++ {
++ seekdir (dirp, tdirp[i]);
++ struct dirent64 *dp = readdir64 (dirp);
++ TEST_COMPARE (strcmp (dp->d_name, ddirp[i]->d_name), 0);
++ TEST_COMPARE (dp->d_ino, ddirp[i]->d_ino);
++ TEST_COMPARE (dp->d_off, ddirp[i]->d_off);
++ }
++
++ closedir (dirp);
++ free (tdirp);
++ for (i = 0; i < dirp_count; i++)
++ free (ddirp[i]);
++ free (ddirp);
++
++ return 0;
++}
++
++static int
++do_test (void)
++{
++ do_test_not_lfs ();
++ do_test_lfs ();
++
++ return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
+index 1f71445ad9..1845c48be0 100644
+--- a/sysdeps/unix/sysv/linux/closedir.c
++++ b/sysdeps/unix/sysv/linux/closedir.c
+@@ -43,6 +43,10 @@ __closedir (DIR *dirp)
+
+ fd = dirp->fd;
+
++#ifndef __LP64__
++ dirstream_loc_clear (&dirp->locs);
++#endif
++
+ #if IS_IN (libc)
+ __libc_lock_fini (dirp->lock);
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
+index 64b1495ba0..1a3362fda6 100644
+--- a/sysdeps/unix/sysv/linux/dirstream.h
++++ b/sysdeps/unix/sysv/linux/dirstream.h
+@@ -21,6 +21,7 @@
+ #include <sys/types.h>
+
+ #include <libc-lock.h>
++#include <telldir.h>
+
+ /* Directory stream type.
+
+@@ -37,7 +38,7 @@ struct __dirstream
+ size_t size; /* Total valid data in the block. */
+ size_t offset; /* Current offset into the block. */
+
+- off_t filepos; /* Position of next entry to read. */
++ off64_t filepos; /* Position of next entry to read. */
+
+ int errcode; /* Delayed error code. */
+
+@@ -45,6 +46,9 @@ struct __dirstream
+ char *tbuffer; /* Translation buffer for non-LFS calls. */
+ size_t tbuffer_size; /* Size of translation buffer. */
+ #endif
++#ifndef __LP64__
++ struct dirstream_loc_t locs; /* off64_t to long int map for telldir. */
++#endif
+
+ /* Directory block. We must make sure that this block starts
+ at an address that is aligned adequately enough to store
+diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
+index d7df13575e..56365f9da5 100644
+--- a/sysdeps/unix/sysv/linux/opendir.c
++++ b/sysdeps/unix/sysv/linux/opendir.c
+@@ -150,6 +150,9 @@ __alloc_dir (int fd, bool close_fd, int flags,
+ dirp->offset = 0;
+ dirp->filepos = 0;
+ dirp->errcode = 0;
++#ifndef __LP64__
++ dirstream_loc_init (&dirp->locs);
++#endif
+
+ return dirp;
+ }
+diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
+index 8647bb0aef..b26d2756b9 100644
+--- a/sysdeps/unix/sysv/linux/readdir.c
++++ b/sysdeps/unix/sysv/linux/readdir.c
+@@ -17,6 +17,7 @@
+ <https://www.gnu.org/licenses/>. */
+
+ #include <dirent.h>
++#include <unistd.h>
+
+ #if !_DIRENT_MATCHES_DIRENT64
+ #include <dirstream.h>
+diff --git a/sysdeps/unix/sysv/linux/rewinddir.c b/sysdeps/unix/sysv/linux/rewinddir.c
+index 5b68db7167..74b336bfd8 100644
+--- a/sysdeps/unix/sysv/linux/rewinddir.c
++++ b/sysdeps/unix/sysv/linux/rewinddir.c
+@@ -33,6 +33,11 @@ __rewinddir (DIR *dirp)
+ dirp->offset = 0;
+ dirp->size = 0;
+ dirp->errcode = 0;
++
++#ifndef __LP64__
++ dirstream_loc_clear (&dirp->locs);
++#endif
++
+ #if IS_IN (libc)
+ __libc_lock_unlock (dirp->lock);
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/seekdir.c b/sysdeps/unix/sysv/linux/seekdir.c
+index b128ae8e76..2fcf689dc0 100644
+--- a/sysdeps/unix/sysv/linux/seekdir.c
++++ b/sysdeps/unix/sysv/linux/seekdir.c
+@@ -22,14 +22,40 @@
+ #include <dirstream.h>
+
+ /* Seek to position POS in DIRP. */
+-/* XXX should be __seekdir ? */
+ void
+ seekdir (DIR *dirp, long int pos)
+ {
++ off64_t filepos;
++
+ __libc_lock_lock (dirp->lock);
+- (void) __lseek (dirp->fd, pos, SEEK_SET);
+- dirp->size = 0;
+- dirp->offset = 0;
+- dirp->filepos = pos;
++
++#ifndef __LP64__
++ union dirstream_packed dsp;
++
++ dsp.l = pos;
++
++ if (dsp.p.is_packed == 1)
++ filepos = dsp.p.info;
++ else
++ {
++ size_t index = dsp.p.info;
++
++ if (index >= dirstream_loc_size (&dirp->locs))
++ return;
++ struct dirstream_loc *loc = dirstream_loc_at (&dirp->locs, index);
++ filepos = loc->filepos;
++ }
++#else
++ filepos = pos;
++#endif
++
++ if (dirp->filepos != filepos)
++ {
++ __lseek64 (dirp->fd, filepos, SEEK_SET);
++ dirp->filepos = filepos;
++ dirp->offset = 0;
++ dirp->size = 0;
++ }
++
+ __libc_lock_unlock (dirp->lock);
+ }
+diff --git a/sysdeps/unix/sysv/linux/telldir.c b/sysdeps/unix/sysv/linux/telldir.c
+index b184db8d2c..a0eb1efeff 100644
+--- a/sysdeps/unix/sysv/linux/telldir.c
++++ b/sysdeps/unix/sysv/linux/telldir.c
+@@ -18,16 +18,59 @@
+ #include <dirent.h>
+
+ #include <dirstream.h>
++#include <telldir.h>
+
+ /* Return the current position of DIRP. */
+ long int
+ telldir (DIR *dirp)
+ {
+- long int ret;
++#ifndef __LP64__
++ /* If the directory position fits in the packet structure returns it.
++ Otherwise, check if the position is already been recorded in the
++ dynamic array. If not, add the new record. */
++
++ union dirstream_packed dsp;
++ size_t i;
+
+ __libc_lock_lock (dirp->lock);
+- ret = dirp->filepos;
++
++ if (dirp->filepos < (1U << 31))
++ {
++ dsp.p.is_packed = 1;
++ dsp.p.info = dirp->filepos;
++ goto out;
++ }
++
++ dsp.l = -1;
++
++ for (i = 0; i < dirstream_loc_size (&dirp->locs); i++)
++ {
++ struct dirstream_loc *loc = dirstream_loc_at (&dirp->locs, i);
++ if (loc->filepos == dirp->filepos)
++ break;
++ }
++ if (i == dirstream_loc_size (&dirp->locs))
++ {
++ dirstream_loc_add (&dirp->locs,
++ (struct dirstream_loc) { dirp->filepos });
++ if (dirstream_loc_has_failed (&dirp->locs))
++ goto out;
++ }
++
++ dsp.p.is_packed = 0;
++ /* This assignment might overflow, however most likely ENOMEM would happen
++ long before. */
++ dsp.p.info = i;
++
++out:
+ __libc_lock_unlock (dirp->lock);
+
++ return dsp.l;
++#else
++ long int ret;
++ __libc_lock_lock (dirp->lock);
++ ret = dirp->filepos;
++ __libc_lock_unlock (dirp->lock);
+ return ret;
++#endif
+ }
+diff --git a/sysdeps/unix/sysv/linux/telldir.h b/sysdeps/unix/sysv/linux/telldir.h
+new file mode 100644
+index 0000000000..7c45886341
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/telldir.h
+@@ -0,0 +1,64 @@
++/* Linux internal telldir definitions.
++ Copyright (C) 2020 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#ifndef _TELLDIR_H
++#define _TELLDIR_H 1
++
++#ifndef __LP64__
++
++/* On platforms where long int is smaller than off64_t this is how the
++ returned value is encoded and returned by 'telldir'. If the directory
++ offset can be enconded in 31 bits it is returned in the 'info' member
++ with 'is_packed' set to 1.
++
++ Otherwise, the 'info' member describes an index in a dynamic array at
++ 'DIR' structure. */
++
++union dirstream_packed
++{
++ long int l;
++ struct
++ {
++ unsigned long is_packed:1;
++ unsigned long info:31;
++ } p;
++};
++
++_Static_assert (sizeof (long int) == sizeof (union dirstream_packed),
++ "sizeof (long int) != sizeof (union dirstream_packed)");
++
++/* telldir will mantain a list of offsets that describe the obtained diretory
++ position if it can fit this information in the returned 'dirstream_packed'
++ struct. */
++
++struct dirstream_loc
++{
++ off64_t filepos;
++};
++
++# define DYNARRAY_STRUCT dirstream_loc_t
++# define DYNARRAY_ELEMENT struct dirstream_loc
++# define DYNARRAY_PREFIX dirstream_loc_
++# include <malloc/dynarray-skeleton.c>
++#else
++
++_Static_assert (sizeof (long int) == sizeof (off64_t),
++ "sizeof (long int) != sizeof (off64_t)");
++#endif /* __LP64__ */
++
++#endif /* _TELLDIR_H */
+--
+2.32.0
+
diff --git a/9999/0204-linux-Add-__readdir64_unlocked.patch b/9999/0204-linux-Add-__readdir64_unlocked.patch
new file mode 100644
index 0000000..29609dd
--- /dev/null
+++ b/9999/0204-linux-Add-__readdir64_unlocked.patch
@@ -0,0 +1,181 @@
+From 1524804c8133564c204340a0d618f04c585d7706 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 13 Apr 2020 08:35:40 -0300
+Subject: [PATCH 4/7] linux: Add __readdir64_unlocked
+
+And use it on readdir_r implementation.
+
+Checked on i686-linux-gnu.
+---
+ include/dirent.h | 1 +
+ sysdeps/unix/sysv/linux/readdir64.c | 20 +++++--
+ sysdeps/unix/sysv/linux/readdir64_r.c | 80 ++++++---------------------
+ 3 files changed, 33 insertions(+), 68 deletions(-)
+
+diff --git a/include/dirent.h b/include/dirent.h
+index d7567f5e86..0c6715d0e4 100644
+--- a/include/dirent.h
++++ b/include/dirent.h
+@@ -21,6 +21,7 @@ extern DIR *__fdopendir (int __fd) attribute_hidden;
+ extern int __closedir (DIR *__dirp) attribute_hidden;
+ extern struct dirent *__readdir (DIR *__dirp) attribute_hidden;
+ extern struct dirent *__readdir_unlocked (DIR *__dirp) attribute_hidden;
++extern struct dirent64 *__readdir64_unlocked (DIR *__dirp) attribute_hidden;
+ extern struct dirent64 *__readdir64 (DIR *__dirp);
+ libc_hidden_proto (__readdir64)
+ extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
+diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
+index 3aea0b1df1..5519487ede 100644
+--- a/sysdeps/unix/sysv/linux/readdir64.c
++++ b/sysdeps/unix/sysv/linux/readdir64.c
+@@ -28,14 +28,10 @@
+
+ /* Read a directory entry from DIRP. */
+ struct dirent64 *
+-__readdir64 (DIR *dirp)
++__readdir64_unlocked (DIR *dirp)
+ {
+ const int saved_errno = errno;
+
+-#if IS_IN (libc)
+- __libc_lock_lock (dirp->lock);
+-#endif
+-
+ if (dirp->offset >= dirp->size)
+ {
+ /* We've emptied out our buffer. Refill it. */
+@@ -65,6 +61,20 @@ __readdir64 (DIR *dirp)
+
+ dirp->filepos = dp->d_off;
+
++ return dp;
++}
++
++struct dirent64 *
++__readdir64 (DIR *dirp)
++{
++ struct dirent64 *dp;
++
++#if IS_IN (libc)
++ __libc_lock_lock (dirp->lock);
++#endif
++
++ dp = __readdir64_unlocked (dirp);
++
+ #if IS_IN (libc)
+ __libc_lock_unlock (dirp->lock);
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
+index 073a6453d1..058d401279 100644
+--- a/sysdeps/unix/sysv/linux/readdir64_r.c
++++ b/sysdeps/unix/sysv/linux/readdir64_r.c
+@@ -32,89 +32,43 @@ __readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
+ {
+ struct dirent64 *dp;
+ size_t reclen;
+- const int saved_errno = errno;
+- int ret;
+
+ __libc_lock_lock (dirp->lock);
+-
+- do
++ while (1)
+ {
+- if (dirp->offset >= dirp->size)
+- {
+- /* We've emptied out our buffer. Refill it. */
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- maxread = dirp->allocation;
+-
+- bytes = __getdents64 (dirp->fd, dirp->data, maxread);
+- if (bytes <= 0)
+- {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- {
+- bytes = 0;
+- __set_errno (saved_errno);
+- }
+- if (bytes < 0)
+- dirp->errcode = errno;
+-
+- dp = NULL;
+- break;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
+- }
+-
+- dp = (struct dirent64 *) &dirp->data[dirp->offset];
++ dp = __readdir64_unlocked (dirp);
++ if (dp == NULL)
++ break;
+
+ reclen = dp->d_reclen;
++ if (reclen <= offsetof (struct dirent64, d_name) + NAME_MAX + 1)
++ break;
+
+- dirp->offset += reclen;
+-
+- dirp->filepos = dp->d_off;
+-
+- if (reclen > offsetof (struct dirent64, d_name) + NAME_MAX + 1)
++ /* The record is very long. It could still fit into the caller-supplied
++ buffer if we can skip padding at the end. */
++ size_t namelen = _D_EXACT_NAMLEN (dp);
++ if (namelen <= NAME_MAX)
+ {
+- /* The record is very long. It could still fit into the
+- caller-supplied buffer if we can skip padding at the
+- end. */
+- size_t namelen = _D_EXACT_NAMLEN (dp);
+- if (namelen <= NAME_MAX)
+- reclen = offsetof (struct dirent64, d_name) + namelen + 1;
+- else
+- {
+- /* The name is too long. Ignore this file. */
+- dirp->errcode = ENAMETOOLONG;
+- dp->d_ino = 0;
+- continue;
+- }
++ reclen = offsetof (struct dirent64, d_name) + namelen + 1;
++ break;
+ }
+
+- /* Skip deleted and ignored files. */
++ /* The name is too long. Ignore this file. */
++ dirp->errcode = ENAMETOOLONG;
++ dp->d_ino = 0;
+ }
+- while (dp->d_ino == 0);
+
+ if (dp != NULL)
+ {
+ *result = memcpy (entry, dp, reclen);
+ entry->d_reclen = reclen;
+- ret = 0;
+ }
+ else
+- {
+- *result = NULL;
+- ret = dirp->errcode;
+- }
++ *result = NULL;
+
+ __libc_lock_unlock (dirp->lock);
+
+- return ret;
++ return dp != NULL ? 0 : dirp->errcode;
+ }
+
+
+--
+2.32.0
+
diff --git a/9999/0205-linux-Add-__old_readdir64_unlocked.patch b/9999/0205-linux-Add-__old_readdir64_unlocked.patch
new file mode 100644
index 0000000..c1ccb61
--- /dev/null
+++ b/9999/0205-linux-Add-__old_readdir64_unlocked.patch
@@ -0,0 +1,184 @@
+From f16c3815c6ad46450d6e58e179ddf494c52a98a4 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 14 Apr 2020 11:14:22 -0300
+Subject: [PATCH 5/7] linux: Add __old_readdir64_unlocked
+
+And use it __old_readdir64_r.
+
+Checked on i686-linux-gnu.
+---
+ sysdeps/unix/sysv/linux/olddirent.h | 2 +
+ sysdeps/unix/sysv/linux/readdir64.c | 21 +++++--
+ sysdeps/unix/sysv/linux/readdir64_r.c | 79 ++++++---------------------
+ 3 files changed, 35 insertions(+), 67 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
+index 3e672d47f5..42ab593c4d 100644
+--- a/sysdeps/unix/sysv/linux/olddirent.h
++++ b/sysdeps/unix/sysv/linux/olddirent.h
+@@ -32,6 +32,8 @@ struct __old_dirent64
+ /* Now define the internal interfaces. */
+ extern struct __old_dirent64 *__old_readdir64 (DIR *__dirp);
+ libc_hidden_proto (__old_readdir64);
++extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
++ attribute_hidden;
+ extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
+ struct __old_dirent64 **__result);
+ extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
+diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
+index 5519487ede..8869e49150 100644
+--- a/sysdeps/unix/sysv/linux/readdir64.c
++++ b/sysdeps/unix/sysv/linux/readdir64.c
+@@ -101,15 +101,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+
+ attribute_compat_text_section
+ struct __old_dirent64 *
+-__old_readdir64 (DIR *dirp)
++__old_readdir64_unlocked (DIR *dirp)
+ {
+ struct __old_dirent64 *dp;
+ int saved_errno = errno;
+
+-#if IS_IN (libc)
+- __libc_lock_lock (dirp->lock);
+-#endif
+-
+ do
+ {
+ size_t reclen;
+@@ -153,6 +149,21 @@ __old_readdir64 (DIR *dirp)
+ /* Skip deleted files. */
+ } while (dp->d_ino == 0);
+
++ return dp;
++}
++
++attribute_compat_text_section
++struct __old_dirent64 *
++__old_readdir64 (DIR *dirp)
++{
++ struct __old_dirent64 *dp;
++
++#if IS_IN (libc)
++ __libc_lock_lock (dirp->lock);
++#endif
++
++ dp = __old_readdir64_unlocked (dirp);
++
+ #if IS_IN (libc)
+ __libc_lock_unlock (dirp->lock);
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
+index 058d401279..e4a0baeaf7 100644
+--- a/sysdeps/unix/sysv/linux/readdir64_r.c
++++ b/sysdeps/unix/sysv/linux/readdir64_r.c
+@@ -91,89 +91,44 @@ __old_readdir64_r (DIR *dirp, struct __old_dirent64 *entry,
+ {
+ struct __old_dirent64 *dp;
+ size_t reclen;
+- const int saved_errno = errno;
+- int ret;
+
+ __libc_lock_lock (dirp->lock);
+
+- do
++ while (1)
+ {
+- if (dirp->offset >= dirp->size)
+- {
+- /* We've emptied out our buffer. Refill it. */
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- maxread = dirp->allocation;
+-
+- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
+- if (bytes <= 0)
+- {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- {
+- bytes = 0;
+- __set_errno (saved_errno);
+- }
+- if (bytes < 0)
+- dirp->errcode = errno;
+-
+- dp = NULL;
+- break;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
+- }
+-
+- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
++ dp = __old_readdir64_unlocked (dirp);
++ if (dp == NULL)
++ break;
+
+ reclen = dp->d_reclen;
++ if (reclen <= offsetof (struct __old_dirent64, d_name) + NAME_MAX + 1)
++ break;
+
+- dirp->offset += reclen;
+-
+- dirp->filepos = dp->d_off;
+-
+- if (reclen > offsetof (struct __old_dirent64, d_name) + NAME_MAX + 1)
++ /* The record is very long. It could still fit into the caller-supplied
++ buffer if we can skip padding at the end. */
++ size_t namelen = _D_EXACT_NAMLEN (dp);
++ if (namelen <= NAME_MAX)
+ {
+- /* The record is very long. It could still fit into the
+- caller-supplied buffer if we can skip padding at the
+- end. */
+- size_t namelen = _D_EXACT_NAMLEN (dp);
+- if (namelen <= NAME_MAX)
+- reclen = offsetof (struct __old_dirent64, d_name) + namelen + 1;
+- else
+- {
+- /* The name is too long. Ignore this file. */
+- dirp->errcode = ENAMETOOLONG;
+- dp->d_ino = 0;
+- continue;
+- }
++ reclen = offsetof (struct dirent64, d_name) + namelen + 1;
++ break;
+ }
+
+- /* Skip deleted and ignored files. */
++ /* The name is too long. Ignore this file. */
++ dirp->errcode = ENAMETOOLONG;
++ dp->d_ino = 0;
+ }
+- while (dp->d_ino == 0);
+
+ if (dp != NULL)
+ {
+ *result = memcpy (entry, dp, reclen);
+ entry->d_reclen = reclen;
+- ret = 0;
+ }
+ else
+- {
+- *result = NULL;
+- ret = dirp->errcode;
+- }
++ *result = NULL;
+
+ __libc_lock_unlock (dirp->lock);
+
+- return ret;
++ return dp != NULL ? 0 : dirp->errcode;
+ }
+
+ compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
+--
+2.32.0
+
diff --git a/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
new file mode 100644
index 0000000..90f5d89
--- /dev/null
+++ b/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -0,0 +1,297 @@
+From 46b9383118182cb2ac2e81637e00fde6c21097bb Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Tue, 20 Oct 2020 16:00:43 -0300
+Subject: [PATCH 6/7] linux: Use getdents64 on readdir64 compat implementation
+
+It uses a similar strategy from the non-LFS readdir that also
+uses getdents64 internally and uses a translation buffer to return
+the compat readdir64 entry.
+
+It allows to remove __old_getdents64.
+
+Checked on i686-linux-gnu.
+---
+ sysdeps/unix/sysv/linux/getdents64.c | 93 ------------------------
+ sysdeps/unix/sysv/linux/olddirent.h | 2 -
+ sysdeps/unix/sysv/linux/opendir.c | 15 +++-
+ sysdeps/unix/sysv/linux/readdir64.c | 104 +++++++++++++++++----------
+ 4 files changed, 79 insertions(+), 135 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
+index 6323e003b3..38285e9f4b 100644
+--- a/sysdeps/unix/sysv/linux/getdents64.c
++++ b/sysdeps/unix/sysv/linux/getdents64.c
+@@ -36,97 +36,4 @@ weak_alias (__getdents64, getdents64)
+
+ #if _DIRENT_MATCHES_DIRENT64
+ strong_alias (__getdents64, __getdents)
+-#else
+-# include <shlib-compat.h>
+-
+-# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+-# include <olddirent.h>
+-# include <unistd.h>
+-
+-static ssize_t
+-handle_overflow (int fd, __off64_t offset, ssize_t count)
+-{
+- /* If this is the first entry in the buffer, we can report the
+- error. */
+- if (offset == 0)
+- {
+- __set_errno (EOVERFLOW);
+- return -1;
+- }
+-
+- /* Otherwise, seek to the overflowing entry, so that the next call
+- will report the error, and return the data read so far. */
+- if (__lseek64 (fd, offset, SEEK_SET) != 0)
+- return -1;
+- return count;
+-}
+-
+-ssize_t
+-__old_getdents64 (int fd, char *buf, size_t nbytes)
+-{
+- /* We do not move the individual directory entries. This is only
+- possible if the target type (struct __old_dirent64) is smaller
+- than the source type. */
+- _Static_assert (offsetof (struct __old_dirent64, d_name)
+- <= offsetof (struct dirent64, d_name),
+- "__old_dirent64 is larger than dirent64");
+- _Static_assert (__alignof__ (struct __old_dirent64)
+- <= __alignof__ (struct dirent64),
+- "alignment of __old_dirent64 is larger than dirent64");
+-
+- ssize_t retval = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
+- if (retval > 0)
+- {
+- /* This is the marker for the first entry. Offset 0 is reserved
+- for the first entry (see rewinddir). Here, we use it as a
+- marker for the first entry in the buffer. We never actually
+- seek to offset 0 because handle_overflow reports the error
+- directly, so it does not matter that the offset is incorrect
+- if entries have been read from the descriptor before (so that
+- the descriptor is not actually at offset 0). */
+- __off64_t previous_offset = 0;
+-
+- char *p = buf;
+- char *end = buf + retval;
+- while (p < end)
+- {
+- struct dirent64 *source = (struct dirent64 *) p;
+-
+- /* Copy out the fixed-size data. */
+- __ino_t ino = source->d_ino;
+- __off64_t offset = source->d_off;
+- unsigned int reclen = source->d_reclen;
+- unsigned char type = source->d_type;
+-
+- /* Check for ino_t overflow. */
+- if (__glibc_unlikely (ino != source->d_ino))
+- return handle_overflow (fd, previous_offset, p - buf);
+-
+- /* Convert to the target layout. Use a separate struct and
+- memcpy to side-step aliasing issues. */
+- struct __old_dirent64 result;
+- result.d_ino = ino;
+- result.d_off = offset;
+- result.d_reclen = reclen;
+- result.d_type = type;
+-
+- /* Write the fixed-sized part of the result to the
+- buffer. */
+- size_t result_name_offset = offsetof (struct __old_dirent64, d_name);
+- memcpy (p, &result, result_name_offset);
+-
+- /* Adjust the position of the name if necessary. Copy
+- everything until the end of the record, including the
+- terminating NUL byte. */
+- if (result_name_offset != offsetof (struct dirent64, d_name))
+- memmove (p + result_name_offset, source->d_name,
+- reclen - offsetof (struct dirent64, d_name));
+-
+- p += reclen;
+- previous_offset = offset;
+- }
+- }
+- return retval;
+-}
+-# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
+ #endif /* _DIRENT_MATCHES_DIRENT64 */
+diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
+index 42ab593c4d..b7c51d5ccc 100644
+--- a/sysdeps/unix/sysv/linux/olddirent.h
++++ b/sysdeps/unix/sysv/linux/olddirent.h
+@@ -36,8 +36,6 @@ extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
+ attribute_hidden;
+ extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
+ struct __old_dirent64 **__result);
+-extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
+- attribute_hidden;
+ int __old_scandir64 (const char * __dir,
+ struct __old_dirent64 *** __namelist,
+ int (*__selector) (const struct __old_dirent64 *),
+diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
+index 56365f9da5..de722c98e1 100644
+--- a/sysdeps/unix/sysv/linux/opendir.c
++++ b/sysdeps/unix/sysv/linux/opendir.c
+@@ -23,6 +23,11 @@
+
+ #include <not-cancel.h>
+
++#include <shlib-compat.h>
++#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
++# include <olddirent.h>
++#endif
++
+ enum {
+ opendir_oflags = O_RDONLY|O_NDELAY|O_DIRECTORY|O_LARGEFILE|O_CLOEXEC
+ };
+@@ -128,7 +133,15 @@ __alloc_dir (int fd, bool close_fd, int flags,
+ expand the buffer if required. */
+ enum
+ {
+- tbuffer_size = sizeof (struct dirent) + NAME_MAX + 1
++ tbuffer_size =
++# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
++ /* This is used on compat readdir64. */
++ MAX (sizeof (struct dirent),
++ sizeof (struct __old_dirent64))
++# else
++ sizeof (struct dirent)
++# endif
++ + NAME_MAX + 1
+ };
+ dirp->tbuffer = malloc (tbuffer_size);
+ if (dirp->tbuffer == NULL)
+diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
+index 8869e49150..7ecc8c1b16 100644
+--- a/sysdeps/unix/sysv/linux/readdir64.c
++++ b/sysdeps/unix/sysv/linux/readdir64.c
+@@ -99,57 +99,83 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+ # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+ # include <olddirent.h>
+
++/* Translate the DP64 entry to the old LFS one in the translation buffer
++ at dirstream DS. Return true is the translation was possible or
++ false if either an internal fields can be represented in the non-LFS
++ entry or if the translation can not be resized. */
++static bool
++dirstream_old_entry (struct __dirstream *ds, const struct dirent64 *dp64)
++{
++ /* Check for overflow. */
++ ino_t d_ino = dp64->d_ino;
++ if (d_ino != dp64->d_ino)
++ return false;
++
++ /* Expand the translation buffer to hold the new namesize. */
++ size_t d_reclen = sizeof (struct __old_dirent64)
++ + dp64->d_reclen - offsetof (struct dirent64, d_name);
++ if (d_reclen > ds->tbuffer_size)
++ {
++ char *newbuffer = realloc (ds->tbuffer, d_reclen);
++ if (newbuffer == NULL)
++ return false;
++ ds->tbuffer = newbuffer;
++ ds->tbuffer_size = d_reclen;
++ }
++
++ struct __old_dirent64 *olddp64 = (struct __old_dirent64 *) ds->tbuffer;
++
++ olddp64->d_off = dp64->d_off;
++ olddp64->d_ino = dp64->d_ino;
++ olddp64->d_reclen = dp64->d_reclen;
++ olddp64->d_type = dp64->d_type;
++ memcpy (olddp64->d_name, dp64->d_name,
++ dp64->d_reclen - offsetof (struct dirent64, d_name));
++
++ return true;
++}
++
+ attribute_compat_text_section
+ struct __old_dirent64 *
+ __old_readdir64_unlocked (DIR *dirp)
+ {
+- struct __old_dirent64 *dp;
+- int saved_errno = errno;
++ const int saved_errno = errno;
+
+- do
++ if (dirp->offset >= dirp->size)
+ {
+- size_t reclen;
+-
+- if (dirp->offset >= dirp->size)
++ /* We've emptied out our buffer. Refill it. */
++ ssize_t bytes = __getdents64 (dirp->fd, dirp->data, dirp->allocation);
++ if (bytes <= 0)
+ {
+- /* We've emptied out our buffer. Refill it. */
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
+- if (bytes <= 0)
+- {
+- /* On some systems getdents fails with ENOENT when the
+- open directory has been rmdir'd already. POSIX.1
+- requires that we treat this condition like normal EOF. */
+- if (bytes < 0 && errno == ENOENT)
+- bytes = 0;
+-
+- /* Don't modifiy errno when reaching EOF. */
+- if (bytes == 0)
+- __set_errno (saved_errno);
+- dp = NULL;
+- break;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
+- }
+-
+- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
++ /* On some systems getdents fails with ENOENT when the
++ open directory has been rmdir'd already. POSIX.1
++ requires that we treat this condition like normal EOF. */
++ if (bytes < 0 && errno == ENOENT)
++ bytes = 0;
+
+- reclen = dp->d_reclen;
++ /* Don't modifiy errno when reaching EOF. */
++ if (bytes == 0)
++ __set_errno (saved_errno);
++ return NULL;
++ }
++ dirp->size = bytes;
+
+- dirp->offset += reclen;
++ /* Reset the offset into the buffer. */
++ dirp->offset = 0;
++ }
+
+- dirp->filepos = dp->d_off;
++ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
++ dirp->offset += dp64->d_reclen;
+
+- /* Skip deleted files. */
+- } while (dp->d_ino == 0);
++ /* Skip entries which might overflow d_ino or for memory allocation failure
++ in case of large file names. */
++ if (dirstream_old_entry (dirp, dp64))
++ {
++ dirp->filepos = dp64->d_off;
++ return (struct __old_dirent64 *) dirp->tbuffer;
++ }
+
+- return dp;
++ return NULL;
+ }
+
+ attribute_compat_text_section
+--
+2.32.0
+
diff --git a/9999/0207-dirent-Deprecate-getdirentries.patch b/9999/0207-dirent-Deprecate-getdirentries.patch
new file mode 100644
index 0000000..7b00018
--- /dev/null
+++ b/9999/0207-dirent-Deprecate-getdirentries.patch
@@ -0,0 +1,101 @@
+From 8180167096d51c9767888a695e60a542b64813f0 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Fri, 17 Apr 2020 09:59:51 -0300
+Subject: [PATCH 7/7] dirent: Deprecate getdirentries
+
+The interface has some issues:
+
+ 1. It is build on top getdents on Linux and requires handling
+ non-LFS call using LFS getdents.
+
+ 2. It is not wildly used and the non-LFS support is as problematic
+ as non-LFS readdir. glibc only exports the LFS getdents.
+
+ 3. It is not a direct replacement over BSD since on some plataform
+ its signature has changed (FreeBSD 11, for instance, used to
+ set the offset as a 'long' and changed to 'off_t' on version 12).
+
+The idea is to eventually move the symbols to compat ones.
+---
+ NEWS | 5 +++++
+ dirent/dirent.h | 14 ++++++++++----
+ sysdeps/unix/sysv/linux/Makefile | 3 +++
+ 3 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index d9b344027b..a18a1d7a8c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,11 @@ using `glibc' in the "product" field.
+ \f
+ Version 2.34.1
+
++Deprecated and removed features, and other changes affecting compatibility:
++
++* The function getdirentries is now deprecated, applications should use
++ either getdents64, readdir64 or readdir.
++
+ The following bugs are resolved with this release:
+
+ [12889] nptl: Fix race between pthread_kill and thread exit
+diff --git a/dirent/dirent.h b/dirent/dirent.h
+index 1d1fab7e55..8ad5fbf430 100644
+--- a/dirent/dirent.h
++++ b/dirent/dirent.h
+@@ -348,29 +348,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
+ /* Read directory entries from FD into BUF, reading at most NBYTES.
+ Reading starts at offset *BASEP, and *BASEP is updated with the new
+ position after reading. Returns the number of bytes read; zero when at
+- end of directory; or -1 for errors. */
++ end of directory; or -1 for errors.
++ This is deprecated and getdents64 or readdir should be used instead. */
+ # ifndef __USE_FILE_OFFSET64
+ extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off_t *__restrict __basep)
+- __THROW __nonnull ((2, 4));
++ __THROW __nonnull ((2, 4))
++ __attribute_deprecated_msg__ ("Use getdents64 instead");
+ # else
+ # ifdef __REDIRECT
+ extern __ssize_t __REDIRECT_NTH (getdirentries,
+ (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off64_t *__restrict __basep),
+- getdirentries64) __nonnull ((2, 4));
++ getdirentries64)
++ __THROW __nonnull ((2, 4))
++ __attribute_deprecated_msg__ ("Use getdents64 instead");
+ # else
+ # define getdirentries getdirentries64
+ # endif
+ # endif
+
+ # ifdef __USE_LARGEFILE64
++/* This is deprecated and getdents64 or readdir64 should be used instead. */
+ extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off64_t *__restrict __basep)
+- __THROW __nonnull ((2, 4));
++ __THROW __nonnull ((2, 4))
++ __attribute_deprecated_msg__ ("Use getdents64 instead");
+ # endif
+ #endif /* Use misc. */
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index 76ad06361c..65ec7529f6 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -313,6 +313,9 @@ tests += tst-getdents64
+ # The tested readdir64 symbol was replaced in glibc 2.2.
+ ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
+ tests += tst-readdir64-compat
++
++# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64
++CFLAGS-getdirentries64.c = -Wno-deprecated-declarations
+ endif
+ endif # $(subdir) == dirent
+
+--
+2.32.0
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-01-05 21:19 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-01-05 21:19 UTC (permalink / raw
To: gentoo-commits
commit: 41f2ac7623db1a797f54ec60ac7fa0057f884907
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 5 21:19:25 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Jan 5 21:19:25 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=41f2ac76
Add patch from floppym
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0208-Build-fix-no-double-__THROW.patch | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/9999/0208-Build-fix-no-double-__THROW.patch b/9999/0208-Build-fix-no-double-__THROW.patch
new file mode 100644
index 0000000..56c3afa
--- /dev/null
+++ b/9999/0208-Build-fix-no-double-__THROW.patch
@@ -0,0 +1,29 @@
+From fc24fb7c47dbe4e279a3853ee6eff6565348ca47 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Wed, 5 Jan 2022 22:11:49 +0100
+Subject: [PATCH] Build fix (no double __THROW)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+---
+ dirent/dirent.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dirent/dirent.h b/dirent/dirent.h
+index 8ad5fbf430..eed030b379 100644
+--- a/dirent/dirent.h
++++ b/dirent/dirent.h
+@@ -363,7 +363,7 @@ extern __ssize_t __REDIRECT_NTH (getdirentries,
+ size_t __nbytes,
+ __off64_t *__restrict __basep),
+ getdirentries64)
+- __THROW __nonnull ((2, 4))
++ __nonnull ((2, 4))
+ __attribute_deprecated_msg__ ("Use getdents64 instead");
+ # else
+ # define getdirentries getdirentries64
+--
+2.32.0
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-01-06 15:13 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-01-06 15:13 UTC (permalink / raw
To: gentoo-commits
commit: e088d78ac0870dd02e9ca01794014bda9e371e8f
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 6 15:13:04 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jan 6 15:13:04 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=e088d78a
Sync with azanella's branch release/2.34/master-bz23960
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0207-dirent-Deprecate-getdirentries.patch | 28 +++++++++++++------------
9999/0208-Build-fix-no-double-__THROW.patch | 29 --------------------------
2 files changed, 15 insertions(+), 42 deletions(-)
diff --git a/9999/0207-dirent-Deprecate-getdirentries.patch b/9999/0207-dirent-Deprecate-getdirentries.patch
index 7b00018..f01ab67 100644
--- a/9999/0207-dirent-Deprecate-getdirentries.patch
+++ b/9999/0207-dirent-Deprecate-getdirentries.patch
@@ -1,4 +1,4 @@
-From 8180167096d51c9767888a695e60a542b64813f0 Mon Sep 17 00:00:00 2001
+From 7b990b41ea23c0464c60e6a9f0707adfb46ae587 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 17 Apr 2020 09:59:51 -0300
Subject: [PATCH 7/7] dirent: Deprecate getdirentries
@@ -17,16 +17,16 @@ The interface has some issues:
The idea is to eventually move the symbols to compat ones.
---
- NEWS | 5 +++++
+ NEWS | 6 ++++++
dirent/dirent.h | 14 ++++++++++----
- sysdeps/unix/sysv/linux/Makefile | 3 +++
- 3 files changed, 18 insertions(+), 4 deletions(-)
+ sysdeps/unix/sysv/linux/Makefile | 4 ++++
+ 3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
-index d9b344027b..a18a1d7a8c 100644
+index d9b344027b..45e51ae810 100644
--- a/NEWS
+++ b/NEWS
-@@ -7,6 +7,11 @@ using `glibc' in the "product" field.
+@@ -7,6 +7,12 @@ using `glibc' in the "product" field.
\f
Version 2.34.1
@@ -34,12 +34,13 @@ index d9b344027b..a18a1d7a8c 100644
+
+* The function getdirentries is now deprecated, applications should use
+ either getdents64, readdir64 or readdir.
++
+
The following bugs are resolved with this release:
[12889] nptl: Fix race between pthread_kill and thread exit
diff --git a/dirent/dirent.h b/dirent/dirent.h
-index 1d1fab7e55..8ad5fbf430 100644
+index 1d1fab7e55..eed030b379 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -348,29 +348,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
@@ -64,7 +65,7 @@ index 1d1fab7e55..8ad5fbf430 100644
__off64_t *__restrict __basep),
- getdirentries64) __nonnull ((2, 4));
+ getdirentries64)
-+ __THROW __nonnull ((2, 4))
++ __nonnull ((2, 4))
+ __attribute_deprecated_msg__ ("Use getdents64 instead");
# else
# define getdirentries getdirentries64
@@ -83,19 +84,20 @@ index 1d1fab7e55..8ad5fbf430 100644
#endif /* Use misc. */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 76ad06361c..65ec7529f6 100644
+index 76ad06361c..2bfb6e254b 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -313,6 +313,9 @@ tests += tst-getdents64
- # The tested readdir64 symbol was replaced in glibc 2.2.
+@@ -314,6 +314,10 @@ tests += tst-getdents64
ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
tests += tst-readdir64-compat
+ endif
+
+# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64
-+CFLAGS-getdirentries64.c = -Wno-deprecated-declarations
- endif
++CFLAGS-getdirentries64.o = -Wno-deprecated-declarations
++CFLAGS-getdirentries64.os = -Wno-deprecated-declarations
endif # $(subdir) == dirent
+ ifeq ($(subdir),nis)
--
2.32.0
diff --git a/9999/0208-Build-fix-no-double-__THROW.patch b/9999/0208-Build-fix-no-double-__THROW.patch
deleted file mode 100644
index 56c3afa..0000000
--- a/9999/0208-Build-fix-no-double-__THROW.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From fc24fb7c47dbe4e279a3853ee6eff6565348ca47 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Wed, 5 Jan 2022 22:11:49 +0100
-Subject: [PATCH] Build fix (no double __THROW)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
----
- dirent/dirent.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dirent/dirent.h b/dirent/dirent.h
-index 8ad5fbf430..eed030b379 100644
---- a/dirent/dirent.h
-+++ b/dirent/dirent.h
-@@ -363,7 +363,7 @@ extern __ssize_t __REDIRECT_NTH (getdirentries,
- size_t __nbytes,
- __off64_t *__restrict __basep),
- getdirentries64)
-- __THROW __nonnull ((2, 4))
-+ __nonnull ((2, 4))
- __attribute_deprecated_msg__ ("Use getdents64 instead");
- # else
- # define getdirentries getdirentries64
---
-2.32.0
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-02-12 18:45 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-02-12 18:45 UTC (permalink / raw
To: gentoo-commits
commit: 6415ce699bf1dafc403be7464df662b2879687e8
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 12 18:44:46 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Feb 12 18:44:46 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=6415ce69
Add patch for bug 828070
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28752
Bug: https://bugs.gentoo.org/828070
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...ault-in-getpwuid-when-stat-fails-BZ-28752.patch | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch b/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
new file mode 100644
index 0000000..85cb24a
--- /dev/null
+++ b/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
@@ -0,0 +1,39 @@
+From aa1d70e59ee6ad1503bc853da75afb35d51381be Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Sat, 12 Feb 2022 19:40:58 +0100
+Subject: [PATCH] Fix segfault in getpwuid when stat fails (BZ #28752)
+
+[azanella proposed this patch to sam when discussing the issue,
+ but it's not anywhere upstream yet- dilfridge]
+
+Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28752
+Bug: https://bugs.gentoo.org/828070
+(cherry picked from commit 1bcdcd4fec9bfe2f1d3fef67a43825903f6a5f2b)
+---
+ nss/nss_database.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/nss/nss_database.c b/nss/nss_database.c
+index d56c5b798d..35846d7ebc 100644
+--- a/nss/nss_database.c
++++ b/nss/nss_database.c
+@@ -424,11 +424,11 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
+ errors here are very unlikely, but the chance that we're entering
+ a container is also very unlikely, so we err on the side of both
+ very unlikely things not happening at the same time. */
+- if (__stat64_time64 ("/", &str) != 0
+- || (local->root_ino != 0
+- && (str.st_ino != local->root_ino
+- || str.st_dev != local->root_dev)))
+- {
++ if (__stat64_time64 ("/", &str) != 0)
++ return false;
++
++ if (local->root_ino != 0 && (str.st_ino != local->root_ino
++ || str.st_dev != local->root_dev))
+ /* Change detected; disable reloading and return current state. */
+ atomic_store_release (&local->data.reload_disabled, 1);
+ *result = local->data.services[database_index];
+--
+2.34.1
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-02-21 21:42 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-02-21 21:42 UTC (permalink / raw
To: gentoo-commits
commit: d82b6e3d2cc5374f55a796476462882c5549b0d2
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 21 21:41:50 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Feb 21 21:41:50 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=d82b6e3d
Restore dropped bracket in 0301, rebase all
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 8 ++++----
...eps-posix-getaddrinfo.c-gaih_inet-Only-us.patch | 12 +++++------
...Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 14 ++++++-------
...O0-in-conform-tests-to-survive-CC-changes.patch | 14 ++++++-------
.../0006-Fix-miscompilation-on-ia64-s-gcc-10.patch | 8 ++++----
9999/0020-make-clone3-syscall-optional.patch | 8 ++++----
...t-skip-entries-with-zero-d_ino-values-BZ-.patch | 10 ++++-----
...2-linux-Use-getdents64-on-non-LFS-readdir.patch | 14 ++++++-------
...nternal-DIR-filepos-as-off64_t-BZ-23960-B.patch | 24 +++++++++++-----------
9999/0204-linux-Add-__readdir64_unlocked.patch | 10 ++++-----
9999/0205-linux-Add-__old_readdir64_unlocked.patch | 12 +++++------
...etdents64-on-readdir64-compat-implementat.patch | 15 +++++++-------
9999/0207-dirent-Deprecate-getdirentries.patch | 22 ++++++++++----------
...ault-in-getpwuid-when-stat-fails-BZ-28752.patch | 15 +++++++-------
14 files changed, 93 insertions(+), 93 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 6080ceb..fde0cbb 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From 479864345ca9f13e439b68681e13beb3dce60f7c Mon Sep 17 00:00:00 2001
+From 77b6eec2fbc116152cdc0362448e89a22ea1ae83 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
-Subject: [PATCH 1/6] Disable ldconfig during install
+Subject: [PATCH 01/14] Disable ldconfig during install
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -15,7 +15,7 @@ https://bugs.gentoo.org/431038
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index f98d5a9e67..ef0077677c 100644
+index b1454882bd..73c3ef1e76 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ elf/ldso_install:
@@ -27,5 +27,5 @@ index f98d5a9e67..ef0077677c 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.31.1
+2.34.1
diff --git a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
index b256229..d6cd1b3 100644
--- a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
@@ -1,8 +1,8 @@
-From 10aed4ee2c685613d190434649bbac896b364680 Mon Sep 17 00:00:00 2001
+From 93e05c56a80d3145e3552ea611f2bd8c755d5887 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Tue, 29 Aug 2017 22:58:50 +0200
-Subject: [PATCH 2/6] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet): Only
- use gethostbyname4_r"
+Subject: [PATCH 02/14] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet):
+ Only use gethostbyname4_r"
This reverts commit 8479f23aa1d5e5477a37f46823856bdafaedfa46.
@@ -17,7 +17,7 @@ This makes tst-nss-files-hosts-multi fail. Disable it.
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/nss/Makefile b/nss/Makefile
-index bccf9f2806..c90fee2e4c 100644
+index 552e5d03e1..35ec106e0c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -74,7 +74,6 @@ tests-container = \
@@ -29,7 +29,7 @@ index bccf9f2806..c90fee2e4c 100644
tests += tst-nss-files-alias-leak
tests += tst-nss-files-alias-truncated
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index 838a68f022..1bb2263225 100644
+index 18dccd5924..2cca006f3d 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -733,13 +733,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
@@ -49,5 +49,5 @@ index 838a68f022..1bb2263225 100644
{
while (1)
--
-2.31.1
+2.34.1
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 9588b09..32c5e4a 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From 60c8192d7a9245a2d1ad491d73b2677564d41374 Mon Sep 17 00:00:00 2001
+From 6e27ad8827f67f742aa53b72c141002085e7e1a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 3/6] Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 03/14] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -17,10 +17,10 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 2a4023b9a9..42c2a76d2f 100644
+index 505721388f..44d835cace 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
-@@ -43,7 +43,7 @@ internal_setent (FILE **stream)
+@@ -42,7 +42,7 @@ internal_setent (FILE **stream)
if (*stream == NULL)
{
@@ -30,7 +30,7 @@ index 2a4023b9a9..42c2a76d2f 100644
if (*stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
-index 3b8af66294..91312d2552 100644
+index 576f07fa0a..29962764e2 100644
--- a/nss/tst-nss-files-alias-leak.c
+++ b/nss/tst-nss-files-alias-leak.c
@@ -45,27 +45,27 @@ prepare (int argc, char **argv)
@@ -79,7 +79,7 @@ index 3b8af66294..91312d2552 100644
FILE *fp = xfopen (path, "w");
for (int i = 0; i < many_aliases; ++i)
diff --git a/support/support_chroot.c b/support/support_chroot.c
-index e1628eb53b..4c58eba6a4 100644
+index 4bf6fe0834..1548eba2ad 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -52,13 +52,19 @@ support_chroot_create (struct support_chroot_configuration conf)
@@ -104,5 +104,5 @@ index e1628eb53b..4c58eba6a4 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.31.1
+2.34.1
diff --git a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index 1262b6b..d39eb5d 100644
--- a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From 21bbee17488159cff563f90ed83aee59703cb21e Mon Sep 17 00:00:00 2001
+From 16337b6a4a14c8eb7ae57341aa04d7d571f00783 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 5/6] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 04/14] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -22,10 +22,10 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/conform/conformtest.py b/conform/conformtest.py
-index f0405b7186..14d342e4c4 100644
+index 94a7ee110f..90c81ac88e 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
-@@ -562,7 +562,7 @@ class HeaderTests(object):
+@@ -566,7 +566,7 @@ class HeaderTests(object):
o_file = os.path.join(self.temp_dir, 'test.o')
with open(c_file, 'w') as c_file_out:
c_file_out.write('#include <%s>\n%s' % (self.header, text))
@@ -34,7 +34,7 @@ index f0405b7186..14d342e4c4 100644
try:
subprocess.check_call(cmd, shell=True)
except subprocess.CalledProcessError:
-@@ -613,7 +613,9 @@ class HeaderTests(object):
+@@ -620,7 +620,9 @@ class HeaderTests(object):
out_file = os.path.join(self.temp_dir, 'namespace-out')
with open(c_file, 'w') as c_file_out:
c_file_out.write('#include <%s>\n' % self.header)
@@ -46,7 +46,7 @@ index f0405b7186..14d342e4c4 100644
subprocess.check_call(cmd, shell=True)
bad_tokens = set()
diff --git a/conform/linknamespace.py b/conform/linknamespace.py
-index 66b16e244a..78c80d7645 100644
+index f7fe3a7a0a..ad87fd2a6d 100644
--- a/conform/linknamespace.py
+++ b/conform/linknamespace.py
@@ -157,7 +157,9 @@ def main():
@@ -61,5 +61,5 @@ index 66b16e244a..78c80d7645 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.31.1
+2.34.1
diff --git a/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 9f1148b..6fb25e1 100644
--- a/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From 83b7893377b93d84e8bea1be08686b96cb98024d Mon Sep 17 00:00:00 2001
+From 7fedf8c50534b2930caf2fad55cd98b9eed36e82 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH 6/6] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 05/14] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,7 +13,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index 24650ce31f..20294e6ff0 100644
+index 0d2a1d093a..b50694d6f3 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
@@ -28,5 +28,5 @@ index 24650ce31f..20294e6ff0 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.31.1
+2.34.1
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0020-make-clone3-syscall-optional.patch
index 33aa08f..4654f06 100644
--- a/9999/0020-make-clone3-syscall-optional.patch
+++ b/9999/0020-make-clone3-syscall-optional.patch
@@ -1,7 +1,7 @@
-From 1f714c474eb248b3fa2c84f3b0f22cc509c0e6c9 Mon Sep 17 00:00:00 2001
+From 57babb0afaa90263a7ea416aa9dc3734bb8ceacc Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Wed, 1 Dec 2021 14:58:40 +0000
-Subject: [PATCH] clone-internal.c: make clone3 syscall optional
+Subject: [PATCH 06/14] clone-internal.c: make clone3 syscall optional
We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
compatibility with applications using older Electron.
@@ -31,7 +31,7 @@ Signed-off-by: Sam James <sam@gentoo.org>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
-index 979f7880be..c5566daf73 100644
+index a71effcbd3..60efe1f453 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
@@ -44,5 +44,5 @@ index 979f7880be..c5566daf73 100644
int saved_errno = errno;
ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
--
-2.32.0
+2.34.1
diff --git a/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch b/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
index 5325a91..221dbd6 100644
--- a/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
+++ b/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
@@ -1,7 +1,7 @@
-From 7856a2b7ae88602bc9ee65e08fe652b6a6ad5f7e Mon Sep 17 00:00:00 2001
+From 58b842de801f64de1d323ecceaf24b7cd30cbb87 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 12:18:56 -0300
-Subject: [PATCH 1/7] linux: Do not skip entries with zero d_ino values [BZ
+Subject: [PATCH 07/14] linux: Do not skip entries with zero d_ino values [BZ
#12165]
According to Linux commit 2adc376c55194 (vfs: avoid creation of inode
@@ -18,7 +18,7 @@ Checked on x86_64-linux-gnu and i686-linux-gnu.
2 files changed, 44 insertions(+), 74 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index b480135164..c0619ce06f 100644
+index c31f349639..7743f50071 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
@@ -25,51 +25,36 @@
@@ -96,7 +96,7 @@ index b480135164..c0619ce06f 100644
return dp;
}
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 52b11eb9d9..3aea0b1df1 100644
+index e876d84b02..d990a36e4e 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -30,55 +30,40 @@
@@ -178,5 +178,5 @@ index 52b11eb9d9..3aea0b1df1 100644
#if IS_IN (libc)
__libc_lock_unlock (dirp->lock);
--
-2.32.0
+2.34.1
diff --git a/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
index 90910a6..762a943 100644
--- a/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,7 +1,7 @@
-From 5180512e6c81b1b0423572594983c74c499b7e1e Mon Sep 17 00:00:00 2001
+From 057920ea715c979638045d2966d6a7c616f3cbc2 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 13:37:15 -0300
-Subject: [PATCH 2/7] linux: Use getdents64 on non-LFS readdir
+Subject: [PATCH 08/14] linux: Use getdents64 on non-LFS readdir
The opendir allocates a translation buffer to be used to return the
non-LFS readdir entry. The obtained dirent64 struct is translated
@@ -19,7 +19,7 @@ Checked on x86_64-linux-gnu and i686-linux-gnu.
4 files changed, 101 insertions(+), 26 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
-index 4bb5274b00..1f71445ad9 100644
+index eee0193fc4..d876d49d78 100644
--- a/sysdeps/unix/sysv/linux/closedir.c
+++ b/sysdeps/unix/sysv/linux/closedir.c
@@ -47,6 +47,10 @@ __closedir (DIR *dirp)
@@ -34,7 +34,7 @@ index 4bb5274b00..1f71445ad9 100644
return __close_nocancel (fd);
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index b5e1db8db0..64b1495ba0 100644
+index a0d8acf08d..064273cc31 100644
--- a/sysdeps/unix/sysv/linux/dirstream.h
+++ b/sysdeps/unix/sysv/linux/dirstream.h
@@ -41,6 +41,11 @@ struct __dirstream
@@ -50,7 +50,7 @@ index b5e1db8db0..64b1495ba0 100644
at an address that is aligned adequately enough to store
dirent entries. Using the alignment of "void *" is not
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index 48f254d169..d7df13575e 100644
+index 9e81d00630..bfd2f382a6 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
@@ -120,6 +120,27 @@ __alloc_dir (int fd, bool close_fd, int flags,
@@ -82,7 +82,7 @@ index 48f254d169..d7df13575e 100644
#if IS_IN (libc)
__libc_lock_init (dirp->lock);
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index c0619ce06f..8647bb0aef 100644
+index 7743f50071..7b4571839e 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
@@ -21,42 +21,87 @@
@@ -200,5 +200,5 @@ index c0619ce06f..8647bb0aef 100644
struct dirent *
--
-2.32.0
+2.34.1
diff --git a/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 06e8d14..bde1527 100644
--- a/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,8 +1,8 @@
-From 7d2845e6ed10f2109d2e0f6432932b6693f0037d Mon Sep 17 00:00:00 2001
+From 0afb8fa52cded9c332c31c7a1e62b9f2b04acdf8 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 18:09:20 -0300
-Subject: [PATCH 3/7] linux: Set internal DIR filepos as off64_t [BZ #23960, BZ
- #24050]
+Subject: [PATCH 09/14] linux: Set internal DIR filepos as off64_t [BZ #23960,
+ BZ #24050]
It allows to obtain the expected entry offset on telldir and set
it correctly on seekdir on platforms where long int is smaller
@@ -39,7 +39,7 @@ and arm-linux-gnueabihf.
create mode 100644 sysdeps/unix/sysv/linux/telldir.h
diff --git a/dirent/Makefile b/dirent/Makefile
-index afc7226a5b..c7f046b3f7 100644
+index b80f6a73ea..65119db578 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -31,7 +31,7 @@ routines := opendir closedir readdir readdir_r rewinddir \
@@ -216,7 +216,7 @@ index 0000000000..3e01b361e5
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
-index 1f71445ad9..1845c48be0 100644
+index d876d49d78..8e5669963c 100644
--- a/sysdeps/unix/sysv/linux/closedir.c
+++ b/sysdeps/unix/sysv/linux/closedir.c
@@ -43,6 +43,10 @@ __closedir (DIR *dirp)
@@ -231,7 +231,7 @@ index 1f71445ad9..1845c48be0 100644
__libc_lock_fini (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index 64b1495ba0..1a3362fda6 100644
+index 064273cc31..a284292cb2 100644
--- a/sysdeps/unix/sysv/linux/dirstream.h
+++ b/sysdeps/unix/sysv/linux/dirstream.h
@@ -21,6 +21,7 @@
@@ -262,7 +262,7 @@ index 64b1495ba0..1a3362fda6 100644
/* Directory block. We must make sure that this block starts
at an address that is aligned adequately enough to store
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index d7df13575e..56365f9da5 100644
+index bfd2f382a6..9a0b7ab4c4 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
@@ -150,6 +150,9 @@ __alloc_dir (int fd, bool close_fd, int flags,
@@ -276,7 +276,7 @@ index d7df13575e..56365f9da5 100644
return dirp;
}
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index 8647bb0aef..b26d2756b9 100644
+index 7b4571839e..94ac4cbae7 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
@@ -17,6 +17,7 @@
@@ -288,7 +288,7 @@ index 8647bb0aef..b26d2756b9 100644
#if !_DIRENT_MATCHES_DIRENT64
#include <dirstream.h>
diff --git a/sysdeps/unix/sysv/linux/rewinddir.c b/sysdeps/unix/sysv/linux/rewinddir.c
-index 5b68db7167..74b336bfd8 100644
+index b1e8259703..0194d29e38 100644
--- a/sysdeps/unix/sysv/linux/rewinddir.c
+++ b/sysdeps/unix/sysv/linux/rewinddir.c
@@ -33,6 +33,11 @@ __rewinddir (DIR *dirp)
@@ -304,7 +304,7 @@ index 5b68db7167..74b336bfd8 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/seekdir.c b/sysdeps/unix/sysv/linux/seekdir.c
-index b128ae8e76..2fcf689dc0 100644
+index f4e1a9f8e0..0c3e58a2ed 100644
--- a/sysdeps/unix/sysv/linux/seekdir.c
+++ b/sysdeps/unix/sysv/linux/seekdir.c
@@ -22,14 +22,40 @@
@@ -354,7 +354,7 @@ index b128ae8e76..2fcf689dc0 100644
__libc_lock_unlock (dirp->lock);
}
diff --git a/sysdeps/unix/sysv/linux/telldir.c b/sysdeps/unix/sysv/linux/telldir.c
-index b184db8d2c..a0eb1efeff 100644
+index b60b231e48..874905489f 100644
--- a/sysdeps/unix/sysv/linux/telldir.c
+++ b/sysdeps/unix/sysv/linux/telldir.c
@@ -18,16 +18,59 @@
@@ -490,5 +490,5 @@ index 0000000000..7c45886341
+
+#endif /* _TELLDIR_H */
--
-2.32.0
+2.34.1
diff --git a/9999/0204-linux-Add-__readdir64_unlocked.patch b/9999/0204-linux-Add-__readdir64_unlocked.patch
index 29609dd..839b18d 100644
--- a/9999/0204-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0204-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 1524804c8133564c204340a0d618f04c585d7706 Mon Sep 17 00:00:00 2001
+From 333f932faec29e5c9238d3d1f8584acc25d986c0 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 08:35:40 -0300
-Subject: [PATCH 4/7] linux: Add __readdir64_unlocked
+Subject: [PATCH 10/14] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
@@ -25,7 +25,7 @@ index d7567f5e86..0c6715d0e4 100644
libc_hidden_proto (__readdir64)
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 3aea0b1df1..5519487ede 100644
+index d990a36e4e..c4539f6d96 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -28,14 +28,10 @@
@@ -66,7 +66,7 @@ index 3aea0b1df1..5519487ede 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index 073a6453d1..058d401279 100644
+index afd7f9af0f..32962a176a 100644
--- a/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -32,89 +32,43 @@ __readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
@@ -177,5 +177,5 @@ index 073a6453d1..058d401279 100644
--
-2.32.0
+2.34.1
diff --git a/9999/0205-linux-Add-__old_readdir64_unlocked.patch b/9999/0205-linux-Add-__old_readdir64_unlocked.patch
index c1ccb61..42c9d1d 100644
--- a/9999/0205-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0205-linux-Add-__old_readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From f16c3815c6ad46450d6e58e179ddf494c52a98a4 Mon Sep 17 00:00:00 2001
+From b69d95b17a828f5f39b577c00ff0d02e4c0a5da6 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 14 Apr 2020 11:14:22 -0300
-Subject: [PATCH 5/7] linux: Add __old_readdir64_unlocked
+Subject: [PATCH 11/14] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
@@ -13,7 +13,7 @@ Checked on i686-linux-gnu.
3 files changed, 35 insertions(+), 67 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index 3e672d47f5..42ab593c4d 100644
+index 9a22609177..00c84b9521 100644
--- a/sysdeps/unix/sysv/linux/olddirent.h
+++ b/sysdeps/unix/sysv/linux/olddirent.h
@@ -32,6 +32,8 @@ struct __old_dirent64
@@ -26,7 +26,7 @@ index 3e672d47f5..42ab593c4d 100644
struct __old_dirent64 **__result);
extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 5519487ede..8869e49150 100644
+index c4539f6d96..dbf6a8c54d 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -101,15 +101,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
@@ -69,7 +69,7 @@ index 5519487ede..8869e49150 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index 058d401279..e4a0baeaf7 100644
+index 32962a176a..699d120b76 100644
--- a/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -91,89 +91,44 @@ __old_readdir64_r (DIR *dirp, struct __old_dirent64 *entry,
@@ -180,5 +180,5 @@ index 058d401279..e4a0baeaf7 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.32.0
+2.34.1
diff --git a/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 90f5d89..889266d 100644
--- a/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,7 +1,8 @@
-From 46b9383118182cb2ac2e81637e00fde6c21097bb Mon Sep 17 00:00:00 2001
+From a5aee8e0e844f9f9cf8df0a41e67cddf8de7540f Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 16:00:43 -0300
-Subject: [PATCH 6/7] linux: Use getdents64 on readdir64 compat implementation
+Subject: [PATCH 12/14] linux: Use getdents64 on readdir64 compat
+ implementation
It uses a similar strategy from the non-LFS readdir that also
uses getdents64 internally and uses a translation buffer to return
@@ -18,7 +19,7 @@ Checked on i686-linux-gnu.
4 files changed, 79 insertions(+), 135 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
-index 6323e003b3..38285e9f4b 100644
+index 510a586859..92481526c5 100644
--- a/sysdeps/unix/sysv/linux/getdents64.c
+++ b/sysdeps/unix/sysv/linux/getdents64.c
@@ -36,97 +36,4 @@ weak_alias (__getdents64, getdents64)
@@ -120,7 +121,7 @@ index 6323e003b3..38285e9f4b 100644
-# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index 42ab593c4d..b7c51d5ccc 100644
+index 00c84b9521..68aafd7c02 100644
--- a/sysdeps/unix/sysv/linux/olddirent.h
+++ b/sysdeps/unix/sysv/linux/olddirent.h
@@ -36,8 +36,6 @@ extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
@@ -133,7 +134,7 @@ index 42ab593c4d..b7c51d5ccc 100644
struct __old_dirent64 *** __namelist,
int (*__selector) (const struct __old_dirent64 *),
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index 56365f9da5..de722c98e1 100644
+index 9a0b7ab4c4..df40b0a64e 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
@@ -23,6 +23,11 @@
@@ -166,7 +167,7 @@ index 56365f9da5..de722c98e1 100644
dirp->tbuffer = malloc (tbuffer_size);
if (dirp->tbuffer == NULL)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 8869e49150..7ecc8c1b16 100644
+index dbf6a8c54d..4b41299c6c 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -99,57 +99,83 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
@@ -293,5 +294,5 @@ index 8869e49150..7ecc8c1b16 100644
attribute_compat_text_section
--
-2.32.0
+2.34.1
diff --git a/9999/0207-dirent-Deprecate-getdirentries.patch b/9999/0207-dirent-Deprecate-getdirentries.patch
index f01ab67..42e3002 100644
--- a/9999/0207-dirent-Deprecate-getdirentries.patch
+++ b/9999/0207-dirent-Deprecate-getdirentries.patch
@@ -1,7 +1,7 @@
-From 7b990b41ea23c0464c60e6a9f0707adfb46ae587 Mon Sep 17 00:00:00 2001
+From 96f2c068b5aa972b23cfe25d3c8042fed1056607 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 17 Apr 2020 09:59:51 -0300
-Subject: [PATCH 7/7] dirent: Deprecate getdirentries
+Subject: [PATCH 13/14] dirent: Deprecate getdirentries
The interface has some issues:
@@ -23,12 +23,12 @@ The idea is to eventually move the symbols to compat ones.
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
-index d9b344027b..45e51ae810 100644
+index 626eeabf5d..ed5b7b641f 100644
--- a/NEWS
+++ b/NEWS
-@@ -7,6 +7,12 @@ using `glibc' in the "product" field.
- \f
- Version 2.34.1
+@@ -25,6 +25,12 @@ Security related changes:
+
+ [Add security related changes here]
+Deprecated and removed features, and other changes affecting compatibility:
+
@@ -38,9 +38,9 @@ index d9b344027b..45e51ae810 100644
+
The following bugs are resolved with this release:
- [12889] nptl: Fix race between pthread_kill and thread exit
+ [The release manager will add the list generated by
diff --git a/dirent/dirent.h b/dirent/dirent.h
-index 1d1fab7e55..eed030b379 100644
+index 218f1ed44b..b2737bc53b 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
@@ -348,29 +348,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
@@ -84,10 +84,10 @@ index 1d1fab7e55..eed030b379 100644
#endif /* Use misc. */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 76ad06361c..2bfb6e254b 100644
+index 7122f55975..c9b43898b2 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -314,6 +314,10 @@ tests += tst-getdents64
+@@ -338,6 +338,10 @@ tests += tst-getdents64
ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
tests += tst-readdir64-compat
endif
@@ -99,5 +99,5 @@ index 76ad06361c..2bfb6e254b 100644
ifeq ($(subdir),nis)
--
-2.32.0
+2.34.1
diff --git a/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch b/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
index 85cb24a..48036b3 100644
--- a/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
+++ b/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
@@ -1,7 +1,7 @@
-From aa1d70e59ee6ad1503bc853da75afb35d51381be Mon Sep 17 00:00:00 2001
+From 7032e8bf35b229ff759286435f1f51b5588b56ed Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Sat, 12 Feb 2022 19:40:58 +0100
-Subject: [PATCH] Fix segfault in getpwuid when stat fails (BZ #28752)
+Subject: [PATCH 14/14] Fix segfault in getpwuid when stat fails (BZ #28752)
[azanella proposed this patch to sam when discussing the issue,
but it's not anywhere upstream yet- dilfridge]
@@ -10,14 +10,14 @@ Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28752
Bug: https://bugs.gentoo.org/828070
(cherry picked from commit 1bcdcd4fec9bfe2f1d3fef67a43825903f6a5f2b)
---
- nss/nss_database.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ nss/nss_database.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/nss/nss_database.c b/nss/nss_database.c
-index d56c5b798d..35846d7ebc 100644
+index d56c5b798d..133682b858 100644
--- a/nss/nss_database.c
+++ b/nss/nss_database.c
-@@ -424,11 +424,11 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
+@@ -424,10 +424,11 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
errors here are very unlikely, but the chance that we're entering
a container is also very unlikely, so we err on the side of both
very unlikely things not happening at the same time. */
@@ -25,15 +25,14 @@ index d56c5b798d..35846d7ebc 100644
- || (local->root_ino != 0
- && (str.st_ino != local->root_ino
- || str.st_dev != local->root_dev)))
-- {
+ if (__stat64_time64 ("/", &str) != 0)
+ return false;
+
+ if (local->root_ino != 0 && (str.st_ino != local->root_ino
+ || str.st_dev != local->root_dev))
+ {
/* Change detected; disable reloading and return current state. */
atomic_store_release (&local->data.reload_disabled, 1);
- *result = local->data.services[database_index];
--
2.34.1
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-03-07 1:04 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-03-07 1:04 UTC (permalink / raw
To: gentoo-commits
commit: 6002612f230d2b8d88fefba6c6477a20e77efc23
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 7 01:03:46 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Mar 7 01:03:46 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=6002612f
Additional fixup for the glibc/firefox/seccomp interaction
Bug: https://bugs.gentoo.org/828070
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...0302-Drop-glibc-lock-when-returning-early.patch | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/9999/0302-Drop-glibc-lock-when-returning-early.patch b/9999/0302-Drop-glibc-lock-when-returning-early.patch
new file mode 100644
index 0000000..4eab4ea
--- /dev/null
+++ b/9999/0302-Drop-glibc-lock-when-returning-early.patch
@@ -0,0 +1,36 @@
+From fd939e8740a97b3ffc5816cebb7be947c7b560af Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 7 Mar 2022 01:59:53 +0100
+Subject: [PATCH] Drop glibc lock when returning early
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes 1bcdcd4fec9bfe2f1d3fef67a43825903f6a5f2b
+
+Bug: https://bugs.gentoo.org/828070
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+(cherry picked from commit 81f6a812264e375a695e5b00e2906da8102cc9b6)
+---
+ nss/nss_database.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/nss/nss_database.c b/nss/nss_database.c
+index 133682b858..5f58baf34b 100644
+--- a/nss/nss_database.c
++++ b/nss/nss_database.c
+@@ -424,8 +424,10 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
+ errors here are very unlikely, but the chance that we're entering
+ a container is also very unlikely, so we err on the side of both
+ very unlikely things not happening at the same time. */
+- if (__stat64_time64 ("/", &str) != 0)
++ if (__stat64_time64 ("/", &str) != 0) {
++ __libc_lock_unlock (local->lock);
+ return false;
++ }
+
+ if (local->root_ino != 0 && (str.st_ino != local->root_ino
+ || str.st_dev != local->root_dev))
+--
+2.34.1
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-03-27 16:12 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-03-27 16:12 UTC (permalink / raw
To: gentoo-commits
commit: 9ea49f5686889168627984b71eb6a2721bad712d
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 16:11:48 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 16:11:48 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=9ea49f56
Drop clone3 patch
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0020-make-clone3-syscall-optional.patch | 48 ----------------------------
1 file changed, 48 deletions(-)
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0020-make-clone3-syscall-optional.patch
deleted file mode 100644
index 4654f06..0000000
--- a/9999/0020-make-clone3-syscall-optional.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 57babb0afaa90263a7ea416aa9dc3734bb8ceacc Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 1 Dec 2021 14:58:40 +0000
-Subject: [PATCH 06/14] clone-internal.c: make clone3 syscall optional
-
-We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
-compatibility with applications using older Electron.
-
-Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
-revert back to always using clone3.
-
-This was impacting e.g. Discord and Skype. This patch stops glibc from using
-clone3 internally (which is the only real use of it) and falls back to the old
-behaviour.
-
-Specifically, we want https://github.com/electron/electron/pull/31091
-to work its way downstream to various Electron applications.
-
-https://bugs.gentoo.org/819045
-https://bugs.gentoo.org/827386
-
-https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch
-
-This is the same as the patch that was considered but ultimately rejected
-for 2.34 because Docker got sorted out in time:
-https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
-
-Signed-off-by: Sam James <sam@gentoo.org>
----
- sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
-index a71effcbd3..60efe1f453 100644
---- a/sysdeps/unix/sysv/linux/clone-internal.c
-+++ b/sysdeps/unix/sysv/linux/clone-internal.c
-@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
- int (*func) (void *arg), void *arg)
- {
- int ret;
--#ifdef HAVE_CLONE3_WRAPPER
-+#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
- /* Try clone3 first. */
- int saved_errno = errno;
- ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
---
-2.34.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-04-16 11:54 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-04-16 11:54 UTC (permalink / raw
To: gentoo-commits
commit: 825c8462d8704328bf7c1e1c4416c9a191f85b6a
Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 16 07:28:10 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Apr 16 11:53:48 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=825c8462
Rebase all
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 4 +-
...eps-posix-getaddrinfo.c-gaih_inet-Only-us.patch | 43 +++++++++++-----------
...Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 4 +-
...0-in-conform-tests-to-survive-CC-changes.patch} | 4 +-
...0005-Fix-miscompilation-on-ia64-s-gcc-10.patch} | 4 +-
...-skip-entries-with-zero-d_ino-values-BZ-.patch} | 6 +--
...-linux-Use-getdents64-on-non-LFS-readdir.patch} | 6 +--
...ternal-DIR-filepos-as-off64_t-BZ-23960-B.patch} | 6 +--
...h => 0009-linux-Add-__readdir64_unlocked.patch} | 6 +--
... 0010-linux-Add-__old_readdir64_unlocked.patch} | 6 +--
...tdents64-on-readdir64-compat-implementat.patch} | 6 +--
...h => 0012-dirent-Deprecate-getdirentries.patch} | 16 ++++----
...ult-in-getpwuid-when-stat-fails-BZ-28752.patch} | 6 +--
...014-Drop-glibc-lock-when-returning-early.patch} | 6 +--
14 files changed, 61 insertions(+), 62 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index fde0cbb..65e2357 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,4 +1,4 @@
-From 77b6eec2fbc116152cdc0362448e89a22ea1ae83 Mon Sep 17 00:00:00 2001
+From 4ec3b3446cac3917499fba2c3067dc39bb24bf83 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
Subject: [PATCH 01/14] Disable ldconfig during install
@@ -27,5 +27,5 @@ index b1454882bd..73c3ef1e76 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.34.1
+2.35.1
diff --git a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
index d6cd1b3..59c2b86 100644
--- a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
@@ -1,4 +1,4 @@
-From 93e05c56a80d3145e3552ea611f2bd8c755d5887 Mon Sep 17 00:00:00 2001
+From afd71f4f5c995d68a00f0d34210d80eaf08dbed8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Tue, 29 Aug 2017 22:58:50 +0200
Subject: [PATCH 02/14] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet):
@@ -13,14 +13,14 @@ See for the background
This makes tst-nss-files-hosts-multi fail. Disable it.
---
nss/Makefile | 1 -
- sysdeps/posix/getaddrinfo.c | 9 ++-------
- 2 files changed, 2 insertions(+), 8 deletions(-)
+ sysdeps/posix/getaddrinfo.c | 8 ++------
+ 2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/nss/Makefile b/nss/Makefile
-index 552e5d03e1..35ec106e0c 100644
+index d8b06b44fb..e3639f78ec 100644
--- a/nss/Makefile
+++ b/nss/Makefile
-@@ -74,7 +74,6 @@ tests-container = \
+@@ -85,7 +85,6 @@ tests-container := \
# Tests which need libdl
ifeq (yes,$(build-shared))
tests += tst-nss-files-hosts-erange
@@ -29,25 +29,24 @@ index 552e5d03e1..35ec106e0c 100644
tests += tst-nss-files-alias-leak
tests += tst-nss-files-alias-truncated
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index 18dccd5924..2cca006f3d 100644
+index bcff909b2f..09954dee22 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
-@@ -733,13 +733,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
- while (!no_more)
- {
- no_data = 0;
-- nss_gethostbyname4_r *fct4 = NULL;
+@@ -623,12 +623,8 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
+ }
+
+ no_data = 0;
+- nss_gethostbyname4_r *fct4 = NULL;
-
-- /* gethostbyname4_r sends out parallel A and AAAA queries and
-- is thus only suitable for PF_UNSPEC. */
-- if (req->ai_family == PF_UNSPEC)
-- fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
--
-+ nss_gethostbyname4_r *fct4
-+ = __nss_lookup_function (nip, "gethostbyname4_r");
- if (fct4 != NULL)
- {
- while (1)
+- /* gethostbyname4_r sends out parallel A and AAAA queries and
+- is thus only suitable for PF_UNSPEC. */
+- if (req->ai_family == PF_UNSPEC)
+- fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
++ nss_gethostbyname4_r *fct4
++ = __nss_lookup_function (nip, "gethostbyname4_r");
+
+ if (fct4 != NULL)
+ {
--
-2.34.1
+2.35.1
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 32c5e4a..a9d0605 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,4 +1,4 @@
-From 6e27ad8827f67f742aa53b72c141002085e7e1a8 Mon Sep 17 00:00:00 2001
+From 4a1235321c3749726d4f0b3ed0f0769a40d714f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
Subject: [PATCH 03/14] Adapt to Gentoo-specific /etc/mail/aliases
@@ -104,5 +104,5 @@ index 4bf6fe0834..1548eba2ad 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.34.1
+2.35.1
diff --git a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch
similarity index 97%
rename from 9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
rename to 9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index d39eb5d..ce101ab 100644
--- a/9999/0005-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,4 +1,4 @@
-From 16337b6a4a14c8eb7ae57341aa04d7d571f00783 Mon Sep 17 00:00:00 2001
+From 6f332b192b1e0a502d904c608630e3392dd69d15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
Subject: [PATCH 04/14] Force -O0 in conform tests to survive $CC changes
@@ -61,5 +61,5 @@ index f7fe3a7a0a..ad87fd2a6d 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.34.1
+2.35.1
diff --git a/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch
similarity index 94%
rename from 9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
rename to 9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 6fb25e1..9024676 100644
--- a/9999/0006-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,4 +1,4 @@
-From 7fedf8c50534b2930caf2fad55cd98b9eed36e82 Mon Sep 17 00:00:00 2001
+From da8126c1493016b2c9aed0c34b240619b7aee075 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
Subject: [PATCH 05/14] Fix miscompilation on ia64's gcc-10
@@ -28,5 +28,5 @@ index 0d2a1d093a..b50694d6f3 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.34.1
+2.35.1
diff --git a/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch b/9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
similarity index 97%
rename from 9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
rename to 9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
index 221dbd6..eae612d 100644
--- a/9999/0201-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
+++ b/9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
@@ -1,7 +1,7 @@
-From 58b842de801f64de1d323ecceaf24b7cd30cbb87 Mon Sep 17 00:00:00 2001
+From 2a131fefbe72a749fe28b426a37b499bf7255cdf Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 12:18:56 -0300
-Subject: [PATCH 07/14] linux: Do not skip entries with zero d_ino values [BZ
+Subject: [PATCH 06/14] linux: Do not skip entries with zero d_ino values [BZ
#12165]
According to Linux commit 2adc376c55194 (vfs: avoid creation of inode
@@ -178,5 +178,5 @@ index e876d84b02..d990a36e4e 100644
#if IS_IN (libc)
__libc_lock_unlock (dirp->lock);
--
-2.34.1
+2.35.1
diff --git a/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch
similarity index 97%
rename from 9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
rename to 9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch
index 762a943..6f8081f 100644
--- a/9999/0202-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,7 +1,7 @@
-From 057920ea715c979638045d2966d6a7c616f3cbc2 Mon Sep 17 00:00:00 2001
+From bda59ff47746fdec69cf4a695d6aeaa4aae2acf8 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 13:37:15 -0300
-Subject: [PATCH 08/14] linux: Use getdents64 on non-LFS readdir
+Subject: [PATCH 07/14] linux: Use getdents64 on non-LFS readdir
The opendir allocates a translation buffer to be used to return the
non-LFS readdir entry. The obtained dirent64 struct is translated
@@ -200,5 +200,5 @@ index 7743f50071..7b4571839e 100644
struct dirent *
--
-2.34.1
+2.35.1
diff --git a/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
similarity index 99%
rename from 9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
rename to 9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index bde1527..68d9ce0 100644
--- a/9999/0203-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,7 +1,7 @@
-From 0afb8fa52cded9c332c31c7a1e62b9f2b04acdf8 Mon Sep 17 00:00:00 2001
+From 90aa2d426422b6acc0e7f2b9d8afa2718098601b Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 18:09:20 -0300
-Subject: [PATCH 09/14] linux: Set internal DIR filepos as off64_t [BZ #23960,
+Subject: [PATCH 08/14] linux: Set internal DIR filepos as off64_t [BZ #23960,
BZ #24050]
It allows to obtain the expected entry offset on telldir and set
@@ -490,5 +490,5 @@ index 0000000000..7c45886341
+
+#endif /* _TELLDIR_H */
--
-2.34.1
+2.35.1
diff --git a/9999/0204-linux-Add-__readdir64_unlocked.patch b/9999/0009-linux-Add-__readdir64_unlocked.patch
similarity index 97%
rename from 9999/0204-linux-Add-__readdir64_unlocked.patch
rename to 9999/0009-linux-Add-__readdir64_unlocked.patch
index 839b18d..2453183 100644
--- a/9999/0204-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0009-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 333f932faec29e5c9238d3d1f8584acc25d986c0 Mon Sep 17 00:00:00 2001
+From 91dd23b0cf7a3aa11fae6cd3e71e9d49409f17b0 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 08:35:40 -0300
-Subject: [PATCH 10/14] linux: Add __readdir64_unlocked
+Subject: [PATCH 09/14] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
@@ -177,5 +177,5 @@ index afd7f9af0f..32962a176a 100644
--
-2.34.1
+2.35.1
diff --git a/9999/0205-linux-Add-__old_readdir64_unlocked.patch b/9999/0010-linux-Add-__old_readdir64_unlocked.patch
similarity index 97%
rename from 9999/0205-linux-Add-__old_readdir64_unlocked.patch
rename to 9999/0010-linux-Add-__old_readdir64_unlocked.patch
index 42c9d1d..d795095 100644
--- a/9999/0205-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0010-linux-Add-__old_readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From b69d95b17a828f5f39b577c00ff0d02e4c0a5da6 Mon Sep 17 00:00:00 2001
+From fa48dff4045e66ef9c65b33e80dbfb1390500b6b Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 14 Apr 2020 11:14:22 -0300
-Subject: [PATCH 11/14] linux: Add __old_readdir64_unlocked
+Subject: [PATCH 10/14] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
@@ -180,5 +180,5 @@ index 32962a176a..699d120b76 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.34.1
+2.35.1
diff --git a/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch
similarity index 98%
rename from 9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
rename to 9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 889266d..616e44d 100644
--- a/9999/0206-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,7 +1,7 @@
-From a5aee8e0e844f9f9cf8df0a41e67cddf8de7540f Mon Sep 17 00:00:00 2001
+From 201d65ca12185f171be7b532b16bc315af7d45c3 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 16:00:43 -0300
-Subject: [PATCH 12/14] linux: Use getdents64 on readdir64 compat
+Subject: [PATCH 11/14] linux: Use getdents64 on readdir64 compat
implementation
It uses a similar strategy from the non-LFS readdir that also
@@ -294,5 +294,5 @@ index dbf6a8c54d..4b41299c6c 100644
attribute_compat_text_section
--
-2.34.1
+2.35.1
diff --git a/9999/0207-dirent-Deprecate-getdirentries.patch b/9999/0012-dirent-Deprecate-getdirentries.patch
similarity index 90%
rename from 9999/0207-dirent-Deprecate-getdirentries.patch
rename to 9999/0012-dirent-Deprecate-getdirentries.patch
index 42e3002..8be7591 100644
--- a/9999/0207-dirent-Deprecate-getdirentries.patch
+++ b/9999/0012-dirent-Deprecate-getdirentries.patch
@@ -1,7 +1,7 @@
-From 96f2c068b5aa972b23cfe25d3c8042fed1056607 Mon Sep 17 00:00:00 2001
+From 40ec9c0d2bdeee4192885f7781167afdeeee899d Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 17 Apr 2020 09:59:51 -0300
-Subject: [PATCH 13/14] dirent: Deprecate getdirentries
+Subject: [PATCH 12/14] dirent: Deprecate getdirentries
The interface has some issues:
@@ -23,7 +23,7 @@ The idea is to eventually move the symbols to compat ones.
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
-index 626eeabf5d..ed5b7b641f 100644
+index 4b6d9de2b5..b00c803a1c 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,12 @@ Security related changes:
@@ -40,10 +40,10 @@ index 626eeabf5d..ed5b7b641f 100644
[The release manager will add the list generated by
diff --git a/dirent/dirent.h b/dirent/dirent.h
-index 218f1ed44b..b2737bc53b 100644
+index c47d3273b2..1c299e5be8 100644
--- a/dirent/dirent.h
+++ b/dirent/dirent.h
-@@ -348,29 +348,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
+@@ -350,29 +350,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
/* Read directory entries from FD into BUF, reading at most NBYTES.
Reading starts at offset *BASEP, and *BASEP is updated with the new
position after reading. Returns the number of bytes read; zero when at
@@ -84,10 +84,10 @@ index 218f1ed44b..b2737bc53b 100644
#endif /* Use misc. */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 7122f55975..c9b43898b2 100644
+index ca953804d0..26794e4fef 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -338,6 +338,10 @@ tests += tst-getdents64
+@@ -341,6 +341,10 @@ tests += tst-getdents64
ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
tests += tst-readdir64-compat
endif
@@ -99,5 +99,5 @@ index 7122f55975..c9b43898b2 100644
ifeq ($(subdir),nis)
--
-2.34.1
+2.35.1
diff --git a/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch b/9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
similarity index 91%
rename from 9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
rename to 9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
index 48036b3..32fd8a6 100644
--- a/9999/0301-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
+++ b/9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
@@ -1,7 +1,7 @@
-From 7032e8bf35b229ff759286435f1f51b5588b56ed Mon Sep 17 00:00:00 2001
+From ce54d71af85a735b3ddf29bde1f6ee6e0844d352 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Sat, 12 Feb 2022 19:40:58 +0100
-Subject: [PATCH 14/14] Fix segfault in getpwuid when stat fails (BZ #28752)
+Subject: [PATCH 13/14] Fix segfault in getpwuid when stat fails (BZ #28752)
[azanella proposed this patch to sam when discussing the issue,
but it's not anywhere upstream yet- dilfridge]
@@ -34,5 +34,5 @@ index d56c5b798d..133682b858 100644
/* Change detected; disable reloading and return current state. */
atomic_store_release (&local->data.reload_disabled, 1);
--
-2.34.1
+2.35.1
diff --git a/9999/0302-Drop-glibc-lock-when-returning-early.patch b/9999/0014-Drop-glibc-lock-when-returning-early.patch
similarity index 89%
rename from 9999/0302-Drop-glibc-lock-when-returning-early.patch
rename to 9999/0014-Drop-glibc-lock-when-returning-early.patch
index 4eab4ea..ccb544e 100644
--- a/9999/0302-Drop-glibc-lock-when-returning-early.patch
+++ b/9999/0014-Drop-glibc-lock-when-returning-early.patch
@@ -1,7 +1,7 @@
-From fd939e8740a97b3ffc5816cebb7be947c7b560af Mon Sep 17 00:00:00 2001
+From f0967c21f82d9b6db6faa41315f668f56e38562f Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Mon, 7 Mar 2022 01:59:53 +0100
-Subject: [PATCH] Drop glibc lock when returning early
+Subject: [PATCH 14/14] Drop glibc lock when returning early
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -32,5 +32,5 @@ index 133682b858..5f58baf34b 100644
if (local->root_ino != 0 && (str.st_ino != local->root_ino
|| str.st_dev != local->root_dev))
--
-2.34.1
+2.35.1
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-04-16 11:54 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-04-16 11:54 UTC (permalink / raw
To: gentoo-commits
commit: f39616921f4130213a87fade84a4ba2e17604986
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 16 11:51:16 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Apr 16 11:53:58 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=f3961692
Revert "Drop clone3 patch"
This reverts commit 9ea49f5686889168627984b71eb6a2721bad712d.
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0020-make-clone3-syscall-optional.patch | 48 ++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0020-make-clone3-syscall-optional.patch
new file mode 100644
index 0000000..4654f06
--- /dev/null
+++ b/9999/0020-make-clone3-syscall-optional.patch
@@ -0,0 +1,48 @@
+From 57babb0afaa90263a7ea416aa9dc3734bb8ceacc Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 1 Dec 2021 14:58:40 +0000
+Subject: [PATCH 06/14] clone-internal.c: make clone3 syscall optional
+
+We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
+compatibility with applications using older Electron.
+
+Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
+revert back to always using clone3.
+
+This was impacting e.g. Discord and Skype. This patch stops glibc from using
+clone3 internally (which is the only real use of it) and falls back to the old
+behaviour.
+
+Specifically, we want https://github.com/electron/electron/pull/31091
+to work its way downstream to various Electron applications.
+
+https://bugs.gentoo.org/819045
+https://bugs.gentoo.org/827386
+
+https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch
+
+This is the same as the patch that was considered but ultimately rejected
+for 2.34 because Docker got sorted out in time:
+https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
+index a71effcbd3..60efe1f453 100644
+--- a/sysdeps/unix/sysv/linux/clone-internal.c
++++ b/sysdeps/unix/sysv/linux/clone-internal.c
+@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
+ int (*func) (void *arg), void *arg)
+ {
+ int ret;
+-#ifdef HAVE_CLONE3_WRAPPER
++#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
+ /* Try clone3 first. */
+ int saved_errno = errno;
+ ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
+--
+2.34.1
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-04-16 11:54 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-04-16 11:54 UTC (permalink / raw
To: gentoo-commits
commit: 2fb6951cd42da96efd9af438404bc48c1b015f4e
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 16 11:50:36 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Apr 16 11:53:55 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=2fb6951c
Drop getaddrinfo patch, let's see what breaks
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...eps-posix-getaddrinfo.c-gaih_inet-Only-us.patch | 52 ----------------------
1 file changed, 52 deletions(-)
diff --git a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch b/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
deleted file mode 100644
index 59c2b86..0000000
--- a/9999/0002-Revert-sysdeps-posix-getaddrinfo.c-gaih_inet-Only-us.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From afd71f4f5c995d68a00f0d34210d80eaf08dbed8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Tue, 29 Aug 2017 22:58:50 +0200
-Subject: [PATCH 02/14] Revert " * sysdeps/posix/getaddrinfo.c (gaih_inet):
- Only use gethostbyname4_r"
-
-This reverts commit 8479f23aa1d5e5477a37f46823856bdafaedfa46.
-
-See for the background
- https://sourceware.org/bugzilla/show_bug.cgi?id=16826
- https://bugs.gentoo.org/show_bug.cgi?id=600632
-
-This makes tst-nss-files-hosts-multi fail. Disable it.
----
- nss/Makefile | 1 -
- sysdeps/posix/getaddrinfo.c | 8 ++------
- 2 files changed, 2 insertions(+), 7 deletions(-)
-
-diff --git a/nss/Makefile b/nss/Makefile
-index d8b06b44fb..e3639f78ec 100644
---- a/nss/Makefile
-+++ b/nss/Makefile
-@@ -85,7 +85,6 @@ tests-container := \
- # Tests which need libdl
- ifeq (yes,$(build-shared))
- tests += tst-nss-files-hosts-erange
--tests += tst-nss-files-hosts-multi
- tests += tst-nss-files-hosts-getent
- tests += tst-nss-files-alias-leak
- tests += tst-nss-files-alias-truncated
-diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index bcff909b2f..09954dee22 100644
---- a/sysdeps/posix/getaddrinfo.c
-+++ b/sysdeps/posix/getaddrinfo.c
-@@ -623,12 +623,8 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
- }
-
- no_data = 0;
-- nss_gethostbyname4_r *fct4 = NULL;
--
-- /* gethostbyname4_r sends out parallel A and AAAA queries and
-- is thus only suitable for PF_UNSPEC. */
-- if (req->ai_family == PF_UNSPEC)
-- fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
-+ nss_gethostbyname4_r *fct4
-+ = __nss_lookup_function (nip, "gethostbyname4_r");
-
- if (fct4 != NULL)
- {
---
-2.35.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-07-05 4:02 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-07-05 4:02 UTC (permalink / raw
To: gentoo-commits
commit: dc60b86d63c8bd0421ccace84f8ae2929c790074
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 5 04:01:43 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Tue Jul 5 04:01:43 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=dc60b86d
Chromium sandbox related fixes not needed anymore, upstreamed
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...ault-in-getpwuid-when-stat-fails-BZ-28752.patch | 38 ----------------------
...0014-Drop-glibc-lock-when-returning-early.patch | 36 --------------------
2 files changed, 74 deletions(-)
diff --git a/9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch b/9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
deleted file mode 100644
index 32fd8a6..0000000
--- a/9999/0013-Fix-segfault-in-getpwuid-when-stat-fails-BZ-28752.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From ce54d71af85a735b3ddf29bde1f6ee6e0844d352 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Sat, 12 Feb 2022 19:40:58 +0100
-Subject: [PATCH 13/14] Fix segfault in getpwuid when stat fails (BZ #28752)
-
-[azanella proposed this patch to sam when discussing the issue,
- but it's not anywhere upstream yet- dilfridge]
-
-Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28752
-Bug: https://bugs.gentoo.org/828070
-(cherry picked from commit 1bcdcd4fec9bfe2f1d3fef67a43825903f6a5f2b)
----
- nss/nss_database.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/nss/nss_database.c b/nss/nss_database.c
-index d56c5b798d..133682b858 100644
---- a/nss/nss_database.c
-+++ b/nss/nss_database.c
-@@ -424,10 +424,11 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
- errors here are very unlikely, but the chance that we're entering
- a container is also very unlikely, so we err on the side of both
- very unlikely things not happening at the same time. */
-- if (__stat64_time64 ("/", &str) != 0
-- || (local->root_ino != 0
-- && (str.st_ino != local->root_ino
-- || str.st_dev != local->root_dev)))
-+ if (__stat64_time64 ("/", &str) != 0)
-+ return false;
-+
-+ if (local->root_ino != 0 && (str.st_ino != local->root_ino
-+ || str.st_dev != local->root_dev))
- {
- /* Change detected; disable reloading and return current state. */
- atomic_store_release (&local->data.reload_disabled, 1);
---
-2.35.1
-
diff --git a/9999/0014-Drop-glibc-lock-when-returning-early.patch b/9999/0014-Drop-glibc-lock-when-returning-early.patch
deleted file mode 100644
index ccb544e..0000000
--- a/9999/0014-Drop-glibc-lock-when-returning-early.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From f0967c21f82d9b6db6faa41315f668f56e38562f Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Mon, 7 Mar 2022 01:59:53 +0100
-Subject: [PATCH 14/14] Drop glibc lock when returning early
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fixes 1bcdcd4fec9bfe2f1d3fef67a43825903f6a5f2b
-
-Bug: https://bugs.gentoo.org/828070
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-(cherry picked from commit 81f6a812264e375a695e5b00e2906da8102cc9b6)
----
- nss/nss_database.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/nss/nss_database.c b/nss/nss_database.c
-index 133682b858..5f58baf34b 100644
---- a/nss/nss_database.c
-+++ b/nss/nss_database.c
-@@ -424,8 +424,10 @@ nss_database_check_reload_and_get (struct nss_database_state *local,
- errors here are very unlikely, but the chance that we're entering
- a container is also very unlikely, so we err on the side of both
- very unlikely things not happening at the same time. */
-- if (__stat64_time64 ("/", &str) != 0)
-+ if (__stat64_time64 ("/", &str) != 0) {
-+ __libc_lock_unlock (local->lock);
- return false;
-+ }
-
- if (local->root_ino != 0 && (str.st_ino != local->root_ino
- || str.st_dev != local->root_dev))
---
-2.35.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-07-29 12:20 WANG Xuerui
0 siblings, 0 replies; 38+ messages in thread
From: WANG Xuerui @ 2022-07-29 12:20 UTC (permalink / raw
To: gentoo-commits
commit: c56aedc889ea22901113925b3e037c2019966a14
Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 29 12:17:57 2022 +0000
Commit: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Fri Jul 29 12:17:57 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=c56aedc8
Rebase for the imminent 2.36 release
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 6 +++---
...02-Adapt-to-Gentoo-specific-etc-mail-aliases.patch} | 4 ++--
...ce-O0-in-conform-tests-to-survive-CC-changes.patch} | 4 ++--
... => 0004-Fix-miscompilation-on-ia64-s-gcc-10.patch} | 6 +++---
...-not-skip-entries-with-zero-d_ino-values-BZ-.patch} | 4 ++--
...0006-linux-Use-getdents64-on-non-LFS-readdir.patch} | 4 ++--
...t-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch} | 4 ++--
...patch => 0008-linux-Add-__readdir64_unlocked.patch} | 4 ++--
...h => 0009-linux-Add-__old_readdir64_unlocked.patch} | 4 ++--
...e-getdents64-on-readdir64-compat-implementat.patch} | 4 ++--
...patch => 0011-dirent-Deprecate-getdirentries.patch} | 18 +++++++++---------
...lone-internal.c-make-clone3-syscall-optional.patch} | 6 +++---
12 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 65e2357..7bc6628 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From 4ec3b3446cac3917499fba2c3067dc39bb24bf83 Mon Sep 17 00:00:00 2001
+From 4917be423cb1a70a66e90e39a73e986b011d7687 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
-Subject: [PATCH 01/14] Disable ldconfig during install
+Subject: [PATCH 01/12] Disable ldconfig during install
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -15,7 +15,7 @@ https://bugs.gentoo.org/431038
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index b1454882bd..73c3ef1e76 100644
+index 179dd478ff..763d6a084a 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ elf/ldso_install:
diff --git a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
similarity index 96%
rename from 9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
rename to 9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index a9d0605..56b9db3 100644
--- a/9999/0003-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From 4a1235321c3749726d4f0b3ed0f0769a40d714f9 Mon Sep 17 00:00:00 2001
+From a66ccda34dd319ce19255a029b746362d5773d31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 03/14] Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 02/12] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --git a/9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
similarity index 95%
rename from 9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch
rename to 9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index ce101ab..95fc2c5 100644
--- a/9999/0004-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From 6f332b192b1e0a502d904c608630e3392dd69d15 Mon Sep 17 00:00:00 2001
+From 68476d32783ea64c21bbd6d166a69fa881a3f22b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 04/14] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 03/12] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --git a/9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
similarity index 87%
rename from 9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch
rename to 9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 9024676..b742135 100644
--- a/9999/0005-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From da8126c1493016b2c9aed0c34b240619b7aee075 Mon Sep 17 00:00:00 2001
+From 88e7fe55212b0110dca46b5d3a4b7be8db404598 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH 05/14] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 04/12] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,7 +13,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index 0d2a1d093a..b50694d6f3 100644
+index aa1de6b361..f6472f1942 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
diff --git a/9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch b/9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
similarity index 97%
rename from 9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
rename to 9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
index eae612d..33f9869 100644
--- a/9999/0006-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
+++ b/9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
@@ -1,7 +1,7 @@
-From 2a131fefbe72a749fe28b426a37b499bf7255cdf Mon Sep 17 00:00:00 2001
+From ad50ce9ae10cdd50bd620ae6ef67fe3b11896913 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 12:18:56 -0300
-Subject: [PATCH 06/14] linux: Do not skip entries with zero d_ino values [BZ
+Subject: [PATCH 05/12] linux: Do not skip entries with zero d_ino values [BZ
#12165]
According to Linux commit 2adc376c55194 (vfs: avoid creation of inode
diff --git a/9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch
similarity index 98%
rename from 9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch
rename to 9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch
index 6f8081f..b588195 100644
--- a/9999/0007-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,7 +1,7 @@
-From bda59ff47746fdec69cf4a695d6aeaa4aae2acf8 Mon Sep 17 00:00:00 2001
+From 5e92232132d809ca1a4dde473e3b9d061754db90 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 13:37:15 -0300
-Subject: [PATCH 07/14] linux: Use getdents64 on non-LFS readdir
+Subject: [PATCH 06/12] linux: Use getdents64 on non-LFS readdir
The opendir allocates a translation buffer to be used to return the
non-LFS readdir entry. The obtained dirent64 struct is translated
diff --git a/9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
similarity index 99%
rename from 9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
rename to 9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 68d9ce0..a239bbc 100644
--- a/9999/0008-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,7 +1,7 @@
-From 90aa2d426422b6acc0e7f2b9d8afa2718098601b Mon Sep 17 00:00:00 2001
+From a9813305234d6163d86aa78c062017f05b7a79d6 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 18:09:20 -0300
-Subject: [PATCH 08/14] linux: Set internal DIR filepos as off64_t [BZ #23960,
+Subject: [PATCH 07/12] linux: Set internal DIR filepos as off64_t [BZ #23960,
BZ #24050]
It allows to obtain the expected entry offset on telldir and set
diff --git a/9999/0009-linux-Add-__readdir64_unlocked.patch b/9999/0008-linux-Add-__readdir64_unlocked.patch
similarity index 97%
rename from 9999/0009-linux-Add-__readdir64_unlocked.patch
rename to 9999/0008-linux-Add-__readdir64_unlocked.patch
index 2453183..540ddf7 100644
--- a/9999/0009-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0008-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 91dd23b0cf7a3aa11fae6cd3e71e9d49409f17b0 Mon Sep 17 00:00:00 2001
+From 81cdcf158a683bb9c999967de2e332e5c5881bc9 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 08:35:40 -0300
-Subject: [PATCH 09/14] linux: Add __readdir64_unlocked
+Subject: [PATCH 08/12] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
diff --git a/9999/0010-linux-Add-__old_readdir64_unlocked.patch b/9999/0009-linux-Add-__old_readdir64_unlocked.patch
similarity index 97%
rename from 9999/0010-linux-Add-__old_readdir64_unlocked.patch
rename to 9999/0009-linux-Add-__old_readdir64_unlocked.patch
index d795095..52af81a 100644
--- a/9999/0010-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0009-linux-Add-__old_readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From fa48dff4045e66ef9c65b33e80dbfb1390500b6b Mon Sep 17 00:00:00 2001
+From 82605e1450880ac7d40f1b5d12eecbf2f0815535 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 14 Apr 2020 11:14:22 -0300
-Subject: [PATCH 10/14] linux: Add __old_readdir64_unlocked
+Subject: [PATCH 09/12] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
diff --git a/9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch
similarity index 98%
rename from 9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch
rename to 9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 616e44d..5bbea04 100644
--- a/9999/0011-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,7 +1,7 @@
-From 201d65ca12185f171be7b532b16bc315af7d45c3 Mon Sep 17 00:00:00 2001
+From 7a72e18a7b710feea5375578450e11a106336102 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 16:00:43 -0300
-Subject: [PATCH 11/14] linux: Use getdents64 on readdir64 compat
+Subject: [PATCH 10/12] linux: Use getdents64 on readdir64 compat
implementation
It uses a similar strategy from the non-LFS readdir that also
diff --git a/9999/0012-dirent-Deprecate-getdirentries.patch b/9999/0011-dirent-Deprecate-getdirentries.patch
similarity index 90%
rename from 9999/0012-dirent-Deprecate-getdirentries.patch
rename to 9999/0011-dirent-Deprecate-getdirentries.patch
index 8be7591..c7abd61 100644
--- a/9999/0012-dirent-Deprecate-getdirentries.patch
+++ b/9999/0011-dirent-Deprecate-getdirentries.patch
@@ -1,7 +1,7 @@
-From 40ec9c0d2bdeee4192885f7781167afdeeee899d Mon Sep 17 00:00:00 2001
+From fe14184069e952f57e74f1e599816d0403205ac0 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 17 Apr 2020 09:59:51 -0300
-Subject: [PATCH 12/14] dirent: Deprecate getdirentries
+Subject: [PATCH 11/12] dirent: Deprecate getdirentries
The interface has some issues:
@@ -23,10 +23,10 @@ The idea is to eventually move the symbols to compat ones.
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
-index 4b6d9de2b5..b00c803a1c 100644
+index bc1aac1270..56c4d3ed7e 100644
--- a/NEWS
+++ b/NEWS
-@@ -25,6 +25,12 @@ Security related changes:
+@@ -93,6 +93,12 @@ Security related changes:
[Add security related changes here]
@@ -84,13 +84,13 @@ index c47d3273b2..1c299e5be8 100644
#endif /* Use misc. */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index ca953804d0..26794e4fef 100644
+index a139a16532..237b8ca80a 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -341,6 +341,10 @@ tests += tst-getdents64
- ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
- tests += tst-readdir64-compat
- endif
+@@ -365,6 +365,10 @@ tests += \
+ tst-getdents64 \
+ tst-readdir64-compat \
+ # tests
+
+# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64
+CFLAGS-getdirentries64.o = -Wno-deprecated-declarations
diff --git a/9999/0020-make-clone3-syscall-optional.patch b/9999/0012-clone-internal.c-make-clone3-syscall-optional.patch
similarity index 92%
rename from 9999/0020-make-clone3-syscall-optional.patch
rename to 9999/0012-clone-internal.c-make-clone3-syscall-optional.patch
index 4654f06..bfa21c8 100644
--- a/9999/0020-make-clone3-syscall-optional.patch
+++ b/9999/0012-clone-internal.c-make-clone3-syscall-optional.patch
@@ -1,7 +1,7 @@
-From 57babb0afaa90263a7ea416aa9dc3734bb8ceacc Mon Sep 17 00:00:00 2001
+From e6af617accd984ce1897c1578478f8680e5a24a0 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Wed, 1 Dec 2021 14:58:40 +0000
-Subject: [PATCH 06/14] clone-internal.c: make clone3 syscall optional
+Subject: [PATCH 12/12] clone-internal.c: make clone3 syscall optional
We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
compatibility with applications using older Electron.
@@ -44,5 +44,5 @@ index a71effcbd3..60efe1f453 100644
int saved_errno = errno;
ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
--
-2.34.1
+2.35.1
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-08-08 21:22 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-08-08 21:22 UTC (permalink / raw
To: gentoo-commits
commit: da419fb7e353c19ddc39af56e793dd5ec3fc2beb
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 8 21:21:54 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Aug 8 21:21:54 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=da419fb7
Drop clone3 patch (i.e. enable the syscall unconditionally)
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...e-internal.c-make-clone3-syscall-optional.patch | 48 ----------------------
1 file changed, 48 deletions(-)
diff --git a/9999/0012-clone-internal.c-make-clone3-syscall-optional.patch b/9999/0012-clone-internal.c-make-clone3-syscall-optional.patch
deleted file mode 100644
index bfa21c8..0000000
--- a/9999/0012-clone-internal.c-make-clone3-syscall-optional.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From e6af617accd984ce1897c1578478f8680e5a24a0 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 1 Dec 2021 14:58:40 +0000
-Subject: [PATCH 12/12] clone-internal.c: make clone3 syscall optional
-
-We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
-compatibility with applications using older Electron.
-
-Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
-revert back to always using clone3.
-
-This was impacting e.g. Discord and Skype. This patch stops glibc from using
-clone3 internally (which is the only real use of it) and falls back to the old
-behaviour.
-
-Specifically, we want https://github.com/electron/electron/pull/31091
-to work its way downstream to various Electron applications.
-
-https://bugs.gentoo.org/819045
-https://bugs.gentoo.org/827386
-
-https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/patches/ubuntu/disable-clone3.patch
-
-This is the same as the patch that was considered but ultimately rejected
-for 2.34 because Docker got sorted out in time:
-https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
-
-Signed-off-by: Sam James <sam@gentoo.org>
----
- sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
-index a71effcbd3..60efe1f453 100644
---- a/sysdeps/unix/sysv/linux/clone-internal.c
-+++ b/sysdeps/unix/sysv/linux/clone-internal.c
-@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
- int (*func) (void *arg), void *arg)
- {
- int ret;
--#ifdef HAVE_CLONE3_WRAPPER
-+#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
- /* Try clone3 first. */
- int saved_errno = errno;
- ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
---
-2.35.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-09-19 21:26 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-09-19 21:26 UTC (permalink / raw
To: gentoo-commits
commit: 55f5bd36e540cdf5291da6f067c63e60a3995eb8
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 19 21:25:57 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 21:25:57 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=55f5bd36
Add m68k alignment patch (will hopefully make it into master soon)
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...e-4-byte-alignment-on-internal-locks-BZ-2.patch | 125 +++++++++++++++++++++
1 file changed, 125 insertions(+)
diff --git a/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch b/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch
new file mode 100644
index 0000000..bb738e0
--- /dev/null
+++ b/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch
@@ -0,0 +1,125 @@
+From 2ae75f3f15a2297c2f8924ad7eb492fd17ecae8c Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Mon, 5 Sep 2022 14:10:43 -0300
+Subject: [PATCH] m68k: Enforce 4-byte alignment on internal locks (BZ #29537)
+
+A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
+the 4-byte alignment only for m68k, other architecture keep the
+natural alignment of the type used internally (and hppa does not
+require 16-byte alignment for kernel-assisted CAS).
+---
+ sysdeps/generic/libc-lock-arch.h | 25 +++++++++++++++++++
+ sysdeps/nptl/libc-lock.h | 8 +++++-
+ sysdeps/nptl/libc-lockP.h | 3 ++-
+ sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
+ 4 files changed, 59 insertions(+), 2 deletions(-)
+ create mode 100644 sysdeps/generic/libc-lock-arch.h
+ create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+
+diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
+new file mode 100644
+index 0000000000..4713b30a8a
+--- /dev/null
++++ b/sysdeps/generic/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions. Generic version.
++ Copyright (C) 2022 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public License as
++ published by the Free Software Foundation; either version 2.1 of the
++ License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; see the file COPYING.LIB. If
++ not, see <https://www.gnu.org/licenses/>. */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* The default definition uses the natural alignment from the lock type. */
++#define __LIBC_LOCK_ALIGNMENT
++
++#endif
+diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
+index 5af476c48b..63b3f3d75c 100644
+--- a/sysdeps/nptl/libc-lock.h
++++ b/sysdeps/nptl/libc-lock.h
+@@ -22,6 +22,7 @@
+ #include <pthread.h>
+ #define __need_NULL
+ #include <stddef.h>
++#include <libc-lock-arch.h>
+
+
+ /* Mutex type. */
+@@ -29,7 +30,12 @@
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+ typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+ # else
+-typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
++typedef struct
++{
++ int lock __LIBC_LOCK_ALIGNMENT;
++ int cnt;
++ void *owner;
++} __libc_lock_recursive_t;
+ # endif
+ #else
+ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
+index d3a6837fd2..425f514c5c 100644
+--- a/sysdeps/nptl/libc-lockP.h
++++ b/sysdeps/nptl/libc-lockP.h
+@@ -32,9 +32,10 @@
+ ld.so might be used on old kernels with a different libc.so. */
+ #include <lowlevellock.h>
+ #include <tls.h>
++#include <libc-lock-arch.h>
+
+ /* Mutex type. */
+-typedef int __libc_lock_t;
++typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
+ typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
+ typedef pthread_rwlock_t __libc_rwlock_t;
+
+diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+new file mode 100644
+index 0000000000..1844bbaf6f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
+@@ -0,0 +1,25 @@
++/* Private libc-internal arch-specific definitions. m68k version.
++ Copyright (C) 2022 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public License as
++ published by the Free Software Foundation; either version 2.1 of the
++ License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; see the file COPYING.LIB. If
++ not, see <https://www.gnu.org/licenses/>. */
++
++#ifndef _LIBC_LOCK_ARCH_H
++#define _LIBC_LOCK_ARCH_H
++
++/* Linux enforces 4-bytes alignment on futex inputs. */
++#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
++
++#endif
+--
+2.35.1
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2022-09-20 17:56 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2022-09-20 17:56 UTC (permalink / raw
To: gentoo-commits
commit: a3a4be77a7fa8abec73228246e0fbb95584e0ec4
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 20 17:55:38 2022 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Tue Sep 20 17:56:09 2022 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=a3a4be77
Revert "Add m68k alignment patch (will hopefully make it into master soon)"
Now in master.
This reverts commit 55f5bd36e540cdf5291da6f067c63e60a3995eb8.
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...e-4-byte-alignment-on-internal-locks-BZ-2.patch | 125 ---------------------
1 file changed, 125 deletions(-)
diff --git a/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch b/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch
deleted file mode 100644
index bb738e0..0000000
--- a/9999/0012-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 2ae75f3f15a2297c2f8924ad7eb492fd17ecae8c Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Mon, 5 Sep 2022 14:10:43 -0300
-Subject: [PATCH] m68k: Enforce 4-byte alignment on internal locks (BZ #29537)
-
-A new internal definition, __LIBC_LOCK_ALIGNMENT, is used to force
-the 4-byte alignment only for m68k, other architecture keep the
-natural alignment of the type used internally (and hppa does not
-require 16-byte alignment for kernel-assisted CAS).
----
- sysdeps/generic/libc-lock-arch.h | 25 +++++++++++++++++++
- sysdeps/nptl/libc-lock.h | 8 +++++-
- sysdeps/nptl/libc-lockP.h | 3 ++-
- sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h | 25 +++++++++++++++++++
- 4 files changed, 59 insertions(+), 2 deletions(-)
- create mode 100644 sysdeps/generic/libc-lock-arch.h
- create mode 100644 sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
-
-diff --git a/sysdeps/generic/libc-lock-arch.h b/sysdeps/generic/libc-lock-arch.h
-new file mode 100644
-index 0000000000..4713b30a8a
---- /dev/null
-+++ b/sysdeps/generic/libc-lock-arch.h
-@@ -0,0 +1,25 @@
-+/* Private libc-internal arch-specific definitions. Generic version.
-+ Copyright (C) 2022 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public License as
-+ published by the Free Software Foundation; either version 2.1 of the
-+ License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; see the file COPYING.LIB. If
-+ not, see <https://www.gnu.org/licenses/>. */
-+
-+#ifndef _LIBC_LOCK_ARCH_H
-+#define _LIBC_LOCK_ARCH_H
-+
-+/* The default definition uses the natural alignment from the lock type. */
-+#define __LIBC_LOCK_ALIGNMENT
-+
-+#endif
-diff --git a/sysdeps/nptl/libc-lock.h b/sysdeps/nptl/libc-lock.h
-index 5af476c48b..63b3f3d75c 100644
---- a/sysdeps/nptl/libc-lock.h
-+++ b/sysdeps/nptl/libc-lock.h
-@@ -22,6 +22,7 @@
- #include <pthread.h>
- #define __need_NULL
- #include <stddef.h>
-+#include <libc-lock-arch.h>
-
-
- /* Mutex type. */
-@@ -29,7 +30,12 @@
- # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
- typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
- # else
--typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
-+typedef struct
-+{
-+ int lock __LIBC_LOCK_ALIGNMENT;
-+ int cnt;
-+ void *owner;
-+} __libc_lock_recursive_t;
- # endif
- #else
- typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-diff --git a/sysdeps/nptl/libc-lockP.h b/sysdeps/nptl/libc-lockP.h
-index d3a6837fd2..425f514c5c 100644
---- a/sysdeps/nptl/libc-lockP.h
-+++ b/sysdeps/nptl/libc-lockP.h
-@@ -32,9 +32,10 @@
- ld.so might be used on old kernels with a different libc.so. */
- #include <lowlevellock.h>
- #include <tls.h>
-+#include <libc-lock-arch.h>
-
- /* Mutex type. */
--typedef int __libc_lock_t;
-+typedef int __libc_lock_t __LIBC_LOCK_ALIGNMENT;
- typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
- typedef pthread_rwlock_t __libc_rwlock_t;
-
-diff --git a/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
-new file mode 100644
-index 0000000000..1844bbaf6f
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/m68k/libc-lock-arch.h
-@@ -0,0 +1,25 @@
-+/* Private libc-internal arch-specific definitions. m68k version.
-+ Copyright (C) 2022 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public License as
-+ published by the Free Software Foundation; either version 2.1 of the
-+ License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; see the file COPYING.LIB. If
-+ not, see <https://www.gnu.org/licenses/>. */
-+
-+#ifndef _LIBC_LOCK_ARCH_H
-+#define _LIBC_LOCK_ARCH_H
-+
-+/* Linux enforces 4-bytes alignment on futex inputs. */
-+#define __LIBC_LOCK_ALIGNMENT __attribute__ ((__aligned__ (4)))
-+
-+#endif
---
-2.35.1
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-01-01 18:42 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-01-01 18:42 UTC (permalink / raw
To: gentoo-commits
commit: 82af9273c46fe3f6227d0bf0e9198a11f8a82156
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 1 18:29:39 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jan 1 18:29:39 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=82af9273
Update dirent-related patchset from azanella/bz23960-dirent git branch
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 10 +-
...Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 7 +-
...O0-in-conform-tests-to-survive-CC-changes.patch | 6 +-
.../0004-Fix-miscompilation-on-ia64-s-gcc-10.patch | 6 +-
...t-skip-entries-with-zero-d_ino-values-BZ-.patch | 182 ---------------------
...-linux-Use-getdents64-on-non-LFS-readdir.patch} | 61 ++++---
...ternal-DIR-filepos-as-off64_t-BZ-23960-B.patch} | 10 +-
...h => 0007-linux-Add-__readdir64_unlocked.patch} | 17 +-
... 0008-linux-Add-__old_readdir64_unlocked.patch} | 34 ++--
...tdents64-on-readdir64-compat-implementat.patch} | 95 ++++-------
...h => 0010-dirent-Deprecate-getdirentries.patch} | 29 ++--
11 files changed, 126 insertions(+), 331 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 7bc6628..4a8c771 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,10 @@
-From 4917be423cb1a70a66e90e39a73e986b011d7687 Mon Sep 17 00:00:00 2001
+From 5349895a928bff28939b228824c8265d20d9fa60 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
-Subject: [PATCH 01/12] Disable ldconfig during install
+Subject: [PATCH 01/10] Disable ldconfig during install
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
Do not bother running ldconfig on DESTDIR. It's a waste of time as we
won't use the result (portage will rebuild the cache after install).
@@ -10,6 +13,7 @@ we end up (incorrectly) flagging it as a violation as a write to /etc.
http://sourceware.org/ml/libc-alpha/2012-08/msg00118.html
https://bugs.gentoo.org/431038
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
@@ -27,5 +31,5 @@ index 179dd478ff..763d6a084a 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.35.1
+2.38.2
diff --git a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 56b9db3..559e736 100644
--- a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From a66ccda34dd319ce19255a029b746362d5773d31 Mon Sep 17 00:00:00 2001
+From ab1ca71990a972e375709711f5fa268010505324 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 02/12] Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 02/10] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -10,6 +10,7 @@ Patch by pacho2
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
(cherry picked from commit 4e616cda056f471b799beba2b1cedc787ad4ecc0)
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
nss/nss_files/files-alias.c | 2 +-
nss/tst-nss-files-alias-leak.c | 18 +++++++++---------
@@ -104,5 +105,5 @@ index 4bf6fe0834..1548eba2ad 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.35.1
+2.38.2
diff --git a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index 95fc2c5..f662cda 100644
--- a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From 68476d32783ea64c21bbd6d166a69fa881a3f22b Mon Sep 17 00:00:00 2001
+From f44c6c3768c2a3ef274782a2e308fb6b8fe84499 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 03/12] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 03/10] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -61,5 +61,5 @@ index f7fe3a7a0a..ad87fd2a6d 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.35.1
+2.38.2
diff --git a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
index b742135..2d9c8f7 100644
--- a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From 88e7fe55212b0110dca46b5d3a4b7be8db404598 Mon Sep 17 00:00:00 2001
+From 4aafe3fae7777fec09e2dd3915a8fd33642bba94 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH 04/12] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 04/10] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -28,5 +28,5 @@ index aa1de6b361..f6472f1942 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.35.1
+2.38.2
diff --git a/9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch b/9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
deleted file mode 100644
index 33f9869..0000000
--- a/9999/0005-linux-Do-not-skip-entries-with-zero-d_ino-values-BZ-.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From ad50ce9ae10cdd50bd620ae6ef67fe3b11896913 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Tue, 20 Oct 2020 12:18:56 -0300
-Subject: [PATCH 05/12] linux: Do not skip entries with zero d_ino values [BZ
- #12165]
-
-According to Linux commit 2adc376c55194 (vfs: avoid creation of inode
-number 0 in get_next_ino) Linux did not treat d_ino == 0 as a special
-case (it is a valid inode number).
-
-This patch fixes readdir{64} by not ignoring entried with d_ino being
-0.
-
-Checked on x86_64-linux-gnu and i686-linux-gnu.
----
- sysdeps/unix/sysv/linux/readdir.c | 59 +++++++++++------------------
- sysdeps/unix/sysv/linux/readdir64.c | 59 +++++++++++------------------
- 2 files changed, 44 insertions(+), 74 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index c31f349639..7743f50071 100644
---- a/sysdeps/unix/sysv/linux/readdir.c
-+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -25,51 +25,36 @@
- struct dirent *
- __readdir_unlocked (DIR *dirp)
- {
-- struct dirent *dp;
-- int saved_errno = errno;
-+ const int saved_errno = errno;
-
-- do
-+ if (dirp->offset >= dirp->size)
- {
-- size_t reclen;
--
-- if (dirp->offset >= dirp->size)
-+ /* We've emptied out our buffer. Refill it. */
-+ ssize_t bytes = __getdents (dirp->fd, dirp->data, dirp->allocation);
-+ if (bytes <= 0)
- {
-- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- bytes = __getdents (dirp->fd, dirp->data, maxread);
-- if (bytes <= 0)
-- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- bytes = 0;
--
-- /* Don't modifiy errno when reaching EOF. */
-- if (bytes == 0)
-- __set_errno (saved_errno);
-- dp = NULL;
-- break;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-+ /* On some systems getdents fails with ENOENT when the
-+ open directory has been rmdir'd already. POSIX.1
-+ requires that we treat this condition like normal EOF. */
-+ if (bytes < 0 && errno == ENOENT)
-+ bytes = 0;
-+
-+ /* Don't modifiy errno when reaching EOF. */
-+ if (bytes == 0)
-+ __set_errno (saved_errno);
-+ return NULL;
- }
-+ dirp->size = bytes;
-
-- dp = (struct dirent *) &dirp->data[dirp->offset];
--
-- reclen = dp->d_reclen;
-+ /* Reset the offset into the buffer. */
-+ dirp->offset = 0;
-+ }
-
-- dirp->offset += reclen;
-+ struct dirent *dp = (struct dirent *) &dirp->data[dirp->offset];
-
-- dirp->filepos = dp->d_off;
-+ dirp->offset += dp->d_reclen;
-
-- /* Skip deleted files. */
-- } while (dp->d_ino == 0);
-+ dirp->filepos = dp->d_off;
-
- return dp;
- }
-diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index e876d84b02..d990a36e4e 100644
---- a/sysdeps/unix/sysv/linux/readdir64.c
-+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -30,55 +30,40 @@
- struct dirent64 *
- __readdir64 (DIR *dirp)
- {
-- struct dirent64 *dp;
-- int saved_errno = errno;
-+ const int saved_errno = errno;
-
- #if IS_IN (libc)
- __libc_lock_lock (dirp->lock);
- #endif
-
-- do
-+ if (dirp->offset >= dirp->size)
- {
-- size_t reclen;
--
-- if (dirp->offset >= dirp->size)
-+ /* We've emptied out our buffer. Refill it. */
-+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data, dirp->allocation);
-+ if (bytes <= 0)
- {
-- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- bytes = __getdents64 (dirp->fd, dirp->data, maxread);
-- if (bytes <= 0)
-- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- bytes = 0;
--
-- /* Don't modifiy errno when reaching EOF. */
-- if (bytes == 0)
-- __set_errno (saved_errno);
-- dp = NULL;
-- break;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-+ /* On some systems getdents fails with ENOENT when the
-+ open directory has been rmdir'd already. POSIX.1
-+ requires that we treat this condition like normal EOF. */
-+ if (bytes < 0 && errno == ENOENT)
-+ bytes = 0;
-+
-+ /* Don't modifiy errno when reaching EOF. */
-+ if (bytes == 0)
-+ __set_errno (saved_errno);
-+ return NULL;
- }
-+ dirp->size = bytes;
-
-- dp = (struct dirent64 *) &dirp->data[dirp->offset];
--
-- reclen = dp->d_reclen;
-+ /* Reset the offset into the buffer. */
-+ dirp->offset = 0;
-+ }
-
-- dirp->offset += reclen;
-+ struct dirent64 *dp = (struct dirent64 *) &dirp->data[dirp->offset];
-
-- dirp->filepos = dp->d_off;
-+ dirp->offset += dp->d_reclen;
-
-- /* Skip deleted files. */
-- } while (dp->d_ino == 0);
-+ dirp->filepos = dp->d_off;
-
- #if IS_IN (libc)
- __libc_lock_unlock (dirp->lock);
---
-2.35.1
-
diff --git a/9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
similarity index 82%
rename from 9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch
rename to 9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
index b588195..4e1dc0d 100644
--- a/9999/0006-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,7 +1,7 @@
-From 5e92232132d809ca1a4dde473e3b9d061754db90 Mon Sep 17 00:00:00 2001
+From 0718c1ca37fe6407bd4bad15dfae873719eabb6e Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 13:37:15 -0300
-Subject: [PATCH 06/12] linux: Use getdents64 on non-LFS readdir
+Subject: [PATCH 05/10] linux: Use getdents64 on non-LFS readdir
The opendir allocates a translation buffer to be used to return the
non-LFS readdir entry. The obtained dirent64 struct is translated
@@ -15,8 +15,8 @@ Checked on x86_64-linux-gnu and i686-linux-gnu.
sysdeps/unix/sysv/linux/closedir.c | 4 ++
sysdeps/unix/sysv/linux/dirstream.h | 5 ++
sysdeps/unix/sysv/linux/opendir.c | 21 +++++++
- sysdeps/unix/sysv/linux/readdir.c | 97 +++++++++++++++++++++--------
- 4 files changed, 101 insertions(+), 26 deletions(-)
+ sysdeps/unix/sysv/linux/readdir.c | 94 +++++++++++++++++++++--------
+ 4 files changed, 98 insertions(+), 26 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
index eee0193fc4..d876d49d78 100644
@@ -82,10 +82,10 @@ index 9e81d00630..bfd2f382a6 100644
#if IS_IN (libc)
__libc_lock_init (dirp->lock);
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index 7743f50071..7b4571839e 100644
+index c9a04dc160..c078146d7d 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -21,42 +21,87 @@
+@@ -21,42 +21,84 @@
#if !_DIRENT_MATCHES_DIRENT64
#include <dirstream.h>
@@ -131,39 +131,31 @@ index 7743f50071..7b4571839e 100644
struct dirent *
__readdir_unlocked (DIR *dirp)
{
- const int saved_errno = errno;
+- struct dirent *dp;
+ int saved_errno = errno;
- if (dirp->offset >= dirp->size)
+ while (1)
{
- /* We've emptied out our buffer. Refill it. */
-- ssize_t bytes = __getdents (dirp->fd, dirp->data, dirp->allocation);
+-
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- bytes = __getdents (dirp->fd, dirp->data, maxread);
- if (bytes <= 0)
+ if (dirp->offset >= dirp->size)
- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- bytes = 0;
--
-- /* Don't modifiy errno when reaching EOF. */
-- if (bytes == 0)
-- __set_errno (saved_errno);
-- return NULL;
++ {
+ /* We've emptied out our buffer. Refill it. */
+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data,
+ dirp->allocation);
+ if (bytes <= 0)
+ {
-+ /* On some systems getdents fails with ENOENT when the
-+ open directory has been rmdir'd already. POSIX.1
-+ requires that we treat this condition like normal EOF. */
++ /* Linux may fail with ENOENT on some file systems if the
++ directory inode is marked as dead (deleted). POSIX
++ treats this as a regular end-of-directory condition, so
++ do not set errno in that case, to indicate success. */
+ if (bytes < 0 && errno == ENOENT)
-+ bytes = 0;
-+
-+ /* Don't modifiy errno when reaching EOF. */
-+ if (bytes == 0)
+ __set_errno (saved_errno);
+ return NULL;
+ }
@@ -179,20 +171,25 @@ index 7743f50071..7b4571839e 100644
+ /* Skip entries which might overflow d_off/d_ino or if the translation
+ buffer can't be resized. */
+ if (dirstream_entry (dirp, dp64))
-+ {
+ {
+- /* Linux may fail with ENOENT on some file systems if the
+- directory inode is marked as dead (deleted). POSIX
+- treats this as a regular end-of-directory condition, so
+- do not set errno in that case, to indicate success. */
+- if (bytes == 0 || errno == ENOENT)
+- __set_errno (saved_errno);
+- return NULL;
+ dirp->filepos = dp64->d_off;
+ return (struct dirent *) dirp->tbuffer;
}
-- dirp->size = bytes;
+- dirp->size = (size_t) bytes;
-
- /* Reset the offset into the buffer. */
- dirp->offset = 0;
}
-
-- struct dirent *dp = (struct dirent *) &dirp->data[dirp->offset];
--
+- dp = (struct dirent *) &dirp->data[dirp->offset];
- dirp->offset += dp->d_reclen;
--
- dirp->filepos = dp->d_off;
-
- return dp;
@@ -200,5 +197,5 @@ index 7743f50071..7b4571839e 100644
struct dirent *
--
-2.35.1
+2.38.2
diff --git a/9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
similarity index 98%
rename from 9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
rename to 9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index a239bbc..38acaf8 100644
--- a/9999/0007-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,7 +1,7 @@
-From a9813305234d6163d86aa78c062017f05b7a79d6 Mon Sep 17 00:00:00 2001
+From 36f553f67b8268341b7879640637fac5ea806017 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 18:09:20 -0300
-Subject: [PATCH 07/12] linux: Set internal DIR filepos as off64_t [BZ #23960,
+Subject: [PATCH 06/10] linux: Set internal DIR filepos as off64_t [BZ #23960,
BZ #24050]
It allows to obtain the expected entry offset on telldir and set
@@ -39,7 +39,7 @@ and arm-linux-gnueabihf.
create mode 100644 sysdeps/unix/sysv/linux/telldir.h
diff --git a/dirent/Makefile b/dirent/Makefile
-index b80f6a73ea..65119db578 100644
+index cfa61826ed..9a9d91b8a5 100644
--- a/dirent/Makefile
+++ b/dirent/Makefile
@@ -31,7 +31,7 @@ routines := opendir closedir readdir readdir_r rewinddir \
@@ -276,7 +276,7 @@ index bfd2f382a6..9a0b7ab4c4 100644
return dirp;
}
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index 7b4571839e..94ac4cbae7 100644
+index c078146d7d..f377e5f268 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
@@ -17,6 +17,7 @@
@@ -490,5 +490,5 @@ index 0000000000..7c45886341
+
+#endif /* _TELLDIR_H */
--
-2.35.1
+2.38.2
diff --git a/9999/0008-linux-Add-__readdir64_unlocked.patch b/9999/0007-linux-Add-__readdir64_unlocked.patch
similarity index 93%
rename from 9999/0008-linux-Add-__readdir64_unlocked.patch
rename to 9999/0007-linux-Add-__readdir64_unlocked.patch
index 540ddf7..631550c 100644
--- a/9999/0008-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0007-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 81cdcf158a683bb9c999967de2e332e5c5881bc9 Mon Sep 17 00:00:00 2001
+From 4cca67d0d2d615918e05db864c236e33c0fda8f3 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 13 Apr 2020 08:35:40 -0300
-Subject: [PATCH 08/12] linux: Add __readdir64_unlocked
+Subject: [PATCH 07/10] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
@@ -25,17 +25,18 @@ index d7567f5e86..0c6715d0e4 100644
libc_hidden_proto (__readdir64)
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index d990a36e4e..c4539f6d96 100644
+index 7952da5c27..9d82054182 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -28,14 +28,10 @@
+@@ -28,15 +28,11 @@
/* Read a directory entry from DIRP. */
struct dirent64 *
-__readdir64 (DIR *dirp)
+__readdir64_unlocked (DIR *dirp)
{
- const int saved_errno = errno;
+ struct dirent64 *dp;
+ int saved_errno = errno;
-#if IS_IN (libc)
- __libc_lock_lock (dirp->lock);
@@ -44,8 +45,8 @@ index d990a36e4e..c4539f6d96 100644
if (dirp->offset >= dirp->size)
{
/* We've emptied out our buffer. Refill it. */
-@@ -65,6 +61,20 @@ __readdir64 (DIR *dirp)
-
+@@ -68,6 +64,20 @@ __readdir64 (DIR *dirp)
+ dirp->offset += dp->d_reclen;
dirp->filepos = dp->d_off;
+ return dp;
@@ -177,5 +178,5 @@ index afd7f9af0f..32962a176a 100644
--
-2.35.1
+2.38.2
diff --git a/9999/0009-linux-Add-__old_readdir64_unlocked.patch b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
similarity index 84%
rename from 9999/0009-linux-Add-__old_readdir64_unlocked.patch
rename to 9999/0008-linux-Add-__old_readdir64_unlocked.patch
index 52af81a..3cd2923 100644
--- a/9999/0009-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
@@ -1,16 +1,16 @@
-From 82605e1450880ac7d40f1b5d12eecbf2f0815535 Mon Sep 17 00:00:00 2001
+From cd6d96ae0a09c1bff40f19d54e2910d7d4e74864 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 14 Apr 2020 11:14:22 -0300
-Subject: [PATCH 09/12] linux: Add __old_readdir64_unlocked
+Subject: [PATCH 08/10] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
Checked on i686-linux-gnu.
---
sysdeps/unix/sysv/linux/olddirent.h | 2 +
- sysdeps/unix/sysv/linux/readdir64.c | 21 +++++--
+ sysdeps/unix/sysv/linux/readdir64.c | 24 +++++---
sysdeps/unix/sysv/linux/readdir64_r.c | 79 ++++++---------------------
- 3 files changed, 35 insertions(+), 67 deletions(-)
+ 3 files changed, 35 insertions(+), 70 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
index 9a22609177..00c84b9521 100644
@@ -26,10 +26,10 @@ index 9a22609177..00c84b9521 100644
struct __old_dirent64 **__result);
extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index c4539f6d96..dbf6a8c54d 100644
+index 9d82054182..bbe247f95d 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -101,15 +101,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+@@ -104,15 +104,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
attribute_compat_text_section
struct __old_dirent64 *
@@ -43,12 +43,22 @@ index c4539f6d96..dbf6a8c54d 100644
- __libc_lock_lock (dirp->lock);
-#endif
-
- do
+ if (dirp->offset >= dirp->size)
{
- size_t reclen;
-@@ -153,6 +149,21 @@ __old_readdir64 (DIR *dirp)
- /* Skip deleted files. */
- } while (dp->d_ino == 0);
+ /* We've emptied out our buffer. Refill it. */
+@@ -129,9 +125,6 @@ __old_readdir64 (DIR *dirp)
+ do not set errno in that case, to indicate success. */
+ if (bytes == 0 || errno == ENOENT)
+ __set_errno (saved_errno);
+-#if IS_IN (libc)
+- __libc_lock_unlock (dirp->lock);
+-#endif
+ return NULL;
+ }
+ dirp->size = (size_t) bytes;
+@@ -144,6 +137,21 @@ __old_readdir64 (DIR *dirp)
+ dirp->offset += dp->d_reclen;
+ dirp->filepos = dp->d_off;
+ return dp;
+}
@@ -180,5 +190,5 @@ index 32962a176a..699d120b76 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.35.1
+2.38.2
diff --git a/9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
similarity index 78%
rename from 9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch
rename to 9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 5bbea04..7a9c5a3 100644
--- a/9999/0010-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,7 +1,7 @@
-From 7a72e18a7b710feea5375578450e11a106336102 Mon Sep 17 00:00:00 2001
+From c71a60022adc7c9b7e37a813e2abad0d0724245a Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 20 Oct 2020 16:00:43 -0300
-Subject: [PATCH 10/12] linux: Use getdents64 on readdir64 compat
+Subject: [PATCH 09/10] linux: Use getdents64 on readdir64 compat
implementation
It uses a similar strategy from the non-LFS readdir that also
@@ -12,11 +12,11 @@ It allows to remove __old_getdents64.
Checked on i686-linux-gnu.
---
- sysdeps/unix/sysv/linux/getdents64.c | 93 ------------------------
- sysdeps/unix/sysv/linux/olddirent.h | 2 -
- sysdeps/unix/sysv/linux/opendir.c | 15 +++-
- sysdeps/unix/sysv/linux/readdir64.c | 104 +++++++++++++++++----------
- 4 files changed, 79 insertions(+), 135 deletions(-)
+ sysdeps/unix/sysv/linux/getdents64.c | 93 ----------------------------
+ sysdeps/unix/sysv/linux/olddirent.h | 2 -
+ sysdeps/unix/sysv/linux/opendir.c | 15 ++++-
+ sysdeps/unix/sysv/linux/readdir64.c | 62 +++++++++++++++----
+ 4 files changed, 64 insertions(+), 108 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
index 510a586859..92481526c5 100644
@@ -167,10 +167,10 @@ index 9a0b7ab4c4..df40b0a64e 100644
dirp->tbuffer = malloc (tbuffer_size);
if (dirp->tbuffer == NULL)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index dbf6a8c54d..4b41299c6c 100644
+index bbe247f95d..01e834e238 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -99,57 +99,83 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+@@ -102,21 +102,52 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
# include <olddirent.h>
@@ -218,68 +218,36 @@ index dbf6a8c54d..4b41299c6c 100644
- int saved_errno = errno;
+ const int saved_errno = errno;
-- do
-+ if (dirp->offset >= dirp->size)
+ if (dirp->offset >= dirp->size)
{
-- size_t reclen;
+ /* We've emptied out our buffer. Refill it. */
-
-- if (dirp->offset >= dirp->size)
-+ /* We've emptied out our buffer. Refill it. */
+- size_t maxread = dirp->allocation;
+- ssize_t bytes;
+-
+- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data, dirp->allocation);
-+ if (bytes <= 0)
+ if (bytes <= 0)
{
-- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
-- if (bytes <= 0)
-- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- bytes = 0;
--
-- /* Don't modifiy errno when reaching EOF. */
-- if (bytes == 0)
-- __set_errno (saved_errno);
-- dp = NULL;
-- break;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-- }
--
-- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
-+ /* On some systems getdents fails with ENOENT when the
-+ open directory has been rmdir'd already. POSIX.1
-+ requires that we treat this condition like normal EOF. */
-+ if (bytes < 0 && errno == ENOENT)
-+ bytes = 0;
-
-- reclen = dp->d_reclen;
-+ /* Don't modifiy errno when reaching EOF. */
-+ if (bytes == 0)
-+ __set_errno (saved_errno);
-+ return NULL;
-+ }
+ /* Linux may fail with ENOENT on some file systems if the
+@@ -127,17 +158,24 @@ __old_readdir64_unlocked (DIR *dirp)
+ __set_errno (saved_errno);
+ return NULL;
+ }
+- dirp->size = (size_t) bytes;
+ dirp->size = bytes;
-- dirp->offset += reclen;
-+ /* Reset the offset into the buffer. */
-+ dirp->offset = 0;
-+ }
+ /* Reset the offset into the buffer. */
+ dirp->offset = 0;
+ }
-- dirp->filepos = dp->d_off;
+- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
+- dirp->offset += dp->d_reclen;
+- dirp->filepos = dp->d_off;
+ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
+ dirp->offset += dp64->d_reclen;
-- /* Skip deleted files. */
-- } while (dp->d_ino == 0);
+- return dp;
+ /* Skip entries which might overflow d_ino or for memory allocation failure
+ in case of large file names. */
+ if (dirstream_old_entry (dirp, dp64))
@@ -287,12 +255,11 @@ index dbf6a8c54d..4b41299c6c 100644
+ dirp->filepos = dp64->d_off;
+ return (struct __old_dirent64 *) dirp->tbuffer;
+ }
-
-- return dp;
++
+ return NULL;
}
attribute_compat_text_section
--
-2.35.1
+2.38.2
diff --git a/9999/0011-dirent-Deprecate-getdirentries.patch b/9999/0010-dirent-Deprecate-getdirentries.patch
similarity index 82%
rename from 9999/0011-dirent-Deprecate-getdirentries.patch
rename to 9999/0010-dirent-Deprecate-getdirentries.patch
index c7abd61..28f744a 100644
--- a/9999/0011-dirent-Deprecate-getdirentries.patch
+++ b/9999/0010-dirent-Deprecate-getdirentries.patch
@@ -1,7 +1,7 @@
-From fe14184069e952f57e74f1e599816d0403205ac0 Mon Sep 17 00:00:00 2001
+From 2f0668caf22acf6493dce8dcfd670e4b35fb6892 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 17 Apr 2020 09:59:51 -0300
-Subject: [PATCH 11/12] dirent: Deprecate getdirentries
+Subject: [PATCH 10/10] dirent: Deprecate getdirentries
The interface has some issues:
@@ -17,28 +17,25 @@ The interface has some issues:
The idea is to eventually move the symbols to compat ones.
---
- NEWS | 6 ++++++
+ NEWS | 3 +++
dirent/dirent.h | 14 ++++++++++----
sysdeps/unix/sysv/linux/Makefile | 4 ++++
- 3 files changed, 20 insertions(+), 4 deletions(-)
+ 3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
-index bc1aac1270..56c4d3ed7e 100644
+index a10bb08fb0..2b4ed6bbc1 100644
--- a/NEWS
+++ b/NEWS
-@@ -93,6 +93,12 @@ Security related changes:
+@@ -21,6 +21,9 @@ Deprecated and removed features, and other changes affecting compatibility:
+ corresponds to the AT_PLATFORM system name, or employs the legacy AT_HWCAP
+ search mechanism, which was deprecated in version 2.33.
- [Add security related changes here]
-
-+Deprecated and removed features, and other changes affecting compatibility:
-+
+* The function getdirentries is now deprecated, applications should use
+ either getdents64, readdir64 or readdir.
+
-+
- The following bugs are resolved with this release:
+ Changes to build and runtime requirements:
- [The release manager will add the list generated by
+ [Add changes to build and runtime requirements here]
diff --git a/dirent/dirent.h b/dirent/dirent.h
index c47d3273b2..1c299e5be8 100644
--- a/dirent/dirent.h
@@ -84,10 +81,10 @@ index c47d3273b2..1c299e5be8 100644
#endif /* Use misc. */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index a139a16532..237b8ca80a 100644
+index f298878e8f..41e5341450 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -365,6 +365,10 @@ tests += \
+@@ -467,6 +467,10 @@ tests += \
tst-getdents64 \
tst-readdir64-compat \
# tests
@@ -99,5 +96,5 @@ index a139a16532..237b8ca80a 100644
ifeq ($(subdir),nis)
--
-2.35.1
+2.38.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-02-01 19:47 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-02-01 19:47 UTC (permalink / raw
To: gentoo-commits
commit: 4e94f64bd9462f55e52de64d1c49b20cdfc686a3
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 1 19:44:39 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Feb 1 19:44:39 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=4e94f64b
Update dirent-related patchset from libc-alpha archive (v5)
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 8 +-
...Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 12 +-
...O0-in-conform-tests-to-survive-CC-changes.patch | 10 +-
.../0004-Fix-miscompilation-on-ia64-s-gcc-10.patch | 8 +-
...5-linux-Use-getdents64-on-non-LFS-readdir.patch | 190 +++----
...nternal-DIR-filepos-as-off64_t-BZ-23960-B.patch | 616 +++++++++++----------
9999/0007-linux-Add-__readdir64_unlocked.patch | 14 +-
9999/0008-linux-Add-__old_readdir64_unlocked.patch | 14 +-
...etdents64-on-readdir64-compat-implementat.patch | 123 ++--
9999/0010-dirent-Deprecate-getdirentries.patch | 100 ----
10 files changed, 500 insertions(+), 595 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 4a8c771..e947fac 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,7 +1,7 @@
-From 5349895a928bff28939b228824c8265d20d9fa60 Mon Sep 17 00:00:00 2001
+From 3b59ad9dec2c1c7f1b4c7f72d14ea3f2b68a4eca Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
-Subject: [PATCH 01/10] Disable ldconfig during install
+Subject: [PATCH 1/9] Disable ldconfig during install
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -19,7 +19,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index 179dd478ff..763d6a084a 100644
+index 224c792185..be9df042e0 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ elf/ldso_install:
@@ -31,5 +31,5 @@ index 179dd478ff..763d6a084a 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.38.2
+2.39.1
diff --git a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 559e736..09c2dde 100644
--- a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,7 +1,7 @@
-From ab1ca71990a972e375709711f5fa268010505324 Mon Sep 17 00:00:00 2001
+From d8a45f4bfa30b502647a9ef742836c7e8694d009 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
-Subject: [PATCH 02/10] Adapt to Gentoo-specific /etc/mail/aliases
+Subject: [PATCH 2/9] Adapt to Gentoo-specific /etc/mail/aliases
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -18,7 +18,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 505721388f..44d835cace 100644
+index 1c32884fe7..f40fd19288 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
@@ -42,7 +42,7 @@ internal_setent (FILE **stream)
@@ -31,7 +31,7 @@ index 505721388f..44d835cace 100644
if (*stream == NULL)
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
-index 576f07fa0a..29962764e2 100644
+index a62e137614..f0cd132ce6 100644
--- a/nss/tst-nss-files-alias-leak.c
+++ b/nss/tst-nss-files-alias-leak.c
@@ -45,27 +45,27 @@ prepare (int argc, char **argv)
@@ -80,7 +80,7 @@ index 576f07fa0a..29962764e2 100644
FILE *fp = xfopen (path, "w");
for (int i = 0; i < many_aliases; ++i)
diff --git a/support/support_chroot.c b/support/support_chroot.c
-index 4bf6fe0834..1548eba2ad 100644
+index 7a1b7272f0..500c9a79a3 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -52,13 +52,19 @@ support_chroot_create (struct support_chroot_configuration conf)
@@ -105,5 +105,5 @@ index 4bf6fe0834..1548eba2ad 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.38.2
+2.39.1
diff --git a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index f662cda..ac36f58 100644
--- a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,7 +1,7 @@
-From f44c6c3768c2a3ef274782a2e308fb6b8fe84499 Mon Sep 17 00:00:00 2001
+From d2b4275295e9c5a312063c3bce663ae1dcf754f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
-Subject: [PATCH 03/10] Force -O0 in conform tests to survive $CC changes
+Subject: [PATCH 3/9] Force -O0 in conform tests to survive $CC changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -22,7 +22,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/conform/conformtest.py b/conform/conformtest.py
-index 94a7ee110f..90c81ac88e 100644
+index 124860da01..8b1643a097 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -566,7 +566,7 @@ class HeaderTests(object):
@@ -46,7 +46,7 @@ index 94a7ee110f..90c81ac88e 100644
subprocess.check_call(cmd, shell=True)
bad_tokens = set()
diff --git a/conform/linknamespace.py b/conform/linknamespace.py
-index f7fe3a7a0a..ad87fd2a6d 100644
+index 983bba1bd2..b6fce8a21c 100644
--- a/conform/linknamespace.py
+++ b/conform/linknamespace.py
@@ -157,7 +157,9 @@ def main():
@@ -61,5 +61,5 @@ index f7fe3a7a0a..ad87fd2a6d 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.38.2
+2.39.1
diff --git a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 2d9c8f7..215b5fa 100644
--- a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,7 +1,7 @@
-From 4aafe3fae7777fec09e2dd3915a8fd33642bba94 Mon Sep 17 00:00:00 2001
+From 7a2ab3f8d680338aff2559541a4bb748618e16f6 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH 04/10] Fix miscompilation on ia64's gcc-10
+Subject: [PATCH 4/9] Fix miscompilation on ia64's gcc-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -13,7 +13,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index aa1de6b361..f6472f1942 100644
+index 3e4d5da820..eb7681b704 100644
--- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -32,7 +32,9 @@
@@ -28,5 +28,5 @@ index aa1de6b361..f6472f1942 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.38.2
+2.39.1
diff --git a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
index 4e1dc0d..4cb21bf 100644
--- a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,127 +1,109 @@
-From 0718c1ca37fe6407bd4bad15dfae873719eabb6e Mon Sep 17 00:00:00 2001
+From 1652c61d24e43a0efd1fd4812f4a67494d093cc2 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Tue, 20 Oct 2020 13:37:15 -0300
-Subject: [PATCH 05/10] linux: Use getdents64 on non-LFS readdir
+Date: Fri, 27 Jan 2023 14:28:30 -0300
+Subject: [PATCH 5/9] linux: Use getdents64 on non-LFS readdir
-The opendir allocates a translation buffer to be used to return the
-non-LFS readdir entry. The obtained dirent64 struct is translated
-to the temporary buffer on each readdir call.
+The non-LFS opendir reserves a translation entry to be used to return
+the entry and the dirent64 struct is translated to the temporary buffer
+on each readdir call.
Entries that overflow d_off/d_ino and the buffer reallocation failure
(in case of large d_name) are ignored.
Checked on x86_64-linux-gnu and i686-linux-gnu.
---
- sysdeps/unix/sysv/linux/closedir.c | 4 ++
+ dirent/tst-scandir.c | 6 ++-
+ include/dirent.h | 2 +-
sysdeps/unix/sysv/linux/dirstream.h | 5 ++
- sysdeps/unix/sysv/linux/opendir.c | 21 +++++++
- sysdeps/unix/sysv/linux/readdir.c | 94 +++++++++++++++++++++--------
- 4 files changed, 98 insertions(+), 26 deletions(-)
+ sysdeps/unix/sysv/linux/readdir.c | 83 +++++++++++++++++++----------
+ 4 files changed, 67 insertions(+), 29 deletions(-)
-diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
-index eee0193fc4..d876d49d78 100644
---- a/sysdeps/unix/sysv/linux/closedir.c
-+++ b/sysdeps/unix/sysv/linux/closedir.c
-@@ -47,6 +47,10 @@ __closedir (DIR *dirp)
- __libc_lock_fini (dirp->lock);
- #endif
-
-+#if !_DIRENT_MATCHES_DIRENT64
-+ free (dirp->tbuffer);
-+#endif
-+
- free ((void *) dirp);
+diff --git a/dirent/tst-scandir.c b/dirent/tst-scandir.c
+index 8d87d4dd74..7bc666449e 100644
+--- a/dirent/tst-scandir.c
++++ b/dirent/tst-scandir.c
+@@ -155,8 +155,12 @@ do_test (void)
+ }
+ if (n != 6)
+ {
++ /* Non-lfs opendir skips entries that can not be represented (for
++ instance if d_off is not an offset but rather an internal filesystem
++ representation. For this case there is no point in continue the
++ testcase. */
+ printf ("scandir returned %d entries instead of 6\n", n);
+- return 1;
++ return EXIT_UNSUPPORTED;
+ }
- return __close_nocancel (fd);
+ struct
+diff --git a/include/dirent.h b/include/dirent.h
+index d7567f5e86..17827176ba 100644
+--- a/include/dirent.h
++++ b/include/dirent.h
+@@ -1,8 +1,8 @@
+ #ifndef _DIRENT_H
++# include <dirent/dirent.h>
+ # ifndef _ISOMAC
+ # include <dirstream.h>
+ # endif
+-# include <dirent/dirent.h>
+ # ifndef _ISOMAC
+ # include <sys/stat.h>
+ # include <stdbool.h>
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index a0d8acf08d..064273cc31 100644
+index 3cb313b410..adcf8234f1 100644
--- a/sysdeps/unix/sysv/linux/dirstream.h
+++ b/sysdeps/unix/sysv/linux/dirstream.h
-@@ -41,6 +41,11 @@ struct __dirstream
+@@ -18,6 +18,7 @@
+ #ifndef _DIRSTREAM_H
+ #define _DIRSTREAM_H 1
+
++#include <dirent.h>
+ #include <sys/types.h>
+
+ #include <libc-lock.h>
+@@ -41,6 +42,10 @@ struct __dirstream
int errcode; /* Delayed error code. */
+#if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
-+ char *tbuffer; /* Translation buffer for non-LFS calls. */
-+ size_t tbuffer_size; /* Size of translation buffer. */
++ struct dirent tdp;
+#endif
+
/* Directory block. We must make sure that this block starts
at an address that is aligned adequately enough to store
dirent entries. Using the alignment of "void *" is not
-diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index 9e81d00630..bfd2f382a6 100644
---- a/sysdeps/unix/sysv/linux/opendir.c
-+++ b/sysdeps/unix/sysv/linux/opendir.c
-@@ -120,6 +120,27 @@ __alloc_dir (int fd, bool close_fd, int flags,
- return NULL;
- }
-
-+#if !_DIRENT_MATCHES_DIRENT64
-+ /* Allocates a translation buffer to use as the returned 'struct direct'
-+ for non-LFS 'readdir' calls.
-+
-+ The initial NAME_MAX size should handle most cases, while readdir might
-+ expand the buffer if required. */
-+ enum
-+ {
-+ tbuffer_size = sizeof (struct dirent) + NAME_MAX + 1
-+ };
-+ dirp->tbuffer = malloc (tbuffer_size);
-+ if (dirp->tbuffer == NULL)
-+ {
-+ free (dirp);
-+ if (close_fd)
-+ __close_nocancel_nostatus (fd);
-+ return NULL;
-+ }
-+ dirp->tbuffer_size = tbuffer_size;
-+#endif
-+
- dirp->fd = fd;
- #if IS_IN (libc)
- __libc_lock_init (dirp->lock);
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index c9a04dc160..c078146d7d 100644
+index 4a4c00ea07..cd0ccaf33a 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -21,42 +21,84 @@
+@@ -21,42 +21,71 @@
#if !_DIRENT_MATCHES_DIRENT64
#include <dirstream.h>
-+/* Translate the DP64 entry to the non-LFS one in the translation buffer
++/* Translate the DP64 entry to the non-LFS one in the translation entry
+ at dirstream DS. Return true is the translation was possible or
-+ false if either an internal fields can be represented in the non-LFS
-+ entry or if the translation can not be resized. */
++ false if either an internal field can not be represented in the non-LFS
++ entry or if the name is too long. */
+static bool
+dirstream_entry (struct __dirstream *ds, const struct dirent64 *dp64)
+{
-+ off_t d_off = dp64->d_off;
-+ if (d_off != dp64->d_off)
-+ return false;
-+ ino_t d_ino = dp64->d_ino;
-+ if (d_ino != dp64->d_ino)
++ /* Check for overflow. */
++ if (!in_off_t_range (dp64->d_off) || !in_ino_t_range (dp64->d_ino))
+ return false;
+
-+ /* Expand the translation buffer to hold the new name size. */
-+ size_t new_reclen = sizeof (struct dirent)
-+ + dp64->d_reclen - offsetof (struct dirent64, d_name);
-+ if (new_reclen > ds->tbuffer_size)
-+ {
-+ char *newbuffer = realloc (ds->tbuffer, new_reclen);
-+ if (newbuffer == NULL)
-+ return false;
-+ ds->tbuffer = newbuffer;
-+ ds->tbuffer_size = new_reclen;
-+ }
++ /* And if name is too large. */
++ if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
++ return false;
+
-+ struct dirent *dp = (struct dirent *) ds->tbuffer;
++ ds->filepos = dp64->d_off;
+
-+ dp->d_off = d_off;
-+ dp->d_ino = d_ino;
-+ dp->d_reclen = new_reclen;
-+ dp->d_type = dp64->d_type;
-+ memcpy (dp->d_name, dp64->d_name,
++ ds->tdp.d_off = dp64->d_off;
++ ds->tdp.d_ino = dp64->d_ino;
++ ds->tdp.d_reclen = sizeof (struct dirent)
++ + dp64->d_reclen - offsetof (struct dirent64, d_name);
++ ds->tdp.d_type = dp64->d_type;
++ memcpy (ds->tdp.d_name, dp64->d_name,
+ dp64->d_reclen - offsetof (struct dirent64, d_name));
+
+ return true;
@@ -145,7 +127,19 @@ index c9a04dc160..c078146d7d 100644
- bytes = __getdents (dirp->fd, dirp->data, maxread);
- if (bytes <= 0)
+ if (dirp->offset >= dirp->size)
-+ {
+ {
+- /* Linux may fail with ENOENT on some file systems if the
+- directory inode is marked as dead (deleted). POSIX
+- treats this as a regular end-of-directory condition, so
+- do not set errno in that case, to indicate success. */
+- if (bytes == 0 || errno == ENOENT)
+- __set_errno (saved_errno);
+- return NULL;
+- }
+- dirp->size = (size_t) bytes;
+-
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
+ /* We've emptied out our buffer. Refill it. */
+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data,
+ dirp->allocation);
@@ -169,23 +163,9 @@ index c9a04dc160..c078146d7d 100644
+ dirp->offset += dp64->d_reclen;
+
+ /* Skip entries which might overflow d_off/d_ino or if the translation
-+ buffer can't be resized. */
++ buffer can not be resized. */
+ if (dirstream_entry (dirp, dp64))
- {
-- /* Linux may fail with ENOENT on some file systems if the
-- directory inode is marked as dead (deleted). POSIX
-- treats this as a regular end-of-directory condition, so
-- do not set errno in that case, to indicate success. */
-- if (bytes == 0 || errno == ENOENT)
-- __set_errno (saved_errno);
-- return NULL;
-+ dirp->filepos = dp64->d_off;
-+ return (struct dirent *) dirp->tbuffer;
- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
++ return &dirp->tdp;
}
-
- dp = (struct dirent *) &dirp->data[dirp->offset];
@@ -197,5 +177,5 @@ index c9a04dc160..c078146d7d 100644
struct dirent *
--
-2.38.2
+2.39.1
diff --git a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 38acaf8..59e01fc 100644
--- a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,240 +1,121 @@
-From 36f553f67b8268341b7879640637fac5ea806017 Mon Sep 17 00:00:00 2001
+From 861793671bd8daeed1f00902d9a9523ddae77462 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Mon, 13 Apr 2020 18:09:20 -0300
-Subject: [PATCH 06/10] linux: Set internal DIR filepos as off64_t [BZ #23960,
- BZ #24050]
+Date: Fri, 27 Jan 2023 14:28:31 -0300
+Subject: [PATCH 6/9] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
+ #24050)
It allows to obtain the expected entry offset on telldir and set
it correctly on seekdir on platforms where long int is smaller
than off64_t.
-On such cases telldir will mantain an internal list that maps the
-DIR object off64_t offsets to the returned long int (the function
-return value). The seekdir will then set the correct offset from
-the internal list using the telldir as the list key.
+On such cases opendir creates a map entry between the DIR d_off
+offset and the returned long int (the telldir return value).
+seekdir will then set the correct offset from the internal list
+using the telldir as the list key.
It also removes the overflow check on readdir and the returned value
will be truncated by the non-LFS off_t size. As Joseph has noted
in BZ #23960 comment #22, d_off is an opaque value and since
telldir/seekdir works regardless of the returned dirent d_off value.
-Finally it removed the requirement to check for overflow values on
+Finally it removes the requirement to check for overflow values on
telldir (BZ #24050).
Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu,
and arm-linux-gnueabihf.
---
- dirent/Makefile | 2 +-
- dirent/tst-seekdir2.c | 158 ++++++++++++++++++++++++++++
- sysdeps/unix/sysv/linux/closedir.c | 4 +
- sysdeps/unix/sysv/linux/dirstream.h | 6 +-
- sysdeps/unix/sysv/linux/opendir.c | 3 +
- sysdeps/unix/sysv/linux/readdir.c | 1 +
- sysdeps/unix/sysv/linux/rewinddir.c | 5 +
- sysdeps/unix/sysv/linux/seekdir.c | 36 ++++++-
- sysdeps/unix/sysv/linux/telldir.c | 47 ++++++++-
- sysdeps/unix/sysv/linux/telldir.h | 64 +++++++++++
- 10 files changed, 317 insertions(+), 9 deletions(-)
- create mode 100644 dirent/tst-seekdir2.c
+ dirent/tst-seekdir.c | 8 ++
+ sysdeps/unix/sysv/linux/Makefile | 1 +
+ sysdeps/unix/sysv/linux/alpha/bits/dirent.h | 3 +
+ sysdeps/unix/sysv/linux/bits/dirent.h | 4 +
+ sysdeps/unix/sysv/linux/closedir.c | 4 +
+ sysdeps/unix/sysv/linux/dirstream.h | 6 +-
+ sysdeps/unix/sysv/linux/opendir.c | 3 +
+ sysdeps/unix/sysv/linux/readdir.c | 11 +-
+ sysdeps/unix/sysv/linux/rewinddir.c | 5 +
+ sysdeps/unix/sysv/linux/seekdir.c | 35 ++++-
+ sysdeps/unix/sysv/linux/telldir.c | 35 +++++
+ sysdeps/unix/sysv/linux/telldir.h | 65 +++++++++
+ sysdeps/unix/sysv/linux/tst-opendir-nolfs.c | 146 ++++++++++++++++++++
+ 13 files changed, 319 insertions(+), 7 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/telldir.h
+ create mode 100644 sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
-diff --git a/dirent/Makefile b/dirent/Makefile
-index cfa61826ed..9a9d91b8a5 100644
---- a/dirent/Makefile
-+++ b/dirent/Makefile
-@@ -31,7 +31,7 @@ routines := opendir closedir readdir readdir_r rewinddir \
- scandir-cancel scandir-tail scandir64-tail
-
- tests := list tst-seekdir opendir-tst1 bug-readdir1 tst-fdopendir \
-- tst-fdopendir2 tst-scandir tst-scandir64
-+ tst-fdopendir2 tst-scandir tst-scandir64 tst-seekdir2
-
- CFLAGS-scandir.c += $(uses-callbacks)
- CFLAGS-scandir64.c += $(uses-callbacks)
-diff --git a/dirent/tst-seekdir2.c b/dirent/tst-seekdir2.c
-new file mode 100644
-index 0000000000..3e01b361e5
---- /dev/null
-+++ b/dirent/tst-seekdir2.c
-@@ -0,0 +1,158 @@
-+/* Check multiple telldir and seekdir.
-+ Copyright (C) 2020 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <https://www.gnu.org/licenses/>. */
-+
-+#include <dirent.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <stdio.h>
-+#include <string.h>
-+
-+#include <support/temp_file.h>
-+#include <support/support.h>
-+#include <support/check.h>
-+
-+/* Some filesystems returns a arbitrary value for d_off direnty entry (ext4
-+ for instance, where the value is an internal hash key). The idea of
-+ create a large number of file is to try trigger a overflow d_off value
-+ in a entry to check if telldir/seekdir does work corretly in such
-+ case. */
-+static const char *dirname;
-+static const size_t nfiles = 10240;
-+
-+static void
-+do_prepare (int argc, char *argv[])
-+{
-+ dirname = support_create_temp_directory ("tst-seekdir2-");
-+
-+ for (size_t i = 0; i < nfiles; i++)
+diff --git a/dirent/tst-seekdir.c b/dirent/tst-seekdir.c
+index dcdd699b09..187eda7584 100644
+--- a/dirent/tst-seekdir.c
++++ b/dirent/tst-seekdir.c
+@@ -41,6 +41,14 @@ do_test (void)
+ if (i == 400)
+ break;
+ }
++ if (i < 3)
+ {
-+ int fd = create_temp_file_in_dir ("tempfile.", dirname, NULL);
-+ TEST_VERIFY_EXIT (fd > 0);
-+ close (fd);
-+ }
-+}
-+#define PREPARE do_prepare
-+
-+/* Check for old non Large File Support (LFS). */
-+static int
-+do_test_not_lfs (void)
-+{
-+ DIR *dirp = opendir (dirname);
-+ TEST_VERIFY_EXIT (dirp != NULL);
-+
-+ size_t dirp_count = 0;
-+ for (struct dirent *dp = readdir (dirp);
-+ dp != NULL;
-+ dp = readdir (dirp))
-+ dirp_count++;
-+
-+ /* The 2 extra files are '.' and '..'. */
-+ TEST_COMPARE (dirp_count, nfiles + 2);
-+
-+ rewinddir (dirp);
-+
-+ long *tdirp = xmalloc (dirp_count * sizeof (long));
-+ struct dirent **ddirp = xmalloc (dirp_count * sizeof (struct dirent *));
-+
-+ size_t i = 0;
-+ do
-+ {
-+ tdirp[i] = telldir (dirp);
-+ struct dirent *dp = readdir (dirp);
-+ TEST_VERIFY_EXIT (dp != NULL);
-+ ddirp[i] = xmalloc (dp->d_reclen);
-+ memcpy (ddirp[i], dp, dp->d_reclen);
-+ } while (++i < dirp_count);
-+
-+ for (i = 0; i < dirp_count - 1; i++)
-+ {
-+ seekdir (dirp, tdirp[i]);
-+ struct dirent *dp = readdir (dirp);
-+ TEST_COMPARE (strcmp (dp->d_name, ddirp[i]->d_name), 0);
-+ TEST_COMPARE (dp->d_ino, ddirp[i]->d_ino);
-+ TEST_COMPARE (dp->d_off, ddirp[i]->d_off);
++ /* Non-lfs opendir skips entries that can not be represented (for
++ instance if d_off is not an offset but rather an internal filesystem
++ representation. For this case there is no point in continue the
++ testcase. */
++ return 77;
+ }
+
+ printf ("going back past 4-th entry...\n");
+
+diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
+index f8bd12d991..09adb99b86 100644
+--- a/sysdeps/unix/sysv/linux/Makefile
++++ b/sysdeps/unix/sysv/linux/Makefile
+@@ -464,6 +464,7 @@ ifeq ($(subdir),dirent)
+ sysdep_routines += getdirentries getdirentries64
+ tests += \
+ tst-getdents64 \
++ tst-opendir-nolfs \
+ tst-readdir64-compat \
+ # tests
+ endif # $(subdir) == dirent
+diff --git a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+index c8a0cfe93f..586d75586a 100644
+--- a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
++++ b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+@@ -54,4 +54,7 @@ struct dirent64
+ /* Inform libc code that these two types are effectively identical. */
+ #define _DIRENT_MATCHES_DIRENT64 1
+
++/* alpha 'long int' is enough to handle off64_t. */
++#define _DIRENT_OFFSET_TRANSLATION 0
++
+ #endif /* bits/dirent.h */
+diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
+index ab34d986ff..bb02dcb70a 100644
+--- a/sysdeps/unix/sysv/linux/bits/dirent.h
++++ b/sysdeps/unix/sysv/linux/bits/dirent.h
+@@ -57,3 +57,7 @@ struct dirent64
+ #else
+ # define _DIRENT_MATCHES_DIRENT64 0
+ #endif
+
-+ closedir (dirp);
-+ free (tdirp);
-+ for (i = 0; i < dirp_count; i++)
-+ free (ddirp[i]);
-+ free (ddirp);
-+
-+ return 0;
-+}
-+
-+/* Same as before but with LFS support. */
-+static int
-+do_test_lfs (void)
-+{
-+ DIR *dirp = opendir (dirname);
-+ TEST_VERIFY_EXIT (dirp != NULL);
-+
-+ size_t dirp_count = 0;
-+ for (struct dirent64 * dp = readdir64 (dirp);
-+ dp != NULL;
-+ dp = readdir64 (dirp))
-+ dirp_count++;
-+
-+ /* The 2 extra files are '.' and '..'. */
-+ TEST_COMPARE (dirp_count, nfiles + 2);
-+
-+ rewinddir (dirp);
-+
-+ long *tdirp = xmalloc (dirp_count * sizeof (long));
-+ struct dirent64 **ddirp = xmalloc (dirp_count * sizeof (struct dirent64 *));
-+
-+ size_t i = 0;
-+ do
-+ {
-+ tdirp[i] = telldir (dirp);
-+ struct dirent64 *dp = readdir64 (dirp);
-+ TEST_VERIFY_EXIT (dp != NULL);
-+ ddirp[i] = xmalloc (dp->d_reclen);
-+ memcpy (ddirp[i], dp, dp->d_reclen);
-+ } while (++i < dirp_count);
-+
-+ for (i = 0; i < dirp_count - 1; i++)
-+ {
-+ seekdir (dirp, tdirp[i]);
-+ struct dirent64 *dp = readdir64 (dirp);
-+ TEST_COMPARE (strcmp (dp->d_name, ddirp[i]->d_name), 0);
-+ TEST_COMPARE (dp->d_ino, ddirp[i]->d_ino);
-+ TEST_COMPARE (dp->d_off, ddirp[i]->d_off);
-+ }
-+
-+ closedir (dirp);
-+ free (tdirp);
-+ for (i = 0; i < dirp_count; i++)
-+ free (ddirp[i]);
-+ free (ddirp);
-+
-+ return 0;
-+}
-+
-+static int
-+do_test (void)
-+{
-+ do_test_not_lfs ();
-+ do_test_lfs ();
-+
-+ return 0;
-+}
-+
-+#include <support/test-driver.c>
++/* The telldir function returns long int, which may not be large enough to
++ store off64_t values. In this case, translation is required. */
++#define _DIRENT_OFFSET_TRANSLATION (LONG_WIDTH < 64)
diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
-index d876d49d78..8e5669963c 100644
+index f1c2608642..9585a6ca3a 100644
--- a/sysdeps/unix/sysv/linux/closedir.c
+++ b/sysdeps/unix/sysv/linux/closedir.c
-@@ -43,6 +43,10 @@ __closedir (DIR *dirp)
-
- fd = dirp->fd;
+@@ -47,6 +47,10 @@ __closedir (DIR *dirp)
+ __libc_lock_fini (dirp->lock);
+ #endif
-+#ifndef __LP64__
++#if _DIRENT_OFFSET_TRANSLATION
+ dirstream_loc_clear (&dirp->locs);
+#endif
+
- #if IS_IN (libc)
- __libc_lock_fini (dirp->lock);
- #endif
+ free ((void *) dirp);
+
+ return __close_nocancel (fd);
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index 064273cc31..a284292cb2 100644
+index adcf8234f1..8f58a1c3a6 100644
--- a/sysdeps/unix/sysv/linux/dirstream.h
+++ b/sysdeps/unix/sysv/linux/dirstream.h
-@@ -21,6 +21,7 @@
+@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <libc-lock.h>
@@ -242,7 +123,7 @@ index 064273cc31..a284292cb2 100644
/* Directory stream type.
-@@ -37,7 +38,7 @@ struct __dirstream
+@@ -38,13 +39,16 @@ struct __dirstream
size_t size; /* Total valid data in the block. */
size_t offset; /* Current offset into the block. */
@@ -251,44 +132,60 @@ index 064273cc31..a284292cb2 100644
int errcode; /* Delayed error code. */
-@@ -45,6 +46,9 @@ struct __dirstream
- char *tbuffer; /* Translation buffer for non-LFS calls. */
- size_t tbuffer_size; /* Size of translation buffer. */
+ #if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
+ struct dirent tdp;
#endif
-+#ifndef __LP64__
++#if _DIRENT_OFFSET_TRANSLATION
+ struct dirstream_loc_t locs; /* off64_t to long int map for telldir. */
+#endif
/* Directory block. We must make sure that this block starts
at an address that is aligned adequately enough to store
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index bfd2f382a6..9a0b7ab4c4 100644
+index 4336196a4d..3e2caabb9d 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
-@@ -150,6 +150,9 @@ __alloc_dir (int fd, bool close_fd, int flags,
+@@ -129,6 +129,9 @@ __alloc_dir (int fd, bool close_fd, int flags,
dirp->offset = 0;
dirp->filepos = 0;
dirp->errcode = 0;
-+#ifndef __LP64__
++#if _DIRENT_OFFSET_TRANSLATION
+ dirstream_loc_init (&dirp->locs);
+#endif
return dirp;
}
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index c078146d7d..f377e5f268 100644
+index cd0ccaf33a..7a7f484c36 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -17,6 +17,7 @@
- <https://www.gnu.org/licenses/>. */
+@@ -36,6 +36,15 @@ dirstream_entry (struct __dirstream *ds, const struct dirent64 *dp64)
+ if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
+ return false;
- #include <dirent.h>
-+#include <unistd.h>
++ /* telldir can not return an error, so preallocate the map if the entry can
++ not be packed directly. */
++ if (telldir_need_dirstream (dp64->d_off))
++ {
++ dirstream_loc_add (&ds->locs, dp64->d_off);
++ if (dirstream_loc_has_failed (&ds->locs))
++ return false;
++ }
++
+ ds->filepos = dp64->d_off;
- #if !_DIRENT_MATCHES_DIRENT64
- #include <dirstream.h>
+ ds->tdp.d_off = dp64->d_off;
+@@ -76,7 +85,7 @@ __readdir_unlocked (DIR *dirp)
+
+ /* Reset the offset into the buffer. */
+ dirp->offset = 0;
+- }
++ }
+
+ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
+ dirp->offset += dp64->d_reclen;
diff --git a/sysdeps/unix/sysv/linux/rewinddir.c b/sysdeps/unix/sysv/linux/rewinddir.c
-index b1e8259703..0194d29e38 100644
+index c0fb7aa765..1b158a584f 100644
--- a/sysdeps/unix/sysv/linux/rewinddir.c
+++ b/sysdeps/unix/sysv/linux/rewinddir.c
@@ -33,6 +33,11 @@ __rewinddir (DIR *dirp)
@@ -304,10 +201,10 @@ index b1e8259703..0194d29e38 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/seekdir.c b/sysdeps/unix/sysv/linux/seekdir.c
-index f4e1a9f8e0..0c3e58a2ed 100644
+index 939ccc4447..30cce691a4 100644
--- a/sysdeps/unix/sysv/linux/seekdir.c
+++ b/sysdeps/unix/sysv/linux/seekdir.c
-@@ -22,14 +22,40 @@
+@@ -22,14 +22,39 @@
#include <dirstream.h>
/* Seek to position POS in DIRP. */
@@ -323,11 +220,8 @@ index f4e1a9f8e0..0c3e58a2ed 100644
- dirp->offset = 0;
- dirp->filepos = pos;
+
-+#ifndef __LP64__
-+ union dirstream_packed dsp;
-+
-+ dsp.l = pos;
-+
++#if _DIRENT_OFFSET_TRANSLATION
++ union dirstream_packed dsp = { .l = pos };
+ if (dsp.p.is_packed == 1)
+ filepos = dsp.p.info;
+ else
@@ -335,9 +229,11 @@ index f4e1a9f8e0..0c3e58a2ed 100644
+ size_t index = dsp.p.info;
+
+ if (index >= dirstream_loc_size (&dirp->locs))
-+ return;
-+ struct dirstream_loc *loc = dirstream_loc_at (&dirp->locs, index);
-+ filepos = loc->filepos;
++ {
++ __libc_lock_unlock (dirp->lock);
++ return;
++ }
++ filepos = *dirstream_loc_at (&dirp->locs, index);
+ }
+#else
+ filepos = pos;
@@ -354,10 +250,14 @@ index f4e1a9f8e0..0c3e58a2ed 100644
__libc_lock_unlock (dirp->lock);
}
diff --git a/sysdeps/unix/sysv/linux/telldir.c b/sysdeps/unix/sysv/linux/telldir.c
-index b60b231e48..874905489f 100644
+index 1e5c129e9f..c3ef14f3da 100644
--- a/sysdeps/unix/sysv/linux/telldir.c
+++ b/sysdeps/unix/sysv/linux/telldir.c
-@@ -18,16 +18,59 @@
+@@ -15,9 +15,11 @@
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
++#include <assert.h>
#include <dirent.h>
#include <dirstream.h>
@@ -365,68 +265,55 @@ index b60b231e48..874905489f 100644
/* Return the current position of DIRP. */
long int
- telldir (DIR *dirp)
- {
-- long int ret;
-+#ifndef __LP64__
-+ /* If the directory position fits in the packet structure returns it.
+@@ -26,7 +28,40 @@ telldir (DIR *dirp)
+ long int ret;
+
+ __libc_lock_lock (dirp->lock);
++
++#if _DIRENT_OFFSET_TRANSLATION
++ /* If the directory position fits in the packet structure, returns it.
+ Otherwise, check if the position is already been recorded in the
+ dynamic array. If not, add the new record. */
+
+ union dirstream_packed dsp;
-+ size_t i;
-
- __libc_lock_lock (dirp->lock);
-- ret = dirp->filepos;
+
-+ if (dirp->filepos < (1U << 31))
++ if (!telldir_need_dirstream (dirp->filepos))
+ {
+ dsp.p.is_packed = 1;
+ dsp.p.info = dirp->filepos;
-+ goto out;
+ }
-+
-+ dsp.l = -1;
-+
-+ for (i = 0; i < dirstream_loc_size (&dirp->locs); i++)
-+ {
-+ struct dirstream_loc *loc = dirstream_loc_at (&dirp->locs, i);
-+ if (loc->filepos == dirp->filepos)
-+ break;
-+ }
-+ if (i == dirstream_loc_size (&dirp->locs))
++ else
+ {
-+ dirstream_loc_add (&dirp->locs,
-+ (struct dirstream_loc) { dirp->filepos });
-+ if (dirstream_loc_has_failed (&dirp->locs))
-+ goto out;
++ dsp.l = -1;
++
++ size_t i;
++ for (i = 0; i < dirstream_loc_size (&dirp->locs); i++)
++ if (*dirstream_loc_at (&dirp->locs, i) == dirp->filepos)
++ break;
++ /* It should be pre-allocated on readdir. */
++ assert (i != dirstream_loc_size (&dirp->locs));
++
++ dsp.p.is_packed = 0;
++ /* This assignment might overflow, however most likely ENOME would
++ happen long before. */
++ dsp.p.info = i;
+ }
+
-+ dsp.p.is_packed = 0;
-+ /* This assignment might overflow, however most likely ENOMEM would happen
-+ long before. */
-+ dsp.p.info = i;
-+
-+out:
++ ret = dsp.l;
++#else
+ ret = dirp->filepos;
++#endif
__libc_lock_unlock (dirp->lock);
-+ return dsp.l;
-+#else
-+ long int ret;
-+ __libc_lock_lock (dirp->lock);
-+ ret = dirp->filepos;
-+ __libc_lock_unlock (dirp->lock);
return ret;
-+#endif
- }
diff --git a/sysdeps/unix/sysv/linux/telldir.h b/sysdeps/unix/sysv/linux/telldir.h
new file mode 100644
-index 0000000000..7c45886341
+index 0000000000..758bcb0eb3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/telldir.h
-@@ -0,0 +1,64 @@
+@@ -0,0 +1,65 @@
+/* Linux internal telldir definitions.
-+ Copyright (C) 2020 Free Software Foundation, Inc.
++ Copyright (C) 2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
@@ -446,9 +333,8 @@ index 0000000000..7c45886341
+#ifndef _TELLDIR_H
+#define _TELLDIR_H 1
+
-+#ifndef __LP64__
-+
-+/* On platforms where long int is smaller than off64_t this is how the
++#if _DIRENT_OFFSET_TRANSLATION
++/* On platforms where 'long int' is smaller than 'off64_t' this is how the
+ returned value is encoded and returned by 'telldir'. If the directory
+ offset can be enconded in 31 bits it is returned in the 'info' member
+ with 'is_packed' set to 1.
@@ -461,34 +347,188 @@ index 0000000000..7c45886341
+ long int l;
+ struct
+ {
-+ unsigned long is_packed:1;
-+ unsigned long info:31;
++ unsigned long int is_packed:1;
++ unsigned long int info:31;
+ } p;
+};
+
+_Static_assert (sizeof (long int) == sizeof (union dirstream_packed),
+ "sizeof (long int) != sizeof (union dirstream_packed)");
+
-+/* telldir will mantain a list of offsets that describe the obtained diretory
++/* telldir maintains a list of offsets that describe the obtained diretory
+ position if it can fit this information in the returned 'dirstream_packed'
+ struct. */
+
-+struct dirstream_loc
-+{
-+ off64_t filepos;
-+};
-+
+# define DYNARRAY_STRUCT dirstream_loc_t
-+# define DYNARRAY_ELEMENT struct dirstream_loc
++# define DYNARRAY_ELEMENT off64_t
+# define DYNARRAY_PREFIX dirstream_loc_
+# include <malloc/dynarray-skeleton.c>
++
++static __always_inline bool
++telldir_need_dirstream (__off64_t d_off)
++{
++ return d_off >= 1UL << 31;
++}
+#else
+
+_Static_assert (sizeof (long int) == sizeof (off64_t),
+ "sizeof (long int) != sizeof (off64_t)");
++
+#endif /* __LP64__ */
+
+#endif /* _TELLDIR_H */
+diff --git a/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c b/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
+new file mode 100644
+index 0000000000..52e18171a7
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
+@@ -0,0 +1,146 @@
++/* Check multiple telldir and seekdir.
++ Copyright (C) 2023 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include <dirent.h>
++#include <fcntl.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
++#include <support/check.h>
++#include <support/support.h>
++#include <support/temp_file.h>
++#include <support/xunistd.h>
++
++/* Some filesystems returns an arbitrary value for d_off direnty entry (ext4
++ for instance, where the value is an internal hash key). The idea of create
++ a large number of file is to try trigger a overflow d_off value in a entry
++ to check if telldir/seekdir does work corretly in such case. */
++static const char *dirname;
++/* The 2 extra files are '.' and '..'. */
++static const size_t nfiles = (1<<14) + 2;
++
++static inline bool
++in_ino_t_range (ino64_t v)
++{
++ ino_t s = v;
++ return s == v;
++}
++
++static inline bool
++in_off_t_range (off64_t v)
++{
++ off_t s = v;
++ return s == v;
++}
++
++static void
++do_prepare (int argc, char *argv[])
++{
++ dirname = support_create_temp_directory ("tst-opendir-nolfs-");
++
++ for (size_t i = 0; i < nfiles - 2; i++)
++ {
++ int fd = create_temp_file_in_dir ("tempfile.", dirname, NULL);
++ TEST_VERIFY_EXIT (fd > 0);
++ close (fd);
++ }
++}
++#define PREPARE do_prepare
++
++static int
++do_test (void)
++{
++ DIR *dirp = opendir (dirname);
++ TEST_VERIFY_EXIT (dirp != NULL);
++
++ long int *tdirp = xmalloc (nfiles * sizeof (long int));
++ struct dirent **ddirp = xmalloc (nfiles * sizeof (struct dirent *));
++
++ /* For non-LFS, the entry is skipped if it can not be converted. */
++ int count = 0;
++ for (; count < nfiles; count++)
++ {
++ tdirp[count] = telldir (dirp);
++ struct dirent *dp = readdir (dirp);
++ if (dp == NULL)
++ break;
++ ddirp[count] = xmalloc (dp->d_reclen);
++ memcpy (ddirp[count], dp, dp->d_reclen);
++ }
++
++ closedir (dirp);
++
++ /* Check against the getdents64 syscall. */
++ int fd = xopen (dirname, O_RDONLY | O_DIRECTORY, 0);
++ int i = 0;
++ while (true)
++ {
++ struct
++ {
++ char buffer[1024];
++ struct dirent64 pad;
++ } data;
++
++ ssize_t ret = getdents64 (fd, &data.buffer, sizeof (data.buffer));
++ if (ret < 0)
++ FAIL_EXIT1 ("getdents64: %m");
++ if (ret == 0)
++ break;
++
++ char *current = data.buffer;
++ char *end = data.buffer + ret;
++ while (current != end)
++ {
++ struct dirent64 entry;
++ memcpy (&entry, current, sizeof (entry));
++ /* Truncate overlong strings. */
++ entry.d_name[sizeof (entry.d_name) - 1] = '\0';
++ TEST_VERIFY (strlen (entry.d_name) < sizeof (entry.d_name) - 1);
++
++ if (in_ino_t_range (entry.d_ino) && in_off_t_range (entry.d_off))
++ {
++ TEST_COMPARE_STRING (entry.d_name, ddirp[i]->d_name);
++ TEST_COMPARE (entry.d_ino, ddirp[i]->d_ino);
++ TEST_COMPARE (entry.d_off, ddirp[i]->d_off);
++ TEST_COMPARE (entry.d_type, ddirp[i]->d_type);
++
++ /* Offset zero is reserved for the first entry. */
++ TEST_VERIFY (entry.d_off != 0);
++
++ TEST_VERIFY_EXIT (entry.d_reclen <= end - current);
++ i++;
++ }
++
++ current += entry.d_reclen;
++ }
++ }
++
++ /* direntries_read has been called more than once. */
++ TEST_COMPARE (count, i);
++
++ free (tdirp);
++ for (int i = 0; i < count; i++)
++ free (ddirp[i]);
++ free (ddirp);
++
++ return 0;
++}
++
++#include <support/test-driver.c>
--
-2.38.2
+2.39.1
diff --git a/9999/0007-linux-Add-__readdir64_unlocked.patch b/9999/0007-linux-Add-__readdir64_unlocked.patch
index 631550c..18dcda4 100644
--- a/9999/0007-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0007-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 4cca67d0d2d615918e05db864c236e33c0fda8f3 Mon Sep 17 00:00:00 2001
+From f697eec9ff1939e46d7730aa5cc0f696f41d8bd7 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Mon, 13 Apr 2020 08:35:40 -0300
-Subject: [PATCH 07/10] linux: Add __readdir64_unlocked
+Date: Fri, 27 Jan 2023 14:28:32 -0300
+Subject: [PATCH 7/9] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
@@ -13,7 +13,7 @@ Checked on i686-linux-gnu.
3 files changed, 33 insertions(+), 68 deletions(-)
diff --git a/include/dirent.h b/include/dirent.h
-index d7567f5e86..0c6715d0e4 100644
+index 17827176ba..f391476298 100644
--- a/include/dirent.h
+++ b/include/dirent.h
@@ -21,6 +21,7 @@ extern DIR *__fdopendir (int __fd) attribute_hidden;
@@ -25,7 +25,7 @@ index d7567f5e86..0c6715d0e4 100644
libc_hidden_proto (__readdir64)
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 7952da5c27..9d82054182 100644
+index db1c6214d8..2327511736 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -28,15 +28,11 @@
@@ -67,7 +67,7 @@ index 7952da5c27..9d82054182 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index afd7f9af0f..32962a176a 100644
+index 285dc99509..5ae099bde7 100644
--- a/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -32,89 +32,43 @@ __readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
@@ -178,5 +178,5 @@ index afd7f9af0f..32962a176a 100644
--
-2.38.2
+2.39.1
diff --git a/9999/0008-linux-Add-__old_readdir64_unlocked.patch b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
index 3cd2923..a1d289a 100644
--- a/9999/0008-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From cd6d96ae0a09c1bff40f19d54e2910d7d4e74864 Mon Sep 17 00:00:00 2001
+From 5af443d8a53475680fdc51ff1c496b13a9e9e6d0 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Tue, 14 Apr 2020 11:14:22 -0300
-Subject: [PATCH 08/10] linux: Add __old_readdir64_unlocked
+Date: Fri, 27 Jan 2023 14:28:33 -0300
+Subject: [PATCH 8/9] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
@@ -13,7 +13,7 @@ Checked on i686-linux-gnu.
3 files changed, 35 insertions(+), 70 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index 9a22609177..00c84b9521 100644
+index 9789ffae07..cde95e192e 100644
--- a/sysdeps/unix/sysv/linux/olddirent.h
+++ b/sysdeps/unix/sysv/linux/olddirent.h
@@ -32,6 +32,8 @@ struct __old_dirent64
@@ -26,7 +26,7 @@ index 9a22609177..00c84b9521 100644
struct __old_dirent64 **__result);
extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 9d82054182..bbe247f95d 100644
+index 2327511736..b901071aa7 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
@@ -104,15 +104,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
@@ -79,7 +79,7 @@ index 9d82054182..bbe247f95d 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index 32962a176a..699d120b76 100644
+index 5ae099bde7..b499388de7 100644
--- a/sysdeps/unix/sysv/linux/readdir64_r.c
+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
@@ -91,89 +91,44 @@ __old_readdir64_r (DIR *dirp, struct __old_dirent64 *entry,
@@ -190,5 +190,5 @@ index 32962a176a..699d120b76 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.38.2
+2.39.1
diff --git a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 7a9c5a3..644af1c 100644
--- a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,8 +1,7 @@
-From c71a60022adc7c9b7e37a813e2abad0d0724245a Mon Sep 17 00:00:00 2001
+From b1ab50b1c7f17d6b38c1e3a665cca971ba16deab Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Tue, 20 Oct 2020 16:00:43 -0300
-Subject: [PATCH 09/10] linux: Use getdents64 on readdir64 compat
- implementation
+Date: Fri, 27 Jan 2023 14:28:34 -0300
+Subject: [PATCH 9/9] linux: Use getdents64 on readdir64 compat implementation
It uses a similar strategy from the non-LFS readdir that also
uses getdents64 internally and uses a translation buffer to return
@@ -12,14 +11,45 @@ It allows to remove __old_getdents64.
Checked on i686-linux-gnu.
---
+ sysdeps/unix/sysv/linux/dirstream.h | 13 +++-
sysdeps/unix/sysv/linux/getdents64.c | 93 ----------------------------
sysdeps/unix/sysv/linux/olddirent.h | 2 -
- sysdeps/unix/sysv/linux/opendir.c | 15 ++++-
- sysdeps/unix/sysv/linux/readdir64.c | 62 +++++++++++++++----
- 4 files changed, 64 insertions(+), 108 deletions(-)
+ sysdeps/unix/sysv/linux/readdir64.c | 50 +++++++++++----
+ 4 files changed, 50 insertions(+), 108 deletions(-)
+diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
+index 8f58a1c3a6..b03ece4590 100644
+--- a/sysdeps/unix/sysv/linux/dirstream.h
++++ b/sysdeps/unix/sysv/linux/dirstream.h
+@@ -24,6 +24,11 @@
+ #include <libc-lock.h>
+ #include <telldir.h>
+
++#include <shlib-compat.h>
++#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
++# include <olddirent.h>
++#endif
++
+ /* Directory stream type.
+
+ The miscellaneous Unix `readdir' implementations read directory data
+@@ -44,7 +49,13 @@ struct __dirstream
+ int errcode; /* Delayed error code. */
+
+ #if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
+- struct dirent tdp;
++ union
++ {
++ struct dirent tdp;
++#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
++ struct __old_dirent64 tdp64;
++# endif
++ };
+ #endif
+ #if _DIRENT_OFFSET_TRANSLATION
+ struct dirstream_loc_t locs; /* off64_t to long int map for telldir. */
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
-index 510a586859..92481526c5 100644
+index 01c3517deb..db299864ed 100644
--- a/sysdeps/unix/sysv/linux/getdents64.c
+++ b/sysdeps/unix/sysv/linux/getdents64.c
@@ -36,97 +36,4 @@ weak_alias (__getdents64, getdents64)
@@ -121,7 +151,7 @@ index 510a586859..92481526c5 100644
-# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
#endif /* _DIRENT_MATCHES_DIRENT64 */
diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index 00c84b9521..68aafd7c02 100644
+index cde95e192e..2d682a6919 100644
--- a/sysdeps/unix/sysv/linux/olddirent.h
+++ b/sysdeps/unix/sysv/linux/olddirent.h
@@ -36,8 +36,6 @@ extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
@@ -133,44 +163,11 @@ index 00c84b9521..68aafd7c02 100644
int __old_scandir64 (const char * __dir,
struct __old_dirent64 *** __namelist,
int (*__selector) (const struct __old_dirent64 *),
-diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index 9a0b7ab4c4..df40b0a64e 100644
---- a/sysdeps/unix/sysv/linux/opendir.c
-+++ b/sysdeps/unix/sysv/linux/opendir.c
-@@ -23,6 +23,11 @@
-
- #include <not-cancel.h>
-
-+#include <shlib-compat.h>
-+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-+# include <olddirent.h>
-+#endif
-+
- enum {
- opendir_oflags = O_RDONLY|O_NDELAY|O_DIRECTORY|O_LARGEFILE|O_CLOEXEC
- };
-@@ -128,7 +133,15 @@ __alloc_dir (int fd, bool close_fd, int flags,
- expand the buffer if required. */
- enum
- {
-- tbuffer_size = sizeof (struct dirent) + NAME_MAX + 1
-+ tbuffer_size =
-+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-+ /* This is used on compat readdir64. */
-+ MAX (sizeof (struct dirent),
-+ sizeof (struct __old_dirent64))
-+# else
-+ sizeof (struct dirent)
-+# endif
-+ + NAME_MAX + 1
- };
- dirp->tbuffer = malloc (tbuffer_size);
- if (dirp->tbuffer == NULL)
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index bbe247f95d..01e834e238 100644
+index b901071aa7..88e42c5e90 100644
--- a/sysdeps/unix/sysv/linux/readdir64.c
+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -102,21 +102,52 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
+@@ -102,21 +102,43 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
# include <olddirent.h>
@@ -182,29 +179,20 @@ index bbe247f95d..01e834e238 100644
+dirstream_old_entry (struct __dirstream *ds, const struct dirent64 *dp64)
+{
+ /* Check for overflow. */
-+ ino_t d_ino = dp64->d_ino;
-+ if (d_ino != dp64->d_ino)
++ if (!in_ino_t_range (dp64->d_ino))
+ return false;
+
-+ /* Expand the translation buffer to hold the new namesize. */
-+ size_t d_reclen = sizeof (struct __old_dirent64)
-+ + dp64->d_reclen - offsetof (struct dirent64, d_name);
-+ if (d_reclen > ds->tbuffer_size)
-+ {
-+ char *newbuffer = realloc (ds->tbuffer, d_reclen);
-+ if (newbuffer == NULL)
-+ return false;
-+ ds->tbuffer = newbuffer;
-+ ds->tbuffer_size = d_reclen;
-+ }
++ /* And if name is too large. */
++ if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
++ return false;
+
-+ struct __old_dirent64 *olddp64 = (struct __old_dirent64 *) ds->tbuffer;
++ ds->filepos = dp64->d_off;
+
-+ olddp64->d_off = dp64->d_off;
-+ olddp64->d_ino = dp64->d_ino;
-+ olddp64->d_reclen = dp64->d_reclen;
-+ olddp64->d_type = dp64->d_type;
-+ memcpy (olddp64->d_name, dp64->d_name,
++ ds->tdp64.d_off = dp64->d_off;
++ ds->tdp64.d_ino = dp64->d_ino;
++ ds->tdp64.d_reclen = dp64->d_reclen;
++ ds->tdp64.d_type = dp64->d_type;
++ memcpy (ds->tdp64.d_name, dp64->d_name,
+ dp64->d_reclen - offsetof (struct dirent64, d_name));
+
+ return true;
@@ -230,7 +218,7 @@ index bbe247f95d..01e834e238 100644
if (bytes <= 0)
{
/* Linux may fail with ENOENT on some file systems if the
-@@ -127,17 +158,24 @@ __old_readdir64_unlocked (DIR *dirp)
+@@ -127,17 +149,21 @@ __old_readdir64_unlocked (DIR *dirp)
__set_errno (saved_errno);
return NULL;
}
@@ -251,15 +239,12 @@ index bbe247f95d..01e834e238 100644
+ /* Skip entries which might overflow d_ino or for memory allocation failure
+ in case of large file names. */
+ if (dirstream_old_entry (dirp, dp64))
-+ {
-+ dirp->filepos = dp64->d_off;
-+ return (struct __old_dirent64 *) dirp->tbuffer;
-+ }
++ return &dirp->tdp64;
+
+ return NULL;
}
attribute_compat_text_section
--
-2.38.2
+2.39.1
diff --git a/9999/0010-dirent-Deprecate-getdirentries.patch b/9999/0010-dirent-Deprecate-getdirentries.patch
deleted file mode 100644
index 28f744a..0000000
--- a/9999/0010-dirent-Deprecate-getdirentries.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 2f0668caf22acf6493dce8dcfd670e4b35fb6892 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 17 Apr 2020 09:59:51 -0300
-Subject: [PATCH 10/10] dirent: Deprecate getdirentries
-
-The interface has some issues:
-
- 1. It is build on top getdents on Linux and requires handling
- non-LFS call using LFS getdents.
-
- 2. It is not wildly used and the non-LFS support is as problematic
- as non-LFS readdir. glibc only exports the LFS getdents.
-
- 3. It is not a direct replacement over BSD since on some plataform
- its signature has changed (FreeBSD 11, for instance, used to
- set the offset as a 'long' and changed to 'off_t' on version 12).
-
-The idea is to eventually move the symbols to compat ones.
----
- NEWS | 3 +++
- dirent/dirent.h | 14 ++++++++++----
- sysdeps/unix/sysv/linux/Makefile | 4 ++++
- 3 files changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index a10bb08fb0..2b4ed6bbc1 100644
---- a/NEWS
-+++ b/NEWS
-@@ -21,6 +21,9 @@ Deprecated and removed features, and other changes affecting compatibility:
- corresponds to the AT_PLATFORM system name, or employs the legacy AT_HWCAP
- search mechanism, which was deprecated in version 2.33.
-
-+* The function getdirentries is now deprecated, applications should use
-+ either getdents64, readdir64 or readdir.
-+
- Changes to build and runtime requirements:
-
- [Add changes to build and runtime requirements here]
-diff --git a/dirent/dirent.h b/dirent/dirent.h
-index c47d3273b2..1c299e5be8 100644
---- a/dirent/dirent.h
-+++ b/dirent/dirent.h
-@@ -350,29 +350,35 @@ extern int alphasort64 (const struct dirent64 **__e1,
- /* Read directory entries from FD into BUF, reading at most NBYTES.
- Reading starts at offset *BASEP, and *BASEP is updated with the new
- position after reading. Returns the number of bytes read; zero when at
-- end of directory; or -1 for errors. */
-+ end of directory; or -1 for errors.
-+ This is deprecated and getdents64 or readdir should be used instead. */
- # ifndef __USE_FILE_OFFSET64
- extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
- size_t __nbytes,
- __off_t *__restrict __basep)
-- __THROW __nonnull ((2, 4));
-+ __THROW __nonnull ((2, 4))
-+ __attribute_deprecated_msg__ ("Use getdents64 instead");
- # else
- # ifdef __REDIRECT
- extern __ssize_t __REDIRECT_NTH (getdirentries,
- (int __fd, char *__restrict __buf,
- size_t __nbytes,
- __off64_t *__restrict __basep),
-- getdirentries64) __nonnull ((2, 4));
-+ getdirentries64)
-+ __nonnull ((2, 4))
-+ __attribute_deprecated_msg__ ("Use getdents64 instead");
- # else
- # define getdirentries getdirentries64
- # endif
- # endif
-
- # ifdef __USE_LARGEFILE64
-+/* This is deprecated and getdents64 or readdir64 should be used instead. */
- extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
- size_t __nbytes,
- __off64_t *__restrict __basep)
-- __THROW __nonnull ((2, 4));
-+ __THROW __nonnull ((2, 4))
-+ __attribute_deprecated_msg__ ("Use getdents64 instead");
- # endif
- #endif /* Use misc. */
-
-diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index f298878e8f..41e5341450 100644
---- a/sysdeps/unix/sysv/linux/Makefile
-+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -467,6 +467,10 @@ tests += \
- tst-getdents64 \
- tst-readdir64-compat \
- # tests
-+
-+# Avoid the warning for the weak_alias for _DIRENT_MATCHES_DIRENT64
-+CFLAGS-getdirentries64.o = -Wno-deprecated-declarations
-+CFLAGS-getdirentries64.os = -Wno-deprecated-declarations
- endif # $(subdir) == dirent
-
- ifeq ($(subdir),nis)
---
-2.38.2
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-07-17 20:40 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-07-17 20:40 UTC (permalink / raw
To: gentoo-commits
commit: 1a0d92937741eb745879e2c5ac96787001ca6125
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 20:40:01 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 20:40:01 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=1a0d9293
Rebase for upcoming glibc 2.38
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 6 +++---
9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 6 +++---
.../0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch | 4 ++--
9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch | 4 ++--
9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch | 4 ++--
...-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch | 10 +++++-----
9999/0007-linux-Add-__readdir64_unlocked.patch | 4 ++--
9999/0008-linux-Add-__old_readdir64_unlocked.patch | 4 ++--
...-linux-Use-getdents64-on-readdir64-compat-implementat.patch | 4 ++--
9 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index e947fac..117d65d 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,4 +1,4 @@
-From 3b59ad9dec2c1c7f1b4c7f72d14ea3f2b68a4eca Mon Sep 17 00:00:00 2001
+From 3924368571ae2b77a8465de8bb7ec7e6288dae67 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
Subject: [PATCH 1/9] Disable ldconfig during install
@@ -19,7 +19,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index 224c792185..be9df042e0 100644
+index f324df7a1f..0221906533 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ elf/ldso_install:
@@ -31,5 +31,5 @@ index 224c792185..be9df042e0 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.39.1
+2.39.3
diff --git a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 09c2dde..52d6412 100644
--- a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,4 +1,4 @@
-From d8a45f4bfa30b502647a9ef742836c7e8694d009 Mon Sep 17 00:00:00 2001
+From bc18d3d2140f40e43f9767bf8964eca3b2d0da17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
Subject: [PATCH 2/9] Adapt to Gentoo-specific /etc/mail/aliases
@@ -18,7 +18,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 1c32884fe7..f40fd19288 100644
+index 4601cb6ce9..0ce3cddca1 100644
--- a/nss/nss_files/files-alias.c
+++ b/nss/nss_files/files-alias.c
@@ -42,7 +42,7 @@ internal_setent (FILE **stream)
@@ -105,5 +105,5 @@ index 7a1b7272f0..500c9a79a3 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.39.1
+2.39.3
diff --git a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index ac36f58..d890165 100644
--- a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,4 +1,4 @@
-From d2b4275295e9c5a312063c3bce663ae1dcf754f0 Mon Sep 17 00:00:00 2001
+From 85d0916ff499c8d9d135cd5200ec1d4797a74565 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
Subject: [PATCH 3/9] Force -O0 in conform tests to survive $CC changes
@@ -61,5 +61,5 @@ index 983bba1bd2..b6fce8a21c 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.39.1
+2.39.3
diff --git a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
index 215b5fa..8357101 100644
--- a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
@@ -1,4 +1,4 @@
-From 7a2ab3f8d680338aff2559541a4bb748618e16f6 Mon Sep 17 00:00:00 2001
+From ed428afb4c6353692fba6cedaa2f9db7bc9fb551 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 11 Jul 2020 20:06:51 +0300
Subject: [PATCH 4/9] Fix miscompilation on ia64's gcc-10
@@ -28,5 +28,5 @@ index 3e4d5da820..eb7681b704 100644
# define DL_SYSINFO_IMPLEMENTATION \
asm (".text\n\t" \
--
-2.39.1
+2.39.3
diff --git a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
index 4cb21bf..3bae810 100644
--- a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,4 +1,4 @@
-From 1652c61d24e43a0efd1fd4812f4a67494d093cc2 Mon Sep 17 00:00:00 2001
+From bc521cf2674e2a27cc4a0dfd638c151462d51d1b Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:30 -0300
Subject: [PATCH 5/9] linux: Use getdents64 on non-LFS readdir
@@ -177,5 +177,5 @@ index 4a4c00ea07..cd0ccaf33a 100644
struct dirent *
--
-2.39.1
+2.39.3
diff --git a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 59e01fc..69f6ca0 100644
--- a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,4 +1,4 @@
-From 861793671bd8daeed1f00902d9a9523ddae77462 Mon Sep 17 00:00:00 2001
+From 61beae8ace3127d476570b8989ec4d60f421b94e Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:31 -0300
Subject: [PATCH 6/9] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
@@ -61,11 +61,11 @@ index dcdd699b09..187eda7584 100644
printf ("going back past 4-th entry...\n");
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index f8bd12d991..09adb99b86 100644
+index be801e3be4..29c747b387 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -464,6 +464,7 @@ ifeq ($(subdir),dirent)
- sysdep_routines += getdirentries getdirentries64
+@@ -546,6 +546,7 @@ sysdep_routines += \
+
tests += \
tst-getdents64 \
+ tst-opendir-nolfs \
@@ -530,5 +530,5 @@ index 0000000000..52e18171a7
+
+#include <support/test-driver.c>
--
-2.39.1
+2.39.3
diff --git a/9999/0007-linux-Add-__readdir64_unlocked.patch b/9999/0007-linux-Add-__readdir64_unlocked.patch
index 18dcda4..73bf546 100644
--- a/9999/0007-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0007-linux-Add-__readdir64_unlocked.patch
@@ -1,4 +1,4 @@
-From f697eec9ff1939e46d7730aa5cc0f696f41d8bd7 Mon Sep 17 00:00:00 2001
+From aa6bdde21d0305ce4e95fd49f7b36524ba92e745 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:32 -0300
Subject: [PATCH 7/9] linux: Add __readdir64_unlocked
@@ -178,5 +178,5 @@ index 285dc99509..5ae099bde7 100644
--
-2.39.1
+2.39.3
diff --git a/9999/0008-linux-Add-__old_readdir64_unlocked.patch b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
index a1d289a..200d275 100644
--- a/9999/0008-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0008-linux-Add-__old_readdir64_unlocked.patch
@@ -1,4 +1,4 @@
-From 5af443d8a53475680fdc51ff1c496b13a9e9e6d0 Mon Sep 17 00:00:00 2001
+From 906b7cf87806610267ffff0b850b138bd1fd2098 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:33 -0300
Subject: [PATCH 8/9] linux: Add __old_readdir64_unlocked
@@ -190,5 +190,5 @@ index 5ae099bde7..b499388de7 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.39.1
+2.39.3
diff --git a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 644af1c..99429ea 100644
--- a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,4 +1,4 @@
-From b1ab50b1c7f17d6b38c1e3a665cca971ba16deab Mon Sep 17 00:00:00 2001
+From 8eb2ff5f6f4040f238bd40083d6bfbb711fc675c Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:34 -0300
Subject: [PATCH 9/9] linux: Use getdents64 on readdir64 compat implementation
@@ -246,5 +246,5 @@ index b901071aa7..88e42c5e90 100644
attribute_compat_text_section
--
-2.39.1
+2.39.3
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-09-11 17:21 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-09-11 17:21 UTC (permalink / raw
To: gentoo-commits
commit: 9337990f921340104d26befc46565b68d22444c1
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 11 17:21:39 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Sep 11 17:21:39 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=9337990f
ia64 patch upstreamed
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../0004-Fix-miscompilation-on-ia64-s-gcc-10.patch | 32 ----------------------
1 file changed, 32 deletions(-)
diff --git a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch b/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
deleted file mode 100644
index 8357101..0000000
--- a/9999/0004-Fix-miscompilation-on-ia64-s-gcc-10.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From ed428afb4c6353692fba6cedaa2f9db7bc9fb551 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sat, 11 Jul 2020 20:06:51 +0300
-Subject: [PATCH 4/9] Fix miscompilation on ia64's gcc-10
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Bug: https://bugs.gentoo.org/723268
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
----
- sysdeps/unix/sysv/linux/ia64/dl-sysdep.h | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-index 3e4d5da820..eb7681b704 100644
---- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-+++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
-@@ -32,7 +32,9 @@
- #ifndef __ASSEMBLER__
- /* Don't declare this as a function---we want it's entry-point, not
- it's function descriptor... */
--extern int _dl_sysinfo_break attribute_hidden;
-+/* Use section ".text" to force far GPREL64 relocation instead of
-+ GPREL22 . */
-+extern int _dl_sysinfo_break attribute_hidden __attribute__((section(".text")));
- # define DL_SYSINFO_DEFAULT ((uintptr_t) &_dl_sysinfo_break)
- # define DL_SYSINFO_IMPLEMENTATION \
- asm (".text\n\t" \
---
-2.39.3
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-10-04 19:13 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-10-04 19:13 UTC (permalink / raw
To: gentoo-commits
commit: 24fb5ce5969716045eabc6bd216104c59c94917b
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 4 19:12:39 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Oct 4 19:12:39 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=24fb5ce5
Add patch from altlinux that disables tunable parsing on setuid
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0010-disable-tunables-in-AT_SECURE.patch | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/9999/0010-disable-tunables-in-AT_SECURE.patch b/9999/0010-disable-tunables-in-AT_SECURE.patch
new file mode 100644
index 0000000..4307c89
--- /dev/null
+++ b/9999/0010-disable-tunables-in-AT_SECURE.patch
@@ -0,0 +1,27 @@
+From 5d1686416ab766f3dd0780ab730650c4c0f76ca9 Mon Sep 17 00:00:00 2001
+From: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
+Date: Wed, 20 Sep 2023 05:00:00 +0000
+Subject: [PATCH] elf/dl-tunables.c: avoid processing of tunables in AT_SECURE executables
+
+Complements: owl-alt-sanitize-env
+---
+ elf/dl-tunables.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
+index 62b7332..e5e9093 100644
+--- a/elf/dl-tunables.c
++++ b/elf/dl-tunables.c
+@@ -274,6 +274,9 @@ __tunables_init (char **envp)
+ size_t len = 0;
+ char **prev_envp = envp;
+
++ if (__glibc_unlikely (__libc_enable_secure))
++ return;
++
+ maybe_enable_malloc_check ();
+
+ while ((envp = get_next_env (envp, &envname, &len, &envval,
+--
+1.7.3.3
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-12-23 21:58 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-12-23 21:58 UTC (permalink / raw
To: gentoo-commits
commit: 8bf060fba08ca3bb9f7a368bb5ee79d3a5993a6c
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 23 21:58:07 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Dec 23 21:58:07 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=8bf060fb
Disable valgrind tests
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...sable-valgrind-based-tests-too-unreliable.patch | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch b/9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
new file mode 100644
index 0000000..4d2931f
--- /dev/null
+++ b/9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
@@ -0,0 +1,38 @@
+From d63e3913e62114f4fc71862f2d57b454a5746a24 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
+Date: Sat, 23 Dec 2023 22:56:11 +0100
+Subject: [PATCH] Gentoo: Disable valgrind-based tests, too unreliable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+---
+ elf/Makefile | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 1a05a6aaca..5910453e1c 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -470,7 +470,6 @@ tests += \
+ unload6 \
+ unload7 \
+ unload8 \
+- valgrind-test \
+ # tests
+ tests-cxx = \
+ tst-dlopen-nodelete-reloc \
+@@ -601,9 +600,6 @@ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \
+ --required=__io_vtables \
+ > $@ 2>&1; $(evaluate-test)
+
+-ifeq ($(run-built-tests),yes)
+-tests-special += $(objpfx)tst-valgrind-smoke.out
+-endif
+ $(objpfx)tst-valgrind-smoke.out: tst-valgrind-smoke.sh $(objpfx)ld.so $(objpfx)valgrind-test
+ $(SHELL) $< $(objpfx)ld.so $(rtlddir)/$(rtld-installed-name) '$(test-wrapper-env)' \
+ '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test > $@; $(evaluate-test)
+--
+2.41.0
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-12-25 20:11 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-12-25 20:11 UTC (permalink / raw
To: gentoo-commits
commit: f47490979e61f9b1da27f671e28ac7df6677d355
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 20:11:18 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 20:11:32 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=f4749097
Drop patch that is now in master
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0010-disable-tunables-in-AT_SECURE.patch | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/9999/0010-disable-tunables-in-AT_SECURE.patch b/9999/0010-disable-tunables-in-AT_SECURE.patch
deleted file mode 100644
index 4307c89..0000000
--- a/9999/0010-disable-tunables-in-AT_SECURE.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 5d1686416ab766f3dd0780ab730650c4c0f76ca9 Mon Sep 17 00:00:00 2001
-From: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
-Date: Wed, 20 Sep 2023 05:00:00 +0000
-Subject: [PATCH] elf/dl-tunables.c: avoid processing of tunables in AT_SECURE executables
-
-Complements: owl-alt-sanitize-env
----
- elf/dl-tunables.c | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
-index 62b7332..e5e9093 100644
---- a/elf/dl-tunables.c
-+++ b/elf/dl-tunables.c
-@@ -274,6 +274,9 @@ __tunables_init (char **envp)
- size_t len = 0;
- char **prev_envp = envp;
-
-+ if (__glibc_unlikely (__libc_enable_secure))
-+ return;
-+
- maybe_enable_malloc_check ();
-
- while ((envp = get_next_env (envp, &envname, &len, &envval,
---
-1.7.3.3
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2023-12-25 20:15 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2023-12-25 20:15 UTC (permalink / raw
To: gentoo-commits
commit: 522f2db7d83d4c5b9cc4c29ba776362e0c95d84e
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 25 20:15:00 2023 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Dec 25 20:15:00 2023 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=522f2db7
Rebase onto master
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
9999/0001-Disable-ldconfig-during-install.patch | 6 +++---
9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch | 4 ++--
.../0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch | 4 ++--
...atch => 0004-linux-Use-getdents64-on-non-LFS-readdir.patch} | 6 +++---
...linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch} | 10 +++++-----
...nlocked.patch => 0006-linux-Add-__readdir64_unlocked.patch} | 6 +++---
...ked.patch => 0007-linux-Add-__old_readdir64_unlocked.patch} | 6 +++---
...linux-Use-getdents64-on-readdir64-compat-implementat.patch} | 6 +++---
...9-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch} | 10 +++++-----
9 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/9999/0001-Disable-ldconfig-during-install.patch b/9999/0001-Disable-ldconfig-during-install.patch
index 117d65d..5dc96e2 100644
--- a/9999/0001-Disable-ldconfig-during-install.patch
+++ b/9999/0001-Disable-ldconfig-during-install.patch
@@ -1,4 +1,4 @@
-From 3924368571ae2b77a8465de8bb7ec7e6288dae67 Mon Sep 17 00:00:00 2001
+From 2c5f0265999e3469b81a8cf27d713f212746a352 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Tue, 3 Aug 2021 00:34:59 +0200
Subject: [PATCH 1/9] Disable ldconfig during install
@@ -19,7 +19,7 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
-index f324df7a1f..0221906533 100644
+index a4f3378e21..dca38dd666 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ elf/ldso_install:
@@ -31,5 +31,5 @@ index f324df7a1f..0221906533 100644
$(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \
$(slibdir) $(libdir)
--
-2.39.3
+2.41.0
diff --git a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
index 52d6412..44af542 100644
--- a/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
+++ b/9999/0002-Adapt-to-Gentoo-specific-etc-mail-aliases.patch
@@ -1,4 +1,4 @@
-From bc18d3d2140f40e43f9767bf8964eca3b2d0da17 Mon Sep 17 00:00:00 2001
+From e6abcb198ba9bbc848fe00af7da56daff3da7048 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Mon, 22 Oct 2018 22:34:13 +0200
Subject: [PATCH 2/9] Adapt to Gentoo-specific /etc/mail/aliases
@@ -105,5 +105,5 @@ index 7a1b7272f0..500c9a79a3 100644
/* valgrind needs a temporary directory in the chroot. */
{
--
-2.39.3
+2.41.0
diff --git a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
index d890165..9b03cfd 100644
--- a/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
+++ b/9999/0003-Force-O0-in-conform-tests-to-survive-CC-changes.patch
@@ -1,4 +1,4 @@
-From 85d0916ff499c8d9d135cd5200ec1d4797a74565 Mon Sep 17 00:00:00 2001
+From 6f5c946863eb63605ccf7388eebebc63cc3523d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Fri, 14 Dec 2018 20:43:04 +0100
Subject: [PATCH 3/9] Force -O0 in conform tests to survive $CC changes
@@ -61,5 +61,5 @@ index 983bba1bd2..b6fce8a21c 100644
args.header)
with tempfile.TemporaryDirectory() as temp_dir:
--
-2.39.3
+2.41.0
diff --git a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
similarity index 97%
rename from 9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
rename to 9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
index 3bae810..a451fd6 100644
--- a/9999/0005-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,7 +1,7 @@
-From bc521cf2674e2a27cc4a0dfd638c151462d51d1b Mon Sep 17 00:00:00 2001
+From 782410070379ffbf54cb8abe71cc13fd24cfaea5 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:30 -0300
-Subject: [PATCH 5/9] linux: Use getdents64 on non-LFS readdir
+Subject: [PATCH 4/9] linux: Use getdents64 on non-LFS readdir
The non-LFS opendir reserves a translation entry to be used to return
the entry and the dirent64 struct is translated to the temporary buffer
@@ -177,5 +177,5 @@ index 4a4c00ea07..cd0ccaf33a 100644
struct dirent *
--
-2.39.3
+2.41.0
diff --git a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
similarity index 98%
rename from 9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
rename to 9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 69f6ca0..9b566a2 100644
--- a/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,7 +1,7 @@
-From 61beae8ace3127d476570b8989ec4d60f421b94e Mon Sep 17 00:00:00 2001
+From 8b628a35f0ce66d74be6557e74e28a49a58d749a Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:31 -0300
-Subject: [PATCH 6/9] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
+Subject: [PATCH 5/9] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
#24050)
It allows to obtain the expected entry offset on telldir and set
@@ -61,10 +61,10 @@ index dcdd699b09..187eda7584 100644
printf ("going back past 4-th entry...\n");
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index be801e3be4..29c747b387 100644
+index 415aa1f14d..dc204883db 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -546,6 +546,7 @@ sysdep_routines += \
+@@ -574,6 +574,7 @@ sysdep_routines += \
tests += \
tst-getdents64 \
@@ -530,5 +530,5 @@ index 0000000000..52e18171a7
+
+#include <support/test-driver.c>
--
-2.39.3
+2.41.0
diff --git a/9999/0007-linux-Add-__readdir64_unlocked.patch b/9999/0006-linux-Add-__readdir64_unlocked.patch
similarity index 97%
rename from 9999/0007-linux-Add-__readdir64_unlocked.patch
rename to 9999/0006-linux-Add-__readdir64_unlocked.patch
index 73bf546..3510868 100644
--- a/9999/0007-linux-Add-__readdir64_unlocked.patch
+++ b/9999/0006-linux-Add-__readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From aa6bdde21d0305ce4e95fd49f7b36524ba92e745 Mon Sep 17 00:00:00 2001
+From a2a34383be6e082561a09f37c5747215a70e2439 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:32 -0300
-Subject: [PATCH 7/9] linux: Add __readdir64_unlocked
+Subject: [PATCH 6/9] linux: Add __readdir64_unlocked
And use it on readdir_r implementation.
@@ -178,5 +178,5 @@ index 285dc99509..5ae099bde7 100644
--
-2.39.3
+2.41.0
diff --git a/9999/0008-linux-Add-__old_readdir64_unlocked.patch b/9999/0007-linux-Add-__old_readdir64_unlocked.patch
similarity index 97%
rename from 9999/0008-linux-Add-__old_readdir64_unlocked.patch
rename to 9999/0007-linux-Add-__old_readdir64_unlocked.patch
index 200d275..2b99897 100644
--- a/9999/0008-linux-Add-__old_readdir64_unlocked.patch
+++ b/9999/0007-linux-Add-__old_readdir64_unlocked.patch
@@ -1,7 +1,7 @@
-From 906b7cf87806610267ffff0b850b138bd1fd2098 Mon Sep 17 00:00:00 2001
+From f1d798104d5adfdec9aff9390dd7b62014d888eb Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:33 -0300
-Subject: [PATCH 8/9] linux: Add __old_readdir64_unlocked
+Subject: [PATCH 7/9] linux: Add __old_readdir64_unlocked
And use it __old_readdir64_r.
@@ -190,5 +190,5 @@ index 5ae099bde7..b499388de7 100644
compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
--
-2.39.3
+2.41.0
diff --git a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch
similarity index 98%
rename from 9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
rename to 9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch
index 99429ea..bf2981e 100644
--- a/9999/0009-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ b/9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch
@@ -1,7 +1,7 @@
-From 8eb2ff5f6f4040f238bd40083d6bfbb711fc675c Mon Sep 17 00:00:00 2001
+From 43e064d5764246f49561def52f9fd592d58b7ac2 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 27 Jan 2023 14:28:34 -0300
-Subject: [PATCH 9/9] linux: Use getdents64 on readdir64 compat implementation
+Subject: [PATCH 8/9] linux: Use getdents64 on readdir64 compat implementation
It uses a similar strategy from the non-LFS readdir that also
uses getdents64 internally and uses a translation buffer to return
@@ -246,5 +246,5 @@ index b901071aa7..88e42c5e90 100644
attribute_compat_text_section
--
-2.39.3
+2.41.0
diff --git a/9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch b/9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
similarity index 78%
rename from 9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
rename to 9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
index 4d2931f..9f13cb0 100644
--- a/9999/0011-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
+++ b/9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
@@ -1,7 +1,7 @@
-From d63e3913e62114f4fc71862f2d57b454a5746a24 Mon Sep 17 00:00:00 2001
+From 47f6f53cd39997f8e7fea5235b27a30fbdc9dd4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
Date: Sat, 23 Dec 2023 22:56:11 +0100
-Subject: [PATCH] Gentoo: Disable valgrind-based tests, too unreliable
+Subject: [PATCH 9/9] Gentoo: Disable valgrind-based tests, too unreliable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -12,10 +12,10 @@ Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
1 file changed, 4 deletions(-)
diff --git a/elf/Makefile b/elf/Makefile
-index 1a05a6aaca..5910453e1c 100644
+index ba7b71035c..4337603c6b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
-@@ -470,7 +470,6 @@ tests += \
+@@ -480,7 +480,6 @@ tests += \
unload6 \
unload7 \
unload8 \
@@ -23,7 +23,7 @@ index 1a05a6aaca..5910453e1c 100644
# tests
tests-cxx = \
tst-dlopen-nodelete-reloc \
-@@ -601,9 +600,6 @@ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \
+@@ -611,9 +610,6 @@ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \
--required=__io_vtables \
> $@ 2>&1; $(evaluate-test)
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2024-01-11 23:27 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2024-01-11 23:27 UTC (permalink / raw
To: gentoo-commits
commit: d53894fd2ecb4fe3ae4242b36d314d95f8222a3e
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 11 23:27:10 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jan 11 23:27:10 2024 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=d53894fd
Update qemu patch series from azanella/bz23960-dirent
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...4-linux-Use-getdents64-on-non-LFS-readdir.patch | 179 ++++++---------
9999/0005-support-Add-xreallocarray.patch | 76 ++++++
9999/0006-linux-Add-__readdir64_unlocked.patch | 182 ---------------
...ternal-DIR-filepos-as-off64_t-BZ-23960-B.patch} | 254 ++++++++++++---------
9999/0007-linux-Add-__old_readdir64_unlocked.patch | 194 ----------------
...etdents64-on-readdir64-compat-implementat.patch | 250 --------------------
6 files changed, 290 insertions(+), 845 deletions(-)
diff --git a/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch b/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
index a451fd6..ddb3660 100644
--- a/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
+++ b/9999/0004-linux-Use-getdents64-on-non-LFS-readdir.patch
@@ -1,114 +1,29 @@
-From 782410070379ffbf54cb8abe71cc13fd24cfaea5 Mon Sep 17 00:00:00 2001
+From 3fac92713621f894d33a9f499bacb5b20f0d8ec3 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 27 Jan 2023 14:28:30 -0300
-Subject: [PATCH 4/9] linux: Use getdents64 on non-LFS readdir
+Date: Tue, 20 Oct 2020 13:37:15 -0300
+Subject: [PATCH 1/3] linux: Use getdents64 on non-LFS readdir
-The non-LFS opendir reserves a translation entry to be used to return
-the entry and the dirent64 struct is translated to the temporary buffer
-on each readdir call.
-
-Entries that overflow d_off/d_ino and the buffer reallocation failure
-(in case of large d_name) are ignored.
+It is similar to what non-LFS getdents do (including overflow check).
Checked on x86_64-linux-gnu and i686-linux-gnu.
---
- dirent/tst-scandir.c | 6 ++-
- include/dirent.h | 2 +-
- sysdeps/unix/sysv/linux/dirstream.h | 5 ++
- sysdeps/unix/sysv/linux/readdir.c | 83 +++++++++++++++++++----------
- 4 files changed, 67 insertions(+), 29 deletions(-)
+ sysdeps/unix/sysv/linux/readdir.c | 97 +++++++++++++++++++++++--------
+ 1 file changed, 73 insertions(+), 24 deletions(-)
-diff --git a/dirent/tst-scandir.c b/dirent/tst-scandir.c
-index 8d87d4dd74..7bc666449e 100644
---- a/dirent/tst-scandir.c
-+++ b/dirent/tst-scandir.c
-@@ -155,8 +155,12 @@ do_test (void)
- }
- if (n != 6)
- {
-+ /* Non-lfs opendir skips entries that can not be represented (for
-+ instance if d_off is not an offset but rather an internal filesystem
-+ representation. For this case there is no point in continue the
-+ testcase. */
- printf ("scandir returned %d entries instead of 6\n", n);
-- return 1;
-+ return EXIT_UNSUPPORTED;
- }
-
- struct
-diff --git a/include/dirent.h b/include/dirent.h
-index d7567f5e86..17827176ba 100644
---- a/include/dirent.h
-+++ b/include/dirent.h
-@@ -1,8 +1,8 @@
- #ifndef _DIRENT_H
-+# include <dirent/dirent.h>
- # ifndef _ISOMAC
- # include <dirstream.h>
- # endif
--# include <dirent/dirent.h>
- # ifndef _ISOMAC
- # include <sys/stat.h>
- # include <stdbool.h>
-diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index 3cb313b410..adcf8234f1 100644
---- a/sysdeps/unix/sysv/linux/dirstream.h
-+++ b/sysdeps/unix/sysv/linux/dirstream.h
-@@ -18,6 +18,7 @@
- #ifndef _DIRSTREAM_H
- #define _DIRSTREAM_H 1
-
-+#include <dirent.h>
- #include <sys/types.h>
-
- #include <libc-lock.h>
-@@ -41,6 +42,10 @@ struct __dirstream
-
- int errcode; /* Delayed error code. */
-
-+#if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
-+ struct dirent tdp;
-+#endif
-+
- /* Directory block. We must make sure that this block starts
- at an address that is aligned adequately enough to store
- dirent entries. Using the alignment of "void *" is not
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index 4a4c00ea07..cd0ccaf33a 100644
+index 33bae4b57d..4e2214f21e 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -21,42 +21,71 @@
+@@ -20,43 +20,92 @@
+
#if !_DIRENT_MATCHES_DIRENT64
#include <dirstream.h>
-
-+/* Translate the DP64 entry to the non-LFS one in the translation entry
-+ at dirstream DS. Return true is the translation was possible or
-+ false if either an internal field can not be represented in the non-LFS
-+ entry or if the name is too long. */
-+static bool
-+dirstream_entry (struct __dirstream *ds, const struct dirent64 *dp64)
-+{
-+ /* Check for overflow. */
-+ if (!in_off_t_range (dp64->d_off) || !in_ino_t_range (dp64->d_ino))
-+ return false;
-+
-+ /* And if name is too large. */
-+ if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
-+ return false;
-+
-+ ds->filepos = dp64->d_off;
-+
-+ ds->tdp.d_off = dp64->d_off;
-+ ds->tdp.d_ino = dp64->d_ino;
-+ ds->tdp.d_reclen = sizeof (struct dirent)
-+ + dp64->d_reclen - offsetof (struct dirent64, d_name);
-+ ds->tdp.d_type = dp64->d_type;
-+ memcpy (ds->tdp.d_name, dp64->d_name,
-+ dp64->d_reclen - offsetof (struct dirent64, d_name));
-+
-+ return true;
-+}
++#include <unistd.h>
+
++# ifndef DIRENT_SET_DP_INO
++# define DIRENT_SET_DP_INO(dp, value) (dp)->d_ino = (value)
++# endif
+
/* Read a directory entry from DIRP. */
struct dirent *
__readdir_unlocked (DIR *dirp)
@@ -134,13 +49,6 @@ index 4a4c00ea07..cd0ccaf33a 100644
- do not set errno in that case, to indicate success. */
- if (bytes == 0 || errno == ENOENT)
- __set_errno (saved_errno);
-- return NULL;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-+ /* We've emptied out our buffer. Refill it. */
+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data,
+ dirp->allocation);
+ if (bytes <= 0)
@@ -159,13 +67,60 @@ index 4a4c00ea07..cd0ccaf33a 100644
+ dirp->offset = 0;
+ }
+
-+ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
-+ dirp->offset += dp64->d_reclen;
++ /* These two pointers might alias the same memory buffer. Standard C
++ requires that we always use the same type for them, so we must use the
++ union type. */
++ union
++ {
++ struct dirent64 dp64;
++ struct dirent dp;
++ char *b;
++ } *inp, *outp;
++ inp = (void*) &dirp->data[dirp->offset];
++ outp = (void*) &dirp->data[dirp->offset];
++
++ const size_t size_diff = offsetof (struct dirent64, d_name)
++ - offsetof (struct dirent, d_name);
++
++ /* Since inp->dp64.d_reclen is already aligned for the kernel structure
++ this may compute a value that is bigger than necessary. */
++ size_t old_reclen = inp->dp64.d_reclen;
++ size_t new_reclen = ALIGN_UP (old_reclen - size_diff,
++ _Alignof (struct dirent));
++
++ if (!in_ino_t_range (inp->dp64.d_ino)
++ || !in_off_t_range (inp->dp64.d_off))
++ {
++ /* Overflow. If there was at least one entry before this one,
++ return them without error, otherwise signal overflow. */
++ if (dirp->offset != 0)
++ {
++ __lseek64 (dirp->fd, dirp->offset, SEEK_SET);
++ outp = (void*)(outp->b - dirp->data);
++ return &outp->dp;
++ }
++ __set_errno (EOVERFLOW);
+ return NULL;
+ }
+- dirp->size = (size_t) bytes;
+
+- /* Reset the offset into the buffer. */
+- dirp->offset = 0;
++ /* Copy the data from INP and access only OUTP. */
++ const uint64_t d_ino = inp->dp64.d_ino;
++ const int64_t d_off = inp->dp64.d_off;
++ const uint8_t d_type = inp->dp64.d_type;
++ outp->dp.d_ino = d_ino;
++ outp->dp.d_off = d_off;
++ outp->dp.d_reclen = new_reclen;
++ outp->dp.d_type = d_type;
++ memmove (outp->dp.d_name, inp->dp64.d_name,
++ old_reclen - offsetof (struct dirent64, d_name));
++
++ dirp->filepos = d_off;
++ dirp->offset += old_reclen;
+
-+ /* Skip entries which might overflow d_off/d_ino or if the translation
-+ buffer can not be resized. */
-+ if (dirstream_entry (dirp, dp64))
-+ return &dirp->tdp;
++ return &outp->dp;
}
-
- dp = (struct dirent *) &dirp->data[dirp->offset];
diff --git a/9999/0005-support-Add-xreallocarray.patch b/9999/0005-support-Add-xreallocarray.patch
new file mode 100644
index 0000000..dbfae4d
--- /dev/null
+++ b/9999/0005-support-Add-xreallocarray.patch
@@ -0,0 +1,76 @@
+From 7d0638e792ebe528af3f6d8e353eff68157d7105 Mon Sep 17 00:00:00 2001
+From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed, 1 Mar 2023 14:41:23 -0300
+Subject: [PATCH 2/3] support: Add xreallocarray
+
+As a wrapper over reallocarray.
+---
+ support/Makefile | 1 +
+ support/support.h | 2 ++
+ support/xreallocarray.c | 29 +++++++++++++++++++++++++++++
+ 3 files changed, 32 insertions(+)
+ create mode 100644 support/xreallocarray.c
+
+diff --git a/support/Makefile b/support/Makefile
+index 362a51f882..d056563c15 100644
+--- a/support/Makefile
++++ b/support/Makefile
+@@ -201,6 +201,7 @@ libsupport-routines = \
+ xread \
+ xreadlink \
+ xrealloc \
++ xreallocarray \
+ xrecvfrom \
+ xsendto \
+ xsetlocale \
+diff --git a/support/support.h b/support/support.h
+index ba21ec9b5a..b4e31e4483 100644
+--- a/support/support.h
++++ b/support/support.h
+@@ -107,6 +107,8 @@ extern void *xcalloc (size_t n, size_t s)
+ __returns_nonnull;
+ extern void *xrealloc (void *o, size_t n)
+ __attribute_malloc__ __attribute_alloc_size__ ((2)) __attr_dealloc_free;
++extern void *xreallocarray (void *p, size_t n, size_t s)
++ __attribute_alloc_size__ ((2, 3)) __attr_dealloc_free;
+ extern char *xstrdup (const char *) __attribute_malloc__ __attr_dealloc_free
+ __returns_nonnull;
+ void *xposix_memalign (size_t alignment, size_t n)
+diff --git a/support/xreallocarray.c b/support/xreallocarray.c
+new file mode 100644
+index 0000000000..74fdaa421b
+--- /dev/null
++++ b/support/xreallocarray.c
+@@ -0,0 +1,29 @@
++/* Error-checking wrapper for reallocarray
++ Copyright (C) 2016-2023 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include <stdlib.h>
++#include <support/support.h>
++
++void *
++xreallocarray (void *p, size_t n, size_t s)
++{
++ void *r = reallocarray (p, n, s);
++ if (r == NULL && (p == NULL || (n != 0 && s != 0)))
++ oom_error ("reallocarray", n);
++ return r;
++}
+--
+2.41.0
+
diff --git a/9999/0006-linux-Add-__readdir64_unlocked.patch b/9999/0006-linux-Add-__readdir64_unlocked.patch
deleted file mode 100644
index 3510868..0000000
--- a/9999/0006-linux-Add-__readdir64_unlocked.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From a2a34383be6e082561a09f37c5747215a70e2439 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 27 Jan 2023 14:28:32 -0300
-Subject: [PATCH 6/9] linux: Add __readdir64_unlocked
-
-And use it on readdir_r implementation.
-
-Checked on i686-linux-gnu.
----
- include/dirent.h | 1 +
- sysdeps/unix/sysv/linux/readdir64.c | 20 +++++--
- sysdeps/unix/sysv/linux/readdir64_r.c | 80 ++++++---------------------
- 3 files changed, 33 insertions(+), 68 deletions(-)
-
-diff --git a/include/dirent.h b/include/dirent.h
-index 17827176ba..f391476298 100644
---- a/include/dirent.h
-+++ b/include/dirent.h
-@@ -21,6 +21,7 @@ extern DIR *__fdopendir (int __fd) attribute_hidden;
- extern int __closedir (DIR *__dirp) attribute_hidden;
- extern struct dirent *__readdir (DIR *__dirp) attribute_hidden;
- extern struct dirent *__readdir_unlocked (DIR *__dirp) attribute_hidden;
-+extern struct dirent64 *__readdir64_unlocked (DIR *__dirp) attribute_hidden;
- extern struct dirent64 *__readdir64 (DIR *__dirp);
- libc_hidden_proto (__readdir64)
- extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
-diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index db1c6214d8..2327511736 100644
---- a/sysdeps/unix/sysv/linux/readdir64.c
-+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -28,15 +28,11 @@
-
- /* Read a directory entry from DIRP. */
- struct dirent64 *
--__readdir64 (DIR *dirp)
-+__readdir64_unlocked (DIR *dirp)
- {
- struct dirent64 *dp;
- int saved_errno = errno;
-
--#if IS_IN (libc)
-- __libc_lock_lock (dirp->lock);
--#endif
--
- if (dirp->offset >= dirp->size)
- {
- /* We've emptied out our buffer. Refill it. */
-@@ -68,6 +64,20 @@ __readdir64 (DIR *dirp)
- dirp->offset += dp->d_reclen;
- dirp->filepos = dp->d_off;
-
-+ return dp;
-+}
-+
-+struct dirent64 *
-+__readdir64 (DIR *dirp)
-+{
-+ struct dirent64 *dp;
-+
-+#if IS_IN (libc)
-+ __libc_lock_lock (dirp->lock);
-+#endif
-+
-+ dp = __readdir64_unlocked (dirp);
-+
- #if IS_IN (libc)
- __libc_lock_unlock (dirp->lock);
- #endif
-diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index 285dc99509..5ae099bde7 100644
---- a/sysdeps/unix/sysv/linux/readdir64_r.c
-+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
-@@ -32,89 +32,43 @@ __readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
- {
- struct dirent64 *dp;
- size_t reclen;
-- const int saved_errno = errno;
-- int ret;
-
- __libc_lock_lock (dirp->lock);
--
-- do
-+ while (1)
- {
-- if (dirp->offset >= dirp->size)
-- {
-- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- maxread = dirp->allocation;
--
-- bytes = __getdents64 (dirp->fd, dirp->data, maxread);
-- if (bytes <= 0)
-- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- {
-- bytes = 0;
-- __set_errno (saved_errno);
-- }
-- if (bytes < 0)
-- dirp->errcode = errno;
--
-- dp = NULL;
-- break;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-- }
--
-- dp = (struct dirent64 *) &dirp->data[dirp->offset];
-+ dp = __readdir64_unlocked (dirp);
-+ if (dp == NULL)
-+ break;
-
- reclen = dp->d_reclen;
-+ if (reclen <= offsetof (struct dirent64, d_name) + NAME_MAX + 1)
-+ break;
-
-- dirp->offset += reclen;
--
-- dirp->filepos = dp->d_off;
--
-- if (reclen > offsetof (struct dirent64, d_name) + NAME_MAX + 1)
-+ /* The record is very long. It could still fit into the caller-supplied
-+ buffer if we can skip padding at the end. */
-+ size_t namelen = _D_EXACT_NAMLEN (dp);
-+ if (namelen <= NAME_MAX)
- {
-- /* The record is very long. It could still fit into the
-- caller-supplied buffer if we can skip padding at the
-- end. */
-- size_t namelen = _D_EXACT_NAMLEN (dp);
-- if (namelen <= NAME_MAX)
-- reclen = offsetof (struct dirent64, d_name) + namelen + 1;
-- else
-- {
-- /* The name is too long. Ignore this file. */
-- dirp->errcode = ENAMETOOLONG;
-- dp->d_ino = 0;
-- continue;
-- }
-+ reclen = offsetof (struct dirent64, d_name) + namelen + 1;
-+ break;
- }
-
-- /* Skip deleted and ignored files. */
-+ /* The name is too long. Ignore this file. */
-+ dirp->errcode = ENAMETOOLONG;
-+ dp->d_ino = 0;
- }
-- while (dp->d_ino == 0);
-
- if (dp != NULL)
- {
- *result = memcpy (entry, dp, reclen);
- entry->d_reclen = reclen;
-- ret = 0;
- }
- else
-- {
-- *result = NULL;
-- ret = dirp->errcode;
-- }
-+ *result = NULL;
-
- __libc_lock_unlock (dirp->lock);
-
-- return ret;
-+ return dp != NULL ? 0 : dirp->errcode;
- }
-
-
---
-2.41.0
-
diff --git a/9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
similarity index 70%
rename from 9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
rename to 9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
index 9b566a2..6450910 100644
--- a/9999/0005-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
+++ b/9999/0006-linux-Set-internal-DIR-filepos-as-off64_t-BZ-23960-B.patch
@@ -1,7 +1,7 @@
-From 8b628a35f0ce66d74be6557e74e28a49a58d749a Mon Sep 17 00:00:00 2001
+From 6d5975652503acffae0566500cc15f8efc89e30a Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 27 Jan 2023 14:28:31 -0300
-Subject: [PATCH 5/9] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
+Date: Mon, 13 Apr 2020 18:09:20 -0300
+Subject: [PATCH 3/3] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ
#24050)
It allows to obtain the expected entry offset on telldir and set
@@ -24,56 +24,55 @@ telldir (BZ #24050).
Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu,
and arm-linux-gnueabihf.
---
- dirent/tst-seekdir.c | 8 ++
- sysdeps/unix/sysv/linux/Makefile | 1 +
+ include/dirent.h | 2 +-
+ sysdeps/unix/sysv/linux/Makefile | 2 +
sysdeps/unix/sysv/linux/alpha/bits/dirent.h | 3 +
sysdeps/unix/sysv/linux/bits/dirent.h | 4 +
sysdeps/unix/sysv/linux/closedir.c | 4 +
- sysdeps/unix/sysv/linux/dirstream.h | 6 +-
+ sysdeps/unix/sysv/linux/dirstream.h | 9 +-
sysdeps/unix/sysv/linux/opendir.c | 3 +
- sysdeps/unix/sysv/linux/readdir.c | 11 +-
+ sysdeps/unix/sysv/linux/readdir.c | 21 ++-
+ sysdeps/unix/sysv/linux/readdir64.c | 11 ++
sysdeps/unix/sysv/linux/rewinddir.c | 5 +
- sysdeps/unix/sysv/linux/seekdir.c | 35 ++++-
- sysdeps/unix/sysv/linux/telldir.c | 35 +++++
- sysdeps/unix/sysv/linux/telldir.h | 65 +++++++++
- sysdeps/unix/sysv/linux/tst-opendir-nolfs.c | 146 ++++++++++++++++++++
- 13 files changed, 319 insertions(+), 7 deletions(-)
+ sysdeps/unix/sysv/linux/seekdir.c | 30 +++-
+ sysdeps/unix/sysv/linux/telldir.c | 36 +++++
+ sysdeps/unix/sysv/linux/telldir.h | 70 ++++++++++
+ sysdeps/unix/sysv/linux/tst-opendir-lfs.c | 2 +
+ sysdeps/unix/sysv/linux/tst-opendir.c | 145 ++++++++++++++++++++
+ 15 files changed, 329 insertions(+), 18 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/telldir.h
- create mode 100644 sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
+ create mode 100644 sysdeps/unix/sysv/linux/tst-opendir-lfs.c
+ create mode 100644 sysdeps/unix/sysv/linux/tst-opendir.c
-diff --git a/dirent/tst-seekdir.c b/dirent/tst-seekdir.c
-index dcdd699b09..187eda7584 100644
---- a/dirent/tst-seekdir.c
-+++ b/dirent/tst-seekdir.c
-@@ -41,6 +41,14 @@ do_test (void)
- if (i == 400)
- break;
- }
-+ if (i < 3)
-+ {
-+ /* Non-lfs opendir skips entries that can not be represented (for
-+ instance if d_off is not an offset but rather an internal filesystem
-+ representation. For this case there is no point in continue the
-+ testcase. */
-+ return 77;
-+ }
-
- printf ("going back past 4-th entry...\n");
-
+diff --git a/include/dirent.h b/include/dirent.h
+index d7567f5e86..17827176ba 100644
+--- a/include/dirent.h
++++ b/include/dirent.h
+@@ -1,8 +1,8 @@
+ #ifndef _DIRENT_H
++# include <dirent/dirent.h>
+ # ifndef _ISOMAC
+ # include <dirstream.h>
+ # endif
+-# include <dirent/dirent.h>
+ # ifndef _ISOMAC
+ # include <sys/stat.h>
+ # include <stdbool.h>
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
-index 415aa1f14d..dc204883db 100644
+index 415aa1f14d..d5b6e26e76 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
-@@ -574,6 +574,7 @@ sysdep_routines += \
+@@ -574,6 +574,8 @@ sysdep_routines += \
tests += \
tst-getdents64 \
-+ tst-opendir-nolfs \
++ tst-opendir \
++ tst-opendir-lfs \
tst-readdir64-compat \
# tests
endif # $(subdir) == dirent
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
-index c8a0cfe93f..586d75586a 100644
+index b604576188..4e511e7654 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/dirent.h
@@ -54,4 +54,7 @@ struct dirent64
@@ -85,7 +84,7 @@ index c8a0cfe93f..586d75586a 100644
+
#endif /* bits/dirent.h */
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
-index ab34d986ff..bb02dcb70a 100644
+index 8bf38f8188..7c5f3419cd 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -57,3 +57,7 @@ struct dirent64
@@ -97,7 +96,7 @@ index ab34d986ff..bb02dcb70a 100644
+ store off64_t values. In this case, translation is required. */
+#define _DIRENT_OFFSET_TRANSLATION (LONG_WIDTH < 64)
diff --git a/sysdeps/unix/sysv/linux/closedir.c b/sysdeps/unix/sysv/linux/closedir.c
-index f1c2608642..9585a6ca3a 100644
+index b86f79f133..3a4eba03f1 100644
--- a/sysdeps/unix/sysv/linux/closedir.c
+++ b/sysdeps/unix/sysv/linux/closedir.c
@@ -47,6 +47,10 @@ __closedir (DIR *dirp)
@@ -112,10 +111,10 @@ index f1c2608642..9585a6ca3a 100644
return __close_nocancel (fd);
diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index adcf8234f1..8f58a1c3a6 100644
+index 3d3643733a..fc2586566a 100644
--- a/sysdeps/unix/sysv/linux/dirstream.h
+++ b/sysdeps/unix/sysv/linux/dirstream.h
-@@ -22,6 +22,7 @@
+@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <libc-lock.h>
@@ -123,7 +122,7 @@ index adcf8234f1..8f58a1c3a6 100644
/* Directory stream type.
-@@ -38,13 +39,16 @@ struct __dirstream
+@@ -37,10 +38,16 @@ struct __dirstream
size_t size; /* Total valid data in the block. */
size_t offset; /* Current offset into the block. */
@@ -132,17 +131,17 @@ index adcf8234f1..8f58a1c3a6 100644
int errcode; /* Delayed error code. */
- #if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
- struct dirent tdp;
- #endif
+#if _DIRENT_OFFSET_TRANSLATION
-+ struct dirstream_loc_t locs; /* off64_t to long int map for telldir. */
++ /* The array is used to map long to off_64 for telldir/seekdir for ABIs
++ where long can not fully represend a LFS off_t value. */
++ struct dirstream_loc_t locs;
+#endif
-
++
/* Directory block. We must make sure that this block starts
at an address that is aligned adequately enough to store
+ dirent entries. Using the alignment of "void *" is not
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
-index 4336196a4d..3e2caabb9d 100644
+index b5218138ec..fda2c5f9fe 100644
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ b/sysdeps/unix/sysv/linux/opendir.c
@@ -129,6 +129,9 @@ __alloc_dir (int fd, bool close_fd, int flags,
@@ -156,36 +155,68 @@ index 4336196a4d..3e2caabb9d 100644
return dirp;
}
diff --git a/sysdeps/unix/sysv/linux/readdir.c b/sysdeps/unix/sysv/linux/readdir.c
-index cd0ccaf33a..7a7f484c36 100644
+index 4e2214f21e..d474f70a8d 100644
--- a/sysdeps/unix/sysv/linux/readdir.c
+++ b/sysdeps/unix/sysv/linux/readdir.c
-@@ -36,6 +36,15 @@ dirstream_entry (struct __dirstream *ds, const struct dirent64 *dp64)
- if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
- return false;
+@@ -75,25 +75,22 @@ __readdir_unlocked (DIR *dirp)
+ size_t new_reclen = ALIGN_UP (old_reclen - size_diff,
+ _Alignof (struct dirent));
+
+- if (!in_ino_t_range (inp->dp64.d_ino)
+- || !in_off_t_range (inp->dp64.d_off))
++ /* telldir can not return an error, so preallocate a map entry if
++ d_off can not be used directly. */
++ if (telldir_need_dirstream (inp->dp64.d_off))
+ {
+- /* Overflow. If there was at least one entry before this one,
+- return them without error, otherwise signal overflow. */
+- if (dirp->offset != 0)
+- {
+- __lseek64 (dirp->fd, dirp->offset, SEEK_SET);
+- outp = (void*)(outp->b - dirp->data);
+- return &outp->dp;
+- }
+- __set_errno (EOVERFLOW);
+- return NULL;
++ dirstream_loc_add (&dirp->locs, inp->dp64.d_off);
++ if (dirstream_loc_has_failed (&dirp->locs))
++ return NULL;
+ }
+
+ /* Copy the data from INP and access only OUTP. */
+ const uint64_t d_ino = inp->dp64.d_ino;
+ const int64_t d_off = inp->dp64.d_off;
+ const uint8_t d_type = inp->dp64.d_type;
++ /* This will clamp both d_off and d_ino values, which is required to
++ avoid return EOVERFLOW. The lelldir/seekdir uses the 'locs' value
++ if the value overflows. */
+ outp->dp.d_ino = d_ino;
+ outp->dp.d_off = d_off;
+ outp->dp.d_reclen = new_reclen;
+diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
+index e6f5108c0a..d61c5e6e26 100644
+--- a/sysdeps/unix/sysv/linux/readdir64.c
++++ b/sysdeps/unix/sysv/linux/readdir64.c
+@@ -68,6 +68,17 @@ __readdir64 (DIR *dirp)
+ dirp->offset += dp->d_reclen;
+ dirp->filepos = dp->d_off;
-+ /* telldir can not return an error, so preallocate the map if the entry can
-+ not be packed directly. */
-+ if (telldir_need_dirstream (dp64->d_off))
++#if _DIRENT_OFFSET_TRANSLATION
++ /* telldir can not return an error, so preallocate a map entry if
++ d_off can not be used directly. */
++ if (telldir_need_dirstream (dp->d_off))
+ {
-+ dirstream_loc_add (&ds->locs, dp64->d_off);
-+ if (dirstream_loc_has_failed (&ds->locs))
-+ return false;
++ dirstream_loc_add (&dirp->locs, dp->d_off);
++ if (dirstream_loc_has_failed (&dirp->locs))
++ dp = NULL;
+ }
++#endif
+
- ds->filepos = dp64->d_off;
-
- ds->tdp.d_off = dp64->d_off;
-@@ -76,7 +85,7 @@ __readdir_unlocked (DIR *dirp)
-
- /* Reset the offset into the buffer. */
- dirp->offset = 0;
-- }
-+ }
-
- struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
- dirp->offset += dp64->d_reclen;
+ #if IS_IN (libc)
+ __libc_lock_unlock (dirp->lock);
+ #endif
diff --git a/sysdeps/unix/sysv/linux/rewinddir.c b/sysdeps/unix/sysv/linux/rewinddir.c
-index c0fb7aa765..1b158a584f 100644
+index af85000a28..4936be5c6a 100644
--- a/sysdeps/unix/sysv/linux/rewinddir.c
+++ b/sysdeps/unix/sysv/linux/rewinddir.c
@@ -33,6 +33,11 @@ __rewinddir (DIR *dirp)
@@ -201,10 +232,10 @@ index c0fb7aa765..1b158a584f 100644
__libc_lock_unlock (dirp->lock);
#endif
diff --git a/sysdeps/unix/sysv/linux/seekdir.c b/sysdeps/unix/sysv/linux/seekdir.c
-index 939ccc4447..30cce691a4 100644
+index 52005878fc..cd49676750 100644
--- a/sysdeps/unix/sysv/linux/seekdir.c
+++ b/sysdeps/unix/sysv/linux/seekdir.c
-@@ -22,14 +22,39 @@
+@@ -22,14 +22,36 @@
#include <dirstream.h>
/* Seek to position POS in DIRP. */
@@ -217,8 +248,6 @@ index 939ccc4447..30cce691a4 100644
__libc_lock_lock (dirp->lock);
- (void) __lseek (dirp->fd, pos, SEEK_SET);
- dirp->size = 0;
-- dirp->offset = 0;
-- dirp->filepos = pos;
+
+#if _DIRENT_OFFSET_TRANSLATION
+ union dirstream_packed dsp = { .l = pos };
@@ -239,24 +268,23 @@ index 939ccc4447..30cce691a4 100644
+ filepos = pos;
+#endif
+
-+ if (dirp->filepos != filepos)
-+ {
-+ __lseek64 (dirp->fd, filepos, SEEK_SET);
-+ dirp->filepos = filepos;
-+ dirp->offset = 0;
-+ dirp->size = 0;
-+ }
++ __lseek64 (dirp->fd, filepos, SEEK_SET);
++ dirp->filepos = filepos;
+ dirp->offset = 0;
+- dirp->filepos = pos;
++ dirp->size = 0;
+
__libc_lock_unlock (dirp->lock);
}
diff --git a/sysdeps/unix/sysv/linux/telldir.c b/sysdeps/unix/sysv/linux/telldir.c
-index 1e5c129e9f..c3ef14f3da 100644
+index c8dff30719..8d9e2c9db2 100644
--- a/sysdeps/unix/sysv/linux/telldir.c
+++ b/sysdeps/unix/sysv/linux/telldir.c
-@@ -15,9 +15,11 @@
+@@ -15,9 +15,12 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
++#include <stdio.h>
+#include <assert.h>
#include <dirent.h>
@@ -265,7 +293,7 @@ index 1e5c129e9f..c3ef14f3da 100644
/* Return the current position of DIRP. */
long int
-@@ -26,7 +28,40 @@ telldir (DIR *dirp)
+@@ -26,7 +29,40 @@ telldir (DIR *dirp)
long int ret;
__libc_lock_lock (dirp->lock);
@@ -287,15 +315,15 @@ index 1e5c129e9f..c3ef14f3da 100644
+ dsp.l = -1;
+
+ size_t i;
-+ for (i = 0; i < dirstream_loc_size (&dirp->locs); i++)
-+ if (*dirstream_loc_at (&dirp->locs, i) == dirp->filepos)
-+ break;
-+ /* It should be pre-allocated on readdir. */
-+ assert (i != dirstream_loc_size (&dirp->locs));
++ for (i = 0; ;i++)
++ {
++ /* It should be pre-allocated on readdir. */
++ assert (i < dirstream_loc_size (&dirp->locs));
++ if (*dirstream_loc_at (&dirp->locs, i) == dirp->filepos)
++ break;
++ }
+
+ dsp.p.is_packed = 0;
-+ /* This assignment might overflow, however most likely ENOME would
-+ happen long before. */
+ dsp.p.info = i;
+ }
+
@@ -308,10 +336,10 @@ index 1e5c129e9f..c3ef14f3da 100644
return ret;
diff --git a/sysdeps/unix/sysv/linux/telldir.h b/sysdeps/unix/sysv/linux/telldir.h
new file mode 100644
-index 0000000000..758bcb0eb3
+index 0000000000..7772129db0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/telldir.h
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,70 @@
+/* Linux internal telldir definitions.
+ Copyright (C) 2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
@@ -333,7 +361,15 @@ index 0000000000..758bcb0eb3
+#ifndef _TELLDIR_H
+#define _TELLDIR_H 1
+
++#include <dirent.h>
++
+#if _DIRENT_OFFSET_TRANSLATION
++
++_Static_assert (sizeof (long int) < sizeof (__off64_t),
++ "sizeof (long int) >= sizeof (__off64_t)");
++
++# include <intprops.h>
++
+/* On platforms where 'long int' is smaller than 'off64_t' this is how the
+ returned value is encoded and returned by 'telldir'. If the directory
+ offset can be enconded in 31 bits it is returned in the 'info' member
@@ -352,9 +388,6 @@ index 0000000000..758bcb0eb3
+ } p;
+};
+
-+_Static_assert (sizeof (long int) == sizeof (union dirstream_packed),
-+ "sizeof (long int) != sizeof (union dirstream_packed)");
-+
+/* telldir maintains a list of offsets that describe the obtained diretory
+ position if it can fit this information in the returned 'dirstream_packed'
+ struct. */
@@ -367,7 +400,7 @@ index 0000000000..758bcb0eb3
+static __always_inline bool
+telldir_need_dirstream (__off64_t d_off)
+{
-+ return d_off >= 1UL << 31;
++ return ! (TYPE_MINIMUM (off_t) <= d_off && d_off <= TYPE_MAXIMUM (off_t));
+}
+#else
+
@@ -377,12 +410,20 @@ index 0000000000..758bcb0eb3
+#endif /* __LP64__ */
+
+#endif /* _TELLDIR_H */
-diff --git a/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c b/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
+diff --git a/sysdeps/unix/sysv/linux/tst-opendir-lfs.c b/sysdeps/unix/sysv/linux/tst-opendir-lfs.c
new file mode 100644
-index 0000000000..52e18171a7
+index 0000000000..1de1891fb4
--- /dev/null
-+++ b/sysdeps/unix/sysv/linux/tst-opendir-nolfs.c
-@@ -0,0 +1,146 @@
++++ b/sysdeps/unix/sysv/linux/tst-opendir-lfs.c
+@@ -0,0 +1,2 @@
++#define _FILE_OFFSET_BITS 64
++#include "tst-opendir.c"
+diff --git a/sysdeps/unix/sysv/linux/tst-opendir.c b/sysdeps/unix/sysv/linux/tst-opendir.c
+new file mode 100644
+index 0000000000..216ecf123f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/tst-opendir.c
+@@ -0,0 +1,145 @@
+/* Check multiple telldir and seekdir.
+ Copyright (C) 2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
@@ -455,17 +496,18 @@ index 0000000000..52e18171a7
+ DIR *dirp = opendir (dirname);
+ TEST_VERIFY_EXIT (dirp != NULL);
+
-+ long int *tdirp = xmalloc (nfiles * sizeof (long int));
-+ struct dirent **ddirp = xmalloc (nfiles * sizeof (struct dirent *));
++ long int *tdirp = xreallocarray (NULL, nfiles, sizeof (long int));
++ struct dirent **ddirp = xreallocarray (NULL, nfiles,
++ sizeof (struct dirent *));
+
+ /* For non-LFS, the entry is skipped if it can not be converted. */
+ int count = 0;
+ for (; count < nfiles; count++)
+ {
-+ tdirp[count] = telldir (dirp);
+ struct dirent *dp = readdir (dirp);
+ if (dp == NULL)
+ break;
++ tdirp[count] = telldir (dirp);
+ ddirp[count] = xmalloc (dp->d_reclen);
+ memcpy (ddirp[count], dp, dp->d_reclen);
+ }
@@ -499,11 +541,10 @@ index 0000000000..52e18171a7
+ entry.d_name[sizeof (entry.d_name) - 1] = '\0';
+ TEST_VERIFY (strlen (entry.d_name) < sizeof (entry.d_name) - 1);
+
-+ if (in_ino_t_range (entry.d_ino) && in_off_t_range (entry.d_off))
++ if (in_ino_t_range (entry.d_ino))
+ {
+ TEST_COMPARE_STRING (entry.d_name, ddirp[i]->d_name);
+ TEST_COMPARE (entry.d_ino, ddirp[i]->d_ino);
-+ TEST_COMPARE (entry.d_off, ddirp[i]->d_off);
+ TEST_COMPARE (entry.d_type, ddirp[i]->d_type);
+
+ /* Offset zero is reserved for the first entry. */
@@ -517,7 +558,6 @@ index 0000000000..52e18171a7
+ }
+ }
+
-+ /* direntries_read has been called more than once. */
+ TEST_COMPARE (count, i);
+
+ free (tdirp);
diff --git a/9999/0007-linux-Add-__old_readdir64_unlocked.patch b/9999/0007-linux-Add-__old_readdir64_unlocked.patch
deleted file mode 100644
index 2b99897..0000000
--- a/9999/0007-linux-Add-__old_readdir64_unlocked.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-From f1d798104d5adfdec9aff9390dd7b62014d888eb Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 27 Jan 2023 14:28:33 -0300
-Subject: [PATCH 7/9] linux: Add __old_readdir64_unlocked
-
-And use it __old_readdir64_r.
-
-Checked on i686-linux-gnu.
----
- sysdeps/unix/sysv/linux/olddirent.h | 2 +
- sysdeps/unix/sysv/linux/readdir64.c | 24 +++++---
- sysdeps/unix/sysv/linux/readdir64_r.c | 79 ++++++---------------------
- 3 files changed, 35 insertions(+), 70 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index 9789ffae07..cde95e192e 100644
---- a/sysdeps/unix/sysv/linux/olddirent.h
-+++ b/sysdeps/unix/sysv/linux/olddirent.h
-@@ -32,6 +32,8 @@ struct __old_dirent64
- /* Now define the internal interfaces. */
- extern struct __old_dirent64 *__old_readdir64 (DIR *__dirp);
- libc_hidden_proto (__old_readdir64);
-+extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
-+ attribute_hidden;
- extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
- struct __old_dirent64 **__result);
- extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
-diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index 2327511736..b901071aa7 100644
---- a/sysdeps/unix/sysv/linux/readdir64.c
-+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -104,15 +104,11 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
-
- attribute_compat_text_section
- struct __old_dirent64 *
--__old_readdir64 (DIR *dirp)
-+__old_readdir64_unlocked (DIR *dirp)
- {
- struct __old_dirent64 *dp;
- int saved_errno = errno;
-
--#if IS_IN (libc)
-- __libc_lock_lock (dirp->lock);
--#endif
--
- if (dirp->offset >= dirp->size)
- {
- /* We've emptied out our buffer. Refill it. */
-@@ -129,9 +125,6 @@ __old_readdir64 (DIR *dirp)
- do not set errno in that case, to indicate success. */
- if (bytes == 0 || errno == ENOENT)
- __set_errno (saved_errno);
--#if IS_IN (libc)
-- __libc_lock_unlock (dirp->lock);
--#endif
- return NULL;
- }
- dirp->size = (size_t) bytes;
-@@ -144,6 +137,21 @@ __old_readdir64 (DIR *dirp)
- dirp->offset += dp->d_reclen;
- dirp->filepos = dp->d_off;
-
-+ return dp;
-+}
-+
-+attribute_compat_text_section
-+struct __old_dirent64 *
-+__old_readdir64 (DIR *dirp)
-+{
-+ struct __old_dirent64 *dp;
-+
-+#if IS_IN (libc)
-+ __libc_lock_lock (dirp->lock);
-+#endif
-+
-+ dp = __old_readdir64_unlocked (dirp);
-+
- #if IS_IN (libc)
- __libc_lock_unlock (dirp->lock);
- #endif
-diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
-index 5ae099bde7..b499388de7 100644
---- a/sysdeps/unix/sysv/linux/readdir64_r.c
-+++ b/sysdeps/unix/sysv/linux/readdir64_r.c
-@@ -91,89 +91,44 @@ __old_readdir64_r (DIR *dirp, struct __old_dirent64 *entry,
- {
- struct __old_dirent64 *dp;
- size_t reclen;
-- const int saved_errno = errno;
-- int ret;
-
- __libc_lock_lock (dirp->lock);
-
-- do
-+ while (1)
- {
-- if (dirp->offset >= dirp->size)
-- {
-- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- maxread = dirp->allocation;
--
-- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
-- if (bytes <= 0)
-- {
-- /* On some systems getdents fails with ENOENT when the
-- open directory has been rmdir'd already. POSIX.1
-- requires that we treat this condition like normal EOF. */
-- if (bytes < 0 && errno == ENOENT)
-- {
-- bytes = 0;
-- __set_errno (saved_errno);
-- }
-- if (bytes < 0)
-- dirp->errcode = errno;
--
-- dp = NULL;
-- break;
-- }
-- dirp->size = (size_t) bytes;
--
-- /* Reset the offset into the buffer. */
-- dirp->offset = 0;
-- }
--
-- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
-+ dp = __old_readdir64_unlocked (dirp);
-+ if (dp == NULL)
-+ break;
-
- reclen = dp->d_reclen;
-+ if (reclen <= offsetof (struct __old_dirent64, d_name) + NAME_MAX + 1)
-+ break;
-
-- dirp->offset += reclen;
--
-- dirp->filepos = dp->d_off;
--
-- if (reclen > offsetof (struct __old_dirent64, d_name) + NAME_MAX + 1)
-+ /* The record is very long. It could still fit into the caller-supplied
-+ buffer if we can skip padding at the end. */
-+ size_t namelen = _D_EXACT_NAMLEN (dp);
-+ if (namelen <= NAME_MAX)
- {
-- /* The record is very long. It could still fit into the
-- caller-supplied buffer if we can skip padding at the
-- end. */
-- size_t namelen = _D_EXACT_NAMLEN (dp);
-- if (namelen <= NAME_MAX)
-- reclen = offsetof (struct __old_dirent64, d_name) + namelen + 1;
-- else
-- {
-- /* The name is too long. Ignore this file. */
-- dirp->errcode = ENAMETOOLONG;
-- dp->d_ino = 0;
-- continue;
-- }
-+ reclen = offsetof (struct dirent64, d_name) + namelen + 1;
-+ break;
- }
-
-- /* Skip deleted and ignored files. */
-+ /* The name is too long. Ignore this file. */
-+ dirp->errcode = ENAMETOOLONG;
-+ dp->d_ino = 0;
- }
-- while (dp->d_ino == 0);
-
- if (dp != NULL)
- {
- *result = memcpy (entry, dp, reclen);
- entry->d_reclen = reclen;
-- ret = 0;
- }
- else
-- {
-- *result = NULL;
-- ret = dirp->errcode;
-- }
-+ *result = NULL;
-
- __libc_lock_unlock (dirp->lock);
-
-- return ret;
-+ return dp != NULL ? 0 : dirp->errcode;
- }
-
- compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1);
---
-2.41.0
-
diff --git a/9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch b/9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch
deleted file mode 100644
index bf2981e..0000000
--- a/9999/0008-linux-Use-getdents64-on-readdir64-compat-implementat.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-From 43e064d5764246f49561def52f9fd592d58b7ac2 Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 27 Jan 2023 14:28:34 -0300
-Subject: [PATCH 8/9] linux: Use getdents64 on readdir64 compat implementation
-
-It uses a similar strategy from the non-LFS readdir that also
-uses getdents64 internally and uses a translation buffer to return
-the compat readdir64 entry.
-
-It allows to remove __old_getdents64.
-
-Checked on i686-linux-gnu.
----
- sysdeps/unix/sysv/linux/dirstream.h | 13 +++-
- sysdeps/unix/sysv/linux/getdents64.c | 93 ----------------------------
- sysdeps/unix/sysv/linux/olddirent.h | 2 -
- sysdeps/unix/sysv/linux/readdir64.c | 50 +++++++++++----
- 4 files changed, 50 insertions(+), 108 deletions(-)
-
-diff --git a/sysdeps/unix/sysv/linux/dirstream.h b/sysdeps/unix/sysv/linux/dirstream.h
-index 8f58a1c3a6..b03ece4590 100644
---- a/sysdeps/unix/sysv/linux/dirstream.h
-+++ b/sysdeps/unix/sysv/linux/dirstream.h
-@@ -24,6 +24,11 @@
- #include <libc-lock.h>
- #include <telldir.h>
-
-+#include <shlib-compat.h>
-+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-+# include <olddirent.h>
-+#endif
-+
- /* Directory stream type.
-
- The miscellaneous Unix `readdir' implementations read directory data
-@@ -44,7 +49,13 @@ struct __dirstream
- int errcode; /* Delayed error code. */
-
- #if !defined __OFF_T_MATCHES_OFF64_T || !defined __INO_T_MATCHES_INO64_T
-- struct dirent tdp;
-+ union
-+ {
-+ struct dirent tdp;
-+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-+ struct __old_dirent64 tdp64;
-+# endif
-+ };
- #endif
- #if _DIRENT_OFFSET_TRANSLATION
- struct dirstream_loc_t locs; /* off64_t to long int map for telldir. */
-diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
-index 01c3517deb..db299864ed 100644
---- a/sysdeps/unix/sysv/linux/getdents64.c
-+++ b/sysdeps/unix/sysv/linux/getdents64.c
-@@ -36,97 +36,4 @@ weak_alias (__getdents64, getdents64)
-
- #if _DIRENT_MATCHES_DIRENT64
- strong_alias (__getdents64, __getdents)
--#else
--# include <shlib-compat.h>
--
--# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
--# include <olddirent.h>
--# include <unistd.h>
--
--static ssize_t
--handle_overflow (int fd, __off64_t offset, ssize_t count)
--{
-- /* If this is the first entry in the buffer, we can report the
-- error. */
-- if (offset == 0)
-- {
-- __set_errno (EOVERFLOW);
-- return -1;
-- }
--
-- /* Otherwise, seek to the overflowing entry, so that the next call
-- will report the error, and return the data read so far. */
-- if (__lseek64 (fd, offset, SEEK_SET) != 0)
-- return -1;
-- return count;
--}
--
--ssize_t
--__old_getdents64 (int fd, char *buf, size_t nbytes)
--{
-- /* We do not move the individual directory entries. This is only
-- possible if the target type (struct __old_dirent64) is smaller
-- than the source type. */
-- _Static_assert (offsetof (struct __old_dirent64, d_name)
-- <= offsetof (struct dirent64, d_name),
-- "__old_dirent64 is larger than dirent64");
-- _Static_assert (__alignof__ (struct __old_dirent64)
-- <= __alignof__ (struct dirent64),
-- "alignment of __old_dirent64 is larger than dirent64");
--
-- ssize_t retval = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
-- if (retval > 0)
-- {
-- /* This is the marker for the first entry. Offset 0 is reserved
-- for the first entry (see rewinddir). Here, we use it as a
-- marker for the first entry in the buffer. We never actually
-- seek to offset 0 because handle_overflow reports the error
-- directly, so it does not matter that the offset is incorrect
-- if entries have been read from the descriptor before (so that
-- the descriptor is not actually at offset 0). */
-- __off64_t previous_offset = 0;
--
-- char *p = buf;
-- char *end = buf + retval;
-- while (p < end)
-- {
-- struct dirent64 *source = (struct dirent64 *) p;
--
-- /* Copy out the fixed-size data. */
-- __ino_t ino = source->d_ino;
-- __off64_t offset = source->d_off;
-- unsigned int reclen = source->d_reclen;
-- unsigned char type = source->d_type;
--
-- /* Check for ino_t overflow. */
-- if (__glibc_unlikely (ino != source->d_ino))
-- return handle_overflow (fd, previous_offset, p - buf);
--
-- /* Convert to the target layout. Use a separate struct and
-- memcpy to side-step aliasing issues. */
-- struct __old_dirent64 result;
-- result.d_ino = ino;
-- result.d_off = offset;
-- result.d_reclen = reclen;
-- result.d_type = type;
--
-- /* Write the fixed-sized part of the result to the
-- buffer. */
-- size_t result_name_offset = offsetof (struct __old_dirent64, d_name);
-- memcpy (p, &result, result_name_offset);
--
-- /* Adjust the position of the name if necessary. Copy
-- everything until the end of the record, including the
-- terminating NUL byte. */
-- if (result_name_offset != offsetof (struct dirent64, d_name))
-- memmove (p + result_name_offset, source->d_name,
-- reclen - offsetof (struct dirent64, d_name));
--
-- p += reclen;
-- previous_offset = offset;
-- }
-- }
-- return retval;
--}
--# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */
- #endif /* _DIRENT_MATCHES_DIRENT64 */
-diff --git a/sysdeps/unix/sysv/linux/olddirent.h b/sysdeps/unix/sysv/linux/olddirent.h
-index cde95e192e..2d682a6919 100644
---- a/sysdeps/unix/sysv/linux/olddirent.h
-+++ b/sysdeps/unix/sysv/linux/olddirent.h
-@@ -36,8 +36,6 @@ extern struct __old_dirent64 *__old_readdir64_unlocked (DIR *__dirp)
- attribute_hidden;
- extern int __old_readdir64_r (DIR *__dirp, struct __old_dirent64 *__entry,
- struct __old_dirent64 **__result);
--extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
-- attribute_hidden;
- int __old_scandir64 (const char * __dir,
- struct __old_dirent64 *** __namelist,
- int (*__selector) (const struct __old_dirent64 *),
-diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
-index b901071aa7..88e42c5e90 100644
---- a/sysdeps/unix/sysv/linux/readdir64.c
-+++ b/sysdeps/unix/sysv/linux/readdir64.c
-@@ -102,21 +102,43 @@ versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
- # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
- # include <olddirent.h>
-
-+/* Translate the DP64 entry to the old LFS one in the translation buffer
-+ at dirstream DS. Return true is the translation was possible or
-+ false if either an internal fields can be represented in the non-LFS
-+ entry or if the translation can not be resized. */
-+static bool
-+dirstream_old_entry (struct __dirstream *ds, const struct dirent64 *dp64)
-+{
-+ /* Check for overflow. */
-+ if (!in_ino_t_range (dp64->d_ino))
-+ return false;
-+
-+ /* And if name is too large. */
-+ if (dp64->d_reclen - offsetof (struct dirent64, d_name) > NAME_MAX)
-+ return false;
-+
-+ ds->filepos = dp64->d_off;
-+
-+ ds->tdp64.d_off = dp64->d_off;
-+ ds->tdp64.d_ino = dp64->d_ino;
-+ ds->tdp64.d_reclen = dp64->d_reclen;
-+ ds->tdp64.d_type = dp64->d_type;
-+ memcpy (ds->tdp64.d_name, dp64->d_name,
-+ dp64->d_reclen - offsetof (struct dirent64, d_name));
-+
-+ return true;
-+}
-+
- attribute_compat_text_section
- struct __old_dirent64 *
- __old_readdir64_unlocked (DIR *dirp)
- {
-- struct __old_dirent64 *dp;
-- int saved_errno = errno;
-+ const int saved_errno = errno;
-
- if (dirp->offset >= dirp->size)
- {
- /* We've emptied out our buffer. Refill it. */
--
-- size_t maxread = dirp->allocation;
-- ssize_t bytes;
--
-- bytes = __old_getdents64 (dirp->fd, dirp->data, maxread);
-+ ssize_t bytes = __getdents64 (dirp->fd, dirp->data, dirp->allocation);
- if (bytes <= 0)
- {
- /* Linux may fail with ENOENT on some file systems if the
-@@ -127,17 +149,21 @@ __old_readdir64_unlocked (DIR *dirp)
- __set_errno (saved_errno);
- return NULL;
- }
-- dirp->size = (size_t) bytes;
-+ dirp->size = bytes;
-
- /* Reset the offset into the buffer. */
- dirp->offset = 0;
- }
-
-- dp = (struct __old_dirent64 *) &dirp->data[dirp->offset];
-- dirp->offset += dp->d_reclen;
-- dirp->filepos = dp->d_off;
-+ struct dirent64 *dp64 = (struct dirent64 *) &dirp->data[dirp->offset];
-+ dirp->offset += dp64->d_reclen;
-
-- return dp;
-+ /* Skip entries which might overflow d_ino or for memory allocation failure
-+ in case of large file names. */
-+ if (dirstream_old_entry (dirp, dp64))
-+ return &dirp->tdp64;
-+
-+ return NULL;
- }
-
- attribute_compat_text_section
---
-2.41.0
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2024-01-11 23:28 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2024-01-11 23:28 UTC (permalink / raw
To: gentoo-commits
commit: f4d075e7d6163f39351a269f1a97b12253f0c691
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 11 23:28:05 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jan 11 23:28:05 2024 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=f4d075e7
Drop valgrind tests patch, do this in ebuild
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...sable-valgrind-based-tests-too-unreliable.patch | 38 ----------------------
1 file changed, 38 deletions(-)
diff --git a/9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch b/9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
deleted file mode 100644
index 9f13cb0..0000000
--- a/9999/0009-Gentoo-Disable-valgrind-based-tests-too-unreliable.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 47f6f53cd39997f8e7fea5235b27a30fbdc9dd4d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Sat, 23 Dec 2023 22:56:11 +0100
-Subject: [PATCH 9/9] Gentoo: Disable valgrind-based tests, too unreliable
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
----
- elf/Makefile | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index ba7b71035c..4337603c6b 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -480,7 +480,6 @@ tests += \
- unload6 \
- unload7 \
- unload8 \
-- valgrind-test \
- # tests
- tests-cxx = \
- tst-dlopen-nodelete-reloc \
-@@ -611,9 +610,6 @@ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \
- --required=__io_vtables \
- > $@ 2>&1; $(evaluate-test)
-
--ifeq ($(run-built-tests),yes)
--tests-special += $(objpfx)tst-valgrind-smoke.out
--endif
- $(objpfx)tst-valgrind-smoke.out: tst-valgrind-smoke.sh $(objpfx)ld.so $(objpfx)valgrind-test
- $(SHELL) $< $(objpfx)ld.so $(rtlddir)/$(rtld-installed-name) '$(test-wrapper-env)' \
- '$(run-program-env)' '$(rpath-link)' $(objpfx)valgrind-test > $@; $(evaluate-test)
---
-2.41.0
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2024-02-19 0:52 Andreas K. Hüttel
0 siblings, 0 replies; 38+ messages in thread
From: Andreas K. Hüttel @ 2024-02-19 0:52 UTC (permalink / raw
To: gentoo-commits
commit: d8f2b399fa774ad4d337c59bdafe4c1310b59b39
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 19 00:51:47 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Feb 19 00:51:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=d8f2b399
Add sparc kernel bug workaround
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
...for-clone-on-sparc-might-fail-with-EFAULT.patch | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch b/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch
new file mode 100644
index 0000000..65fb098
--- /dev/null
+++ b/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch
@@ -0,0 +1,50 @@
+From e2218c420f1aca6c8910f4ddd6df11815c137bdf Mon Sep 17 00:00:00 2001
+From: Michael Karcher <sourceware-bugzilla@mkarcher.dialup.fu-berlin.de>
+Date: Sat, 17 Feb 2024 22:47:58 +0100
+Subject: [PATCH] Mitigation for "clone on sparc might fail with -EFAULT for no
+ valid reason"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html
+Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394
+See-also: https://lore.kernel.org/sparclinux/62f9be9d-a086-4134-9a9f-5df8822708af@mkarcher.dialup.fu-berlin.de/
+Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
+(cherry picked from commit fa441cd6be9a34d81306d41defeefaa2ac31d0b8)
+---
+ sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 3 +++
+ sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+index b48aa96ea6..0b1af3203b 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
++++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+@@ -28,6 +28,9 @@
+ .text
+ ENTRY (__clone)
+ save %sp,-96,%sp
++ save %sp,-96,%sp
++ flushw
++ restore
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+index e6c4e12f47..48a7152f38 100644
+--- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
++++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+@@ -32,6 +32,9 @@
+
+ ENTRY (__clone)
+ save %sp, -192, %sp
++ save %sp, -192, %sp
++ flushw
++ restore
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+--
+2.43.0
+
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/
@ 2024-08-26 16:38 Sam James
0 siblings, 0 replies; 38+ messages in thread
From: Sam James @ 2024-08-26 16:38 UTC (permalink / raw
To: gentoo-commits
commit: 3d95e904d7e2ed93baab37897a46b381bd9cf986
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 16:38:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 16:38:05 2024 +0000
URL: https://gitweb.gentoo.org/proj/toolchain/glibc-patches.git/commit/?id=3d95e904
9999: drop 0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch
This landed upstream in faeaa3bc9f76030b9882ccfdee232fc0ca6dcb06 which
is in 2.40.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...for-clone-on-sparc-might-fail-with-EFAULT.patch | 50 ----------------------
1 file changed, 50 deletions(-)
diff --git a/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch b/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch
deleted file mode 100644
index 65fb098..0000000
--- a/9999/0007-Mitigation-for-clone-on-sparc-might-fail-with-EFAULT.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From e2218c420f1aca6c8910f4ddd6df11815c137bdf Mon Sep 17 00:00:00 2001
-From: Michael Karcher <sourceware-bugzilla@mkarcher.dialup.fu-berlin.de>
-Date: Sat, 17 Feb 2024 22:47:58 +0100
-Subject: [PATCH] Mitigation for "clone on sparc might fail with -EFAULT for no
- valid reason"
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html
-Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394
-See-also: https://lore.kernel.org/sparclinux/62f9be9d-a086-4134-9a9f-5df8822708af@mkarcher.dialup.fu-berlin.de/
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-(cherry picked from commit fa441cd6be9a34d81306d41defeefaa2ac31d0b8)
----
- sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 3 +++
- sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 3 +++
- 2 files changed, 6 insertions(+)
-
-diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
-index b48aa96ea6..0b1af3203b 100644
---- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
-+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
-@@ -28,6 +28,9 @@
- .text
- ENTRY (__clone)
- save %sp,-96,%sp
-+ save %sp,-96,%sp
-+ flushw
-+ restore
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
-diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
-index e6c4e12f47..48a7152f38 100644
---- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
-+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
-@@ -32,6 +32,9 @@
-
- ENTRY (__clone)
- save %sp, -192, %sp
-+ save %sp, -192, %sp
-+ flushw
-+ restore
- cfi_def_cfa_register(%fp)
- cfi_window_save
- cfi_register(%o7, %i7)
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 38+ messages in thread
end of thread, other threads:[~2024-08-26 16:38 UTC | newest]
Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-23 23:20 [gentoo-commits] proj/toolchain/glibc-patches:master commit in: 9999/ Andreas K. Hüttel
-- strict thread matches above, loose matches on Subject: below --
2024-08-26 16:38 Sam James
2024-02-19 0:52 Andreas K. Hüttel
2024-01-11 23:28 Andreas K. Hüttel
2024-01-11 23:27 Andreas K. Hüttel
2023-12-25 20:15 Andreas K. Hüttel
2023-12-25 20:11 Andreas K. Hüttel
2023-12-23 21:58 Andreas K. Hüttel
2023-10-04 19:13 Andreas K. Hüttel
2023-09-11 17:21 Andreas K. Hüttel
2023-07-17 20:40 Andreas K. Hüttel
2023-02-01 19:47 Andreas K. Hüttel
2023-01-01 18:42 Andreas K. Hüttel
2022-09-20 17:56 Andreas K. Hüttel
2022-09-19 21:26 Andreas K. Hüttel
2022-08-08 21:22 Andreas K. Hüttel
2022-07-29 12:20 WANG Xuerui
2022-07-05 4:02 Andreas K. Hüttel
2022-04-16 11:54 Andreas K. Hüttel
2022-04-16 11:54 Andreas K. Hüttel
2022-04-16 11:54 Andreas K. Hüttel
2022-03-27 16:12 Andreas K. Hüttel
2022-03-07 1:04 Andreas K. Hüttel
2022-02-21 21:42 Andreas K. Hüttel
2022-02-12 18:45 Andreas K. Hüttel
2022-01-06 15:13 Andreas K. Hüttel
2022-01-05 21:19 Andreas K. Hüttel
2022-01-04 11:00 Andreas K. Hüttel
2021-12-01 16:30 Andreas K. Hüttel
2021-12-01 16:17 Andreas K. Hüttel
2021-08-02 22:42 Andreas K. Hüttel
2021-08-02 22:41 Andreas K. Hüttel
2021-07-22 23:17 Andreas K. Hüttel
2021-05-25 20:30 Andreas K. Hüttel
2021-04-10 15:34 Andreas K. Hüttel
2021-02-27 19:18 Andreas K. Hüttel
2020-07-18 16:23 Andreas K. Hüttel
2020-05-13 8:52 Andreas K. Hüttel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox