crux-commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
February 2023
- 1 participants
- 467 discussions
commit aa4a25a9b522bb5f279ca529f9201207a2377a43
Author: Juergen Daubert <jue(a)jue.li>
Date: Mon Feb 27 13:04:34 2023 +0100
psutils: update to 2.10
diff --git a/psutils/.signature b/psutils/.signature
index a7c716a5c..46fe2b6dc 100644
--- a/psutils/.signature
+++ b/psutils/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/bjYoPEHKpPiqV9bWNHwVqBfpHvilZEKHW9Q3o64ZurgDXWY6lFVb22/+uH+iydG0UJOfpqyuchzHLy1nitbsAM=
-SHA256 (Pkgfile) = 90fd11992653bc1af7e02a1c222abad5d0a52ed4ebdd3dc9366bf894f0301112
+RWSE3ohX2g5d/UiwGA9g78RA4q57UcOs79FcFOnAm1s/OMra8q/l0HUR/J7Paygy6NBIBBQmybRheYnFduKiqtmw7ut1pIRofgo=
+SHA256 (Pkgfile) = 202f903f5b43cc6c79f9223900f68bc7b5452aa3fff32eade05a0796a7bbbb98
SHA256 (.footprint) = 78f3bcaf85812c94299d996a6f613e7e4fe558cc60a8adb0f32ca511234ed762
-SHA256 (psutils-2.09.tar.gz) = e31ab570e24478ce777b63b300ff428aedc916131cd7b077094311761604b7da
+SHA256 (psutils-2.10.tar.gz) = 6f8339fd5322df5c782bfb355d9f89e513353220fca0700a5a28775404d7e98b
diff --git a/psutils/Pkgfile b/psutils/Pkgfile
index 5c8c162b2..43aac10b5 100644
--- a/psutils/Pkgfile
+++ b/psutils/Pkgfile
@@ -4,7 +4,7 @@
# Depends on: p5-ipc-run3 paper ghostscript
name=psutils
-version=2.09
+version=2.10
release=1
source=(https://github.com/rrthomas/psutils/releases/download/v$version/$na…
1
0
commit d8456bf2b0e41ef13ab485c2a5b87386f85f6d5a
Author: Juergen Daubert <jue(a)jue.li>
Date: Mon Feb 27 12:56:04 2023 +0100
glibc-32: sync with upstream 2.36 branch
diff --git a/glibc-32/.signature b/glibc-32/.signature
index 78d7710d..5732aca0 100644
--- a/glibc-32/.signature
+++ b/glibc-32/.signature
@@ -1,9 +1,8 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqnDa/l18WtM+CLL+r/aG74B9y4amlPVie874oqse350RnCNkXblABw8M4qGj2tKoGrot/IuP+yKUQDHiBy0mGgs=
-SHA256 (Pkgfile) = 018e7b5804c2e07a123e0c3a09703405fa06bf2eee24c3febe25390d98df5d3f
+RWRJc1FUaeVeqt+DLM9b5iryklLP4a4NOTeRnczmsa+nNpmS5/Krw0zAU1jyNaSrE567f4ZgKEWaOuIHNU3OV+qNZSmox5hXgwo=
+SHA256 (Pkgfile) = 1ae7bd79c3bd7356a8575d35c96fbe8f8c22ada6cadb162f66d9903d7b15144d
SHA256 (.footprint) = f676700a19f936a1af944e81a516dbf182723d6ac244eadabd3fd19e9a01daa5
SHA256 (glibc-2.36.tar.xz) = 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
SHA256 (linux-5.15.55.tar.xz) = 1ef6bd508b6c3af3bef2d5b337e4477254dba284c79e329aa38f9763ae3bfdcc
-SHA256 (glibc-2.35-make-4.4-MAKEFLAGS.patch) = 7cfc3e52d840f5fb292e251209731ff83753cc5bf0056df3190ee4cb88ed3278
-SHA256 (glibc-2.36-3.patch) = 0733042e85defe47019d3f8a31a21015997c78137a876ce97d2e0e64c79e173f
+SHA256 (glibc-2.36-4.patch) = c562f1a0b80b6ba8694df8a90fa7a3ff20604b6bf486c2ab76d02a62f3e77844
SHA256 (lib32.conf) = 2f174d2bcefe1c29327690514f34d6970fffdd54398320ca23a11b5f1e3c9b2d
diff --git a/glibc-32/Pkgfile b/glibc-32/Pkgfile
index f92c9a05..f520f6dc 100644
--- a/glibc-32/Pkgfile
+++ b/glibc-32/Pkgfile
@@ -4,13 +4,12 @@
name=glibc-32
version=2.36
-release=4
+release=5
_kernel_version=5.15.55
source=(https://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz
https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_kernel_version.tar.xz
- glibc-2.35-make-4.4-MAKEFLAGS.patch
- glibc-$version-3.patch lib32.conf)
+ glibc-$version-4.patch lib32.conf)
build() {
# install kernel headers
@@ -19,8 +18,7 @@ build() {
make -C $SRC/linux-$_kernel_version INSTALL_HDR_PATH=$PKG/usr headers_install
chown root:root $PKG/usr
- patch -p1 -d $SRC/glibc-${version:0:4} -i $SRC/glibc-$version-3.patch
- patch -p1 -d $SRC/glibc-${version:0:4} -i $SRC/glibc-2.35-make-4.4-MAKEFLAGS.patch
+ patch -p1 -d $SRC/glibc-${version:0:4} -i $SRC/glibc-$version-4.patch
mkdir $SRC/build
cd $SRC/build
diff --git a/glibc-32/glibc-2.35-make-4.4-MAKEFLAGS.patch b/glibc-32/glibc-2.35-make-4.4-MAKEFLAGS.patch
deleted file mode 100644
index 51fbe5f5..00000000
--- a/glibc-32/glibc-2.35-make-4.4-MAKEFLAGS.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d7ed98add14f75041499ac189696c9bd3d757fe
-https://bugs.gentoo.org/869263
-
-From 2d7ed98add14f75041499ac189696c9bd3d757fe Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyich(a)gmail.com>
-Date: Tue, 13 Sep 2022 13:39:13 -0400
-Subject: [PATCH] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4
- [BZ# 29564]
-
-make-4.4 will add long flags to MAKEFLAGS variable:
-
- * WARNING: Backward-incompatibility!
- Previously only simple (one-letter) options were added to the MAKEFLAGS
- variable that was visible while parsing makefiles. Now, all options
- are available in MAKEFLAGS.
-
-This causes locale builds to fail when long options are used:
-
- $ make --shuffle
- ...
- make -C localedata install-locales
- make: invalid shuffle mode: '1662724426r'
-
-The change fixes it by passing eash option via whitespace and dashes.
-That way option is appended to both single-word form and whitespace
-separated form.
-
-While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
-out --long-options. Otherwise options like --shuffle flag enable silent
-mode unintentionally. $(silent-make) variable consolidates the checks.
-
-Resolves: BZ# 29564
-
-CC: Paul Smith <psmith(a)gnu.org>
-CC: Siddhesh Poyarekar <siddhesh(a)gotplt.org>
-Signed-off-by: Sergei Trofimovich <slyich(a)gmail.com>
-Reviewed-by: Siddhesh Poyarekar <siddhesh(a)sourceware.org>
---- a/Makeconfig
-+++ b/Makeconfig
-@@ -43,6 +43,22 @@ else
- $(error objdir must be defined by the build-directory Makefile)
- endif
-
-+# Did we request 'make -s' run? "yes" or "no".
-+# Starting from make-4.4 MAKEFLAGS now contains long
-+# options like '--shuffle'. To detect presence of 's'
-+# we pick first word with short options. Long options
-+# are guaranteed to come after whitespace. We use '-'
-+# prefix to always have a word before long options
-+# even if no short options were passed.
-+# Typical MAKEFLAGS values to watch for:
-+# "rs --shuffle=42" (silent)
-+# " --shuffle" (not silent)
-+ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
-+silent-make := no
-+else
-+silent-make := yes
-+endif
-+
- # Root of the sysdeps tree.
- sysdep_dir := $(..)sysdeps
- export sysdep_dir := $(sysdep_dir)
-@@ -917,7 +933,7 @@ endif
- # umpteen zillion filenames along with it (we use `...' instead)
- # but we don't want this echoing done when the user has said
- # he doesn't want to see commands echoed by using -s.
--ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
-+ifeq ($(silent-make),yes) # if -s
- +cmdecho := echo >/dev/null
- else # not -s
- +cmdecho := echo
---- a/Makerules
-+++ b/Makerules
-@@ -794,7 +794,7 @@ endif
- # Maximize efficiency by minimizing the number of rules.
- .SUFFIXES: # Clear the suffix list. We don't use suffix rules.
- # Don't define any builtin rules.
--MAKEFLAGS := $(MAKEFLAGS)r
-+MAKEFLAGS := $(MAKEFLAGS) -r
-
- # Generic rule for making directories.
- %/:
-@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
- .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
-
- # Use the verbose option of ar and tar when not running silently.
--ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
-+ifeq ($(silent-make),no) # if not -s
- verbose := v
- else # -s
- verbose :=
---- a/elf/rtld-Rules
-+++ b/elf/rtld-Rules
-@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
- mv -f $@T $@
-
- # Use the verbose option of ar and tar when not running silently.
--ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
-+ifeq ($(silent-make),no) # if not -s
- verbose := v
- else # -s
- verbose :=
diff --git a/glibc-32/glibc-2.36-3.patch b/glibc-32/glibc-2.36-4.patch
similarity index 85%
rename from glibc-32/glibc-2.36-3.patch
rename to glibc-32/glibc-2.36-4.patch
index 864fdafd..e0722ac5 100644
--- a/glibc-32/glibc-2.36-3.patch
+++ b/glibc-32/glibc-2.36-4.patch
@@ -1,8 +1,75 @@
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..9dd058e04b 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++# "rs --shuffle=42" (silent)
++# " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -868,7 +884,7 @@ endif
+ # Use 64 bit time_t support for installed programs
+ installed-modules = nonlib nscd lddlibc4 ldconfig locale_programs \
+ iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \
+- libutil libpcprofile libSegFault
++ libutil libpcprofile libSegFault libnsl
+ +extra-time-flags = $(if $(filter $(installed-modules),\
+ $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64)
+
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
++ifeq ($(silent-make),yes) # if -s
+ +cmdecho := echo >/dev/null
+ else # not -s
+ +cmdecho := echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES: # Clear the suffix list. We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
++ifeq ($(silent-make),no) # if not -s
+ verbose := v
+ else # -s
+ verbose :=
diff --git a/NEWS b/NEWS
-index f61e521fc8..e92d547e2c 100644
+index f61e521fc8..aff6951c1d 100644
--- a/NEWS
+++ b/NEWS
-@@ -5,6 +5,48 @@ See the end for copying conditions.
+@@ -5,6 +5,57 @@ See the end for copying conditions.
Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
using `glibc' in the "product" field.
@@ -27,7 +94,10 @@ index f61e521fc8..e92d547e2c 100644
+ [12154] Do not fail DNS resolution for CNAMEs which are not host names
+ [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+ [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++ [29864] libc: __libc_start_main() should obtain program headers
++ address (_dl_phdr) from the auxv, not the ELF header.
+ [29305] Conserve NSS buffer space during DNS packet parsing
++ [29402] nscd: nscd: No such file or directory
+ [29415] nscd: Fix netlink cache invalidation if epoll is used
+ [28937] New DSO dependency sorter does not put new map first if in a cycle
+ [29446] _dlopen now ignores dl_caller argument in static mode
@@ -39,6 +109,8 @@ index f61e521fc8..e92d547e2c 100644
+ [29528] elf: Call __libc_early_init for reused namespaces
+ [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+ [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++ [29576] build: librtld.os: in function `_dl_start_profile':
++ (.text+0x9444): undefined reference to `strcpy'
+ [29583] Use 64-bit interfaces in gconv_parseconfdir
+ [29600] Do not completely clear reused namespace in dlmopen
+ [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
@@ -47,6 +119,10 @@ index f61e521fc8..e92d547e2c 100644
+ [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+ platforms
+ [29730] broken y2038 support in fstatat on MIPS N64
++ [29771] Restore IPC_64 support in sysvipc *ctl functions
++ [29776] elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10
++ [29951] time: Set daylight to 1 for matching DST/offset change
++ [30053] time: strftime %s returns -1 after 2038 on 32 bits systems
+
Version 2.36
@@ -114,6 +190,75 @@ index 2b99dea33b..aac8c49b00 100644
return __cmsg;
}
#endif /* Use `extern inline'. */
+diff --git a/csu/libc-start.c b/csu/libc-start.c
+index 543560f36c..bfeee6d851 100644
+--- a/csu/libc-start.c
++++ b/csu/libc-start.c
+@@ -262,28 +262,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
+ }
+ # endif
+ _dl_aux_init (auxvec);
+- if (GL(dl_phdr) == NULL)
+ # endif
+- {
+- /* Starting from binutils-2.23, the linker will define the
+- magic symbol __ehdr_start to point to our own ELF header
+- if it is visible in a segment that also includes the phdrs.
+- So we can set up _dl_phdr and _dl_phnum even without any
+- information from auxv. */
+-
+- extern const ElfW(Ehdr) __ehdr_start
+-# if BUILD_PIE_DEFAULT
+- __attribute__ ((visibility ("hidden")));
+-# else
+- __attribute__ ((weak, visibility ("hidden")));
+- if (&__ehdr_start != NULL)
+-# endif
+- {
+- assert (__ehdr_start.e_phentsize == sizeof *GL(dl_phdr));
+- GL(dl_phdr) = (const void *) &__ehdr_start + __ehdr_start.e_phoff;
+- GL(dl_phnum) = __ehdr_start.e_phnum;
+- }
+- }
+
+ __tunables_init (__environ);
+
+diff --git a/csu/libc-tls.c b/csu/libc-tls.c
+index 0a216c5502..7fdf7cd7a8 100644
+--- a/csu/libc-tls.c
++++ b/csu/libc-tls.c
+@@ -118,19 +118,18 @@ __libc_setup_tls (void)
+ __tls_pre_init_tp ();
+
+ /* Look through the TLS segment if there is any. */
+- if (_dl_phdr != NULL)
+- for (phdr = _dl_phdr; phdr < &_dl_phdr[_dl_phnum]; ++phdr)
+- if (phdr->p_type == PT_TLS)
+- {
+- /* Remember the values we need. */
+- memsz = phdr->p_memsz;
+- filesz = phdr->p_filesz;
+- initimage = (void *) phdr->p_vaddr + main_map->l_addr;
+- align = phdr->p_align;
+- if (phdr->p_align > max_align)
+- max_align = phdr->p_align;
+- break;
+- }
++ for (phdr = _dl_phdr; phdr < &_dl_phdr[_dl_phnum]; ++phdr)
++ if (phdr->p_type == PT_TLS)
++ {
++ /* Remember the values we need. */
++ memsz = phdr->p_memsz;
++ filesz = phdr->p_filesz;
++ initimage = (void *) phdr->p_vaddr + main_map->l_addr;
++ align = phdr->p_align;
++ if (phdr->p_align > max_align)
++ max_align = phdr->p_align;
++ break;
++ }
+
+ /* Calculate the size of the static TLS surplus, with 0 auditors. */
+ _dl_tls_static_surplus_init (0);
diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
index 2696dde4b1..9b07b4e132 100644
--- a/dlfcn/dlopen.c
@@ -128,7 +273,7 @@ index 2696dde4b1..9b07b4e132 100644
void *
diff --git a/elf/Makefile b/elf/Makefile
-index fd77d0c7c8..72178d33ff 100644
+index fd77d0c7c8..48788fcdb8 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -374,6 +374,8 @@ tests += \
@@ -148,7 +293,15 @@ index fd77d0c7c8..72178d33ff 100644
tst-dlopenfail \
tst-dlopenfail-2 \
tst-dlopenrpath \
-@@ -765,6 +768,8 @@ modules-names += \
+@@ -631,6 +634,7 @@ ifeq ($(run-built-tests),yes)
+ tests-special += \
+ $(objpfx)noload-mem.out \
+ $(objpfx)tst-ldconfig-X.out \
++ $(objpfx)tst-ldconfig-p.out \
+ $(objpfx)tst-leaks1-mem.out \
+ $(objpfx)tst-rtld-help.out \
+ # tests-special
+@@ -765,6 +769,8 @@ modules-names += \
tst-alignmod3 \
tst-array2dep \
tst-array5dep \
@@ -157,7 +310,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-audit11mod1 \
tst-audit11mod2 \
tst-audit12mod1 \
-@@ -798,6 +803,7 @@ modules-names += \
+@@ -798,6 +804,7 @@ modules-names += \
tst-auditmanymod7 \
tst-auditmanymod8 \
tst-auditmanymod9 \
@@ -165,7 +318,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-auditmod1 \
tst-auditmod9a \
tst-auditmod9b \
-@@ -834,6 +840,8 @@ modules-names += \
+@@ -834,6 +841,8 @@ modules-names += \
tst-dlmopen1mod \
tst-dlmopen-dlerror-mod \
tst-dlmopen-gethostbyname-mod \
@@ -174,7 +327,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-dlopenfaillinkmod \
tst-dlopenfailmod1 \
tst-dlopenfailmod2 \
-@@ -990,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+@@ -990,23 +999,8 @@ modules-names += tst-gnu2-tls1mod
$(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
tst-gnu2-tls1mod.so-no-z-defs = yes
CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
@@ -199,7 +352,19 @@ index fd77d0c7c8..72178d33ff 100644
ifeq (yes,$(have-protected-data))
modules-names += tst-protected1moda tst-protected1modb
tests += tst-protected1a tst-protected1b
-@@ -2967,3 +2960,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+@@ -2410,6 +2404,11 @@ $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
+ '$(run-program-env)' > $@; \
+ $(evaluate-test)
+
++$(objpfx)tst-ldconfig-p.out : tst-ldconfig-p.sh $(objpfx)ldconfig
++ $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \
++ '$(run-program-env)' > $@; \
++ $(evaluate-test)
++
+ # Test static linking of all the libraries we can possibly link
+ # together. Note that in some configurations this may be less than the
+ # complete list of libraries we build but we try to maxmimize this list.
+@@ -2967,3 +2966,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
&& grep -q '^status: 127$$' $@; \
$(evaluate-test)
@@ -412,6 +577,70 @@ index 96638d7ed1..3e2a6a584e 100644
}
#endif /* HAVE_TUNABLES. */
+diff --git a/elf/dl-support.c b/elf/dl-support.c
+index 4af0b5b2ce..f45b630ba5 100644
+--- a/elf/dl-support.c
++++ b/elf/dl-support.c
+@@ -255,6 +255,25 @@ _dl_aux_init (ElfW(auxv_t) *av)
+ for (int i = 0; i < array_length (auxv_values); ++i)
+ auxv_values[i] = 0;
+ _dl_parse_auxv (av, auxv_values);
++
++ _dl_phdr = (void*) auxv_values[AT_PHDR];
++ _dl_phnum = auxv_values[AT_PHNUM];
++
++ if (_dl_phdr == NULL)
++ {
++ /* Starting from binutils-2.23, the linker will define the
++ magic symbol __ehdr_start to point to our own ELF header
++ if it is visible in a segment that also includes the phdrs.
++ So we can set up _dl_phdr and _dl_phnum even without any
++ information from auxv. */
++
++ extern const ElfW(Ehdr) __ehdr_start attribute_hidden;
++ assert (__ehdr_start.e_phentsize == sizeof *GL(dl_phdr));
++ _dl_phdr = (const void *) &__ehdr_start + __ehdr_start.e_phoff;
++ _dl_phnum = __ehdr_start.e_phnum;
++ }
++
++ assert (_dl_phdr != NULL);
+ }
+ #endif
+
+@@ -323,20 +342,19 @@ _dl_non_dynamic_init (void)
+ if (_dl_platform != NULL)
+ _dl_platformlen = strlen (_dl_platform);
+
+- if (_dl_phdr != NULL)
+- for (const ElfW(Phdr) *ph = _dl_phdr; ph < &_dl_phdr[_dl_phnum]; ++ph)
+- switch (ph->p_type)
+- {
+- /* Check if the stack is nonexecutable. */
+- case PT_GNU_STACK:
+- _dl_stack_flags = ph->p_flags;
+- break;
+-
+- case PT_GNU_RELRO:
+- _dl_main_map.l_relro_addr = ph->p_vaddr;
+- _dl_main_map.l_relro_size = ph->p_memsz;
+- break;
+- }
++ for (const ElfW(Phdr) *ph = _dl_phdr; ph < &_dl_phdr[_dl_phnum]; ++ph)
++ switch (ph->p_type)
++ {
++ /* Check if the stack is nonexecutable. */
++ case PT_GNU_STACK:
++ _dl_stack_flags = ph->p_flags;
++ break;
++
++ case PT_GNU_RELRO:
++ _dl_main_map.l_relro_addr = ph->p_vaddr;
++ _dl_main_map.l_relro_size = ph->p_memsz;
++ break;
++ }
+
+ call_function_static_weak (_dl_find_object_init);
+
diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
index 5f7f18ef27..4bf9052db1 100644
--- a/elf/dso-sort-tests-1.def
@@ -445,6 +674,19 @@ index 02a1b3f52f..014393f3cc 100644
/* LoongArch specific dynamic relocations */
#define R_LARCH_NONE 0
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ mv -f $@T $@
+
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
++ifeq ($(silent-make),no) # if not -s
+ verbose := v
+ else # -s
+ verbose :=
diff --git a/elf/rtld.c b/elf/rtld.c
index cbbaf4a331..3e771a93d8 100644
--- a/elf/rtld.c
@@ -621,6 +863,89 @@ index 0000000000..70c71fe19c
+}
+
+#include <support/test-driver.c>
+diff --git a/elf/tst-ldconfig-p.sh b/elf/tst-ldconfig-p.sh
+new file mode 100644
+index 0000000000..ec937bf4ec
+--- /dev/null
++++ b/elf/tst-ldconfig-p.sh
+@@ -0,0 +1,77 @@
++#!/bin/sh
++# Test that ldconfig -p prints something useful.
++# 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/>.
++
++# Check that the newly built ldconfig -p can dump the system
++# /etc/ld.so.cache file. This should always work even if the ABIs are
++# not compatible, except in a cross-endian build (that presumably
++# involves emulation when running ldconfig).
++
++common_objpfx=$1
++test_wrapper_env=$2
++run_program_env=$3
++
++if ! test -r /etc/ld.so.cache; then
++ echo "warning: /etc/ld.so.cache does not exist, test skipped"
++ exit 77
++fi
++
++testout="${common_objpfx}elf/tst-ldconfig-p.out"
++# Truncate file.
++: > "$testout"
++
++${test_wrapper_env} \
++${run_program_env} \
++${common_objpfx}elf/ldconfig -p \
++ $testroot/lib >>"$testout" 2>>"$testout"
++status=$?
++echo "info: ldconfig exit status: $status" >>"$testout"
++
++errors=0
++case $status in
++ (0)
++ if head -n 1 "$testout" | \
++ grep -q "libs found in cache \`/etc/ld.so.cache'\$" ; then
++ echo "info: initial string found" >>"$testout"
++ else
++ echo "error: initial string not found" >>"$testout"
++ errors=1
++ fi
++ if grep -q "^ libc\.so\..* => " "$testout"; then
++ echo "info: libc.so.* string found" >>"$testout"
++ else
++ echo "error: libc.so.* string not found" >>"$testout"
++ errors=1
++ fi
++ ;;
++ (1)
++ if head -n 1 "$testout" | \
++ grep -q ": Cache file has wrong endianness\.$" ; then
++ echo "info: cache file has wrong endianess" >> "$testout"
++ else
++ echo "error: unexpected ldconfig error message" >> "$testout"
++ errors=1
++ fi
++ ;;
++ (*)
++ echo "error: unexpected exit status" >> "$testout"
++ errors=1
++ ;;
++esac
++
++exit $errors
diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
index debb96b322..b72933b526 100644
--- a/iconv/gconv_parseconfdir.h
@@ -813,6 +1138,113 @@ index 3590b6f496..4dbbac3800 100644
+
# endif /* _RESOLV_H_ && !_ISOMAC */
#endif
+diff --git a/locale/weight.h b/locale/weight.h
+index 8be2d220f8..4a4d5aa6b2 100644
+--- a/locale/weight.h
++++ b/locale/weight.h
+@@ -27,7 +27,14 @@ findidx (const int32_t *table,
+ const unsigned char *extra,
+ const unsigned char **cpp, size_t len)
+ {
++ /* With GCC 8 when compiling with -Os the compiler warns that
++ seq1.back_us and seq2.back_us might be used uninitialized.
++ This uninitialized use is impossible for the same reason
++ as described in comments in locale/weightwc.h. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ int32_t i = table[*(*cpp)++];
++ DIAG_POP_NEEDS_COMMENT;
+ const unsigned char *cp;
+ const unsigned char *usrc;
+
+diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
+index fd30dd3114..916d2b6f12 100644
+--- a/misc/bits/syslog.h
++++ b/misc/bits/syslog.h
+@@ -24,6 +24,20 @@
+ extern void __syslog_chk (int __pri, int __flag, const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
++#ifdef __USE_MISC
++extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
++ __gnuc_va_list __ap)
++ __attribute__ ((__format__ (__printf__, 3, 0)));
++#endif
++
++#include <bits/floatn.h>
++#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
++# include <bits/syslog-ldbl.h>
++#endif
++
++/* The following functions must be used only after applying all asm
++ redirections, e.g. long double asm redirections. */
++
+ #ifdef __va_arg_pack
+ __fortify_function void
+ syslog (int __pri, const char *__fmt, ...)
+@@ -37,10 +51,6 @@ syslog (int __pri, const char *__fmt, ...)
+
+
+ #ifdef __USE_MISC
+-extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
+- __gnuc_va_list __ap)
+- __attribute__ ((__format__ (__printf__, 3, 0)));
+-
+ __fortify_function void
+ vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
+ {
+diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
+index f525f67547..294e633335 100644
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -152,6 +152,7 @@
+ # define __glibc_objsize(__o) __bos (__o)
+ #endif
+
++#if __USE_FORTIFY_LEVEL > 0
+ /* Compile time conditions to choose between the regular, _chk and _chk_warn
+ variants. These conditions should get evaluated to constant and optimized
+ away. */
+@@ -187,7 +188,7 @@
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
+- : __ ## f ## _chk (__VA_ARGS__, __osz))) \
++ : __ ## f ## _chk (__VA_ARGS__, __osz)))
+
+ /* Fortify function f, where object size argument passed to f is the number of
+ elements and not total size. */
+@@ -197,7 +198,8 @@
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
+- : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
++ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
++#endif
+
+ #if __GNUC_PREREQ (4,3)
+ # define __warnattr(msg) __attribute__((__warning__ (msg)))
+diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
+index d933fea104..3888153ed2 100644
+--- a/misc/sys/syslog.h
++++ b/misc/sys/syslog.h
+@@ -205,11 +205,11 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
+ /* Define some macros helping to catch buffer overflows. */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+ # include <bits/syslog.h>
+-#endif
+-
+-#include <bits/floatn.h>
+-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+-# include <bits/syslog-ldbl.h>
++#else
++# include <bits/floatn.h>
++# if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
++# include <bits/syslog-ldbl.h>
++# endif
+ #endif
+
+ __END_DECLS
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..f67d4b58a4 100644
--- a/misc/syslog.c
@@ -1140,6 +1572,55 @@ index e550d15796..3560b518a2 100644
return 0;
}
+diff --git a/nis/nis_call.c b/nis/nis_call.c
+index 90187e30b1..5b9dd50151 100644
+--- a/nis/nis_call.c
++++ b/nis/nis_call.c
+@@ -574,7 +574,7 @@ static struct nis_server_cache
+ unsigned int size;
+ unsigned int server_used;
+ unsigned int current_ep;
+- __time64_t expires;
++ time_t expires;
+ char name[];
+ } *nis_server_cache[16];
+ static time_t nis_cold_start_mtime;
+@@ -583,7 +583,7 @@ __libc_lock_define_initialized (static, nis_server_cache_lock)
+ static directory_obj *
+ nis_server_cache_search (const_nis_name name, int search_parent,
+ unsigned int *server_used, unsigned int *current_ep,
+- struct __timespec64 *now)
++ struct timespec *now)
+ {
+ directory_obj *ret = NULL;
+ int i;
+@@ -641,7 +641,7 @@ nis_server_cache_search (const_nis_name name, int search_parent,
+ static void
+ nis_server_cache_add (const_nis_name name, int search_parent,
+ directory_obj *dir, unsigned int server_used,
+- unsigned int current_ep, struct __timespec64 *now)
++ unsigned int current_ep, struct timespec *now)
+ {
+ struct nis_server_cache **loc;
+ struct nis_server_cache *new;
+@@ -707,7 +707,7 @@ __nisfind_server (const_nis_name name, int search_parent,
+ nis_error result = NIS_SUCCESS;
+ nis_error status;
+ directory_obj *obj;
+- struct __timespec64 ts;
++ struct timespec ts;
+ unsigned int server_used = ~0;
+ unsigned int current_ep = ~0;
+
+@@ -717,7 +717,7 @@ __nisfind_server (const_nis_name name, int search_parent,
+ if (*dir != NULL)
+ return NIS_SUCCESS;
+
+- __clock_gettime64 (CLOCK_REALTIME, &ts);
++ clock_gettime (CLOCK_REALTIME, &ts);
+
+ if ((flags & NO_CACHE) == 0)
+ *dir = nis_server_cache_search (name, search_parent, &server_used,
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 51e793199f..e0baed170b 100644
--- a/nscd/aicache.c
@@ -1180,6 +1661,32 @@ index 61d1674eb4..531d2e83df 100644
}
# endif
else
+diff --git a/nscd/nscd.h b/nscd/nscd.h
+index 368091aef8..f15321585b 100644
+--- a/nscd/nscd.h
++++ b/nscd/nscd.h
+@@ -65,7 +65,7 @@ typedef enum
+ struct traced_file
+ {
+ /* Tracks the last modified time of the traced file. */
+- time_t mtime;
++ __time64_t mtime;
+ /* Support multiple registered files per database. */
+ struct traced_file *next;
+ int call_res_init;
+diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
+index 9becb62033..31c64275f0 100644
+--- a/nscd/nscd_gethst_r.c
++++ b/nscd/nscd_gethst_r.c
+@@ -112,7 +112,7 @@ __nscd_get_nl_timestamp (void)
+ if (map == NULL
+ || (map != NO_MAPPING
+ && map->head->nscd_certainly_running == 0
+- && map->head->timestamp + MAPPING_TIMEOUT < time_now ()))
++ && map->head->timestamp + MAPPING_TIMEOUT < time64_now ()))
+ map = __nscd_get_mapping (GETFDHST, "hosts", &__hst_map_handle.mapped);
+
+ if (map == NO_MAPPING)
diff --git a/nss/getent.c b/nss/getent.c
index 8178b4b470..d2d2524b0c 100644
--- a/nss/getent.c
@@ -5011,6 +5518,18 @@ index 0000000000..68c96d3c9d
+}
+
+#include <support/test-driver.c>
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index f7b25c1981..3d49c4941a 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
+@@ -171,6 +171,7 @@ tests := \
+ test-a64l \
+ test-at_quick_exit-race \
+ test-atexit-race \
++ test-atexit-recursive \
+ test-bz22786 \
+ test-canon \
+ test-canon2 \
diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
index e417ef624d..960a38f295 100644
--- a/stdlib/arc4random.c
@@ -5024,6 +5543,31 @@ index e417ef624d..960a38f295 100644
int fd;
if (n == 0)
+diff --git a/stdlib/exit.c b/stdlib/exit.c
+index bc46109f3e..dc12e212bc 100644
+--- a/stdlib/exit.c
++++ b/stdlib/exit.c
+@@ -53,7 +53,10 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
+ exit (). */
+ while (true)
+ {
+- struct exit_function_list *cur = *listp;
++ struct exit_function_list *cur;
++
++ restart:
++ cur = *listp;
+
+ if (cur == NULL)
+ {
+@@ -118,7 +121,7 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
+ if (__glibc_unlikely (new_exitfn_called != __new_exitfn_called))
+ /* The last exit function, or another thread, has registered
+ more exit functions. Start the loop over. */
+- continue;
++ goto restart;
+ }
+
+ *listp = cur->next;
diff --git a/stdlib/longlong.h b/stdlib/longlong.h
index 9b89469ac2..d8f76a43b5 100644
--- a/stdlib/longlong.h
@@ -5047,6 +5591,230 @@ index 9b89469ac2..d8f76a43b5 100644
#if defined (__M32R__) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
/* The cmp clears the condition bit. */ \
+diff --git a/stdlib/test-atexit-recursive.c b/stdlib/test-atexit-recursive.c
+new file mode 100644
+index 0000000000..0596b9763b
+--- /dev/null
++++ b/stdlib/test-atexit-recursive.c
+@@ -0,0 +1,75 @@
++/* Support file for atexit/exit, etc. race tests (BZ #27749).
++ 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/>. */
++
++/* Check that atexit handler registed from another handler still called. */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <support/check.h>
++#include <support/xunistd.h>
++#include <sys/wait.h>
++#include <unistd.h>
++
++static void
++atexit_cb (void)
++{
++}
++
++static void
++atexit_last (void)
++{
++ _exit (1);
++}
++
++static void
++atexit_recursive (void)
++{
++ atexit (&atexit_cb);
++ atexit (&atexit_last);
++}
++
++_Noreturn static void
++test_and_exit (int count)
++{
++ for (int i = 0; i < count; ++i)
++ atexit (&atexit_cb);
++ atexit (&atexit_recursive);
++ exit (0);
++}
++
++static int
++do_test (void)
++{
++ for (int i = 0; i < 100; ++i)
++ if (xfork () == 0)
++ test_and_exit (i);
++
++ for (int i = 0; i < 100; ++i)
++ {
++ int status;
++ xwaitpid (0, &status, 0);
++ if (!WIFEXITED (status))
++ FAIL_EXIT1 ("Failed iterations %d", i);
++ TEST_COMPARE (WEXITSTATUS (status), 1);
++ }
++
++ return 0;
++}
++
++#define TEST_FUNCTION do_test
++#include <support/test-driver.c>
+diff --git a/string/test-strnlen.c b/string/test-strnlen.c
+index 4a9375112a..5cbaf4b734 100644
+--- a/string/test-strnlen.c
++++ b/string/test-strnlen.c
+@@ -73,7 +73,7 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char)
+ {
+ size_t i;
+
+- align &= 63;
++ align &= (getpagesize () / sizeof (CHAR) - 1);
+ if ((align + len) * sizeof (CHAR) >= page_size)
+ return;
+
+@@ -90,38 +90,50 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char)
+ static void
+ do_overflow_tests (void)
+ {
+- size_t i, j, len;
++ size_t i, j, al_idx, repeats, len;
+ const size_t one = 1;
+ uintptr_t buf_addr = (uintptr_t) buf1;
++ const size_t alignments[] = { 0, 1, 7, 9, 31, 33, 63, 65, 95, 97, 127, 129 };
+
+- for (i = 0; i < 750; ++i)
++ for (al_idx = 0; al_idx < sizeof (alignments) / sizeof (alignments[0]);
++ al_idx++)
+ {
+- do_test (1, i, SIZE_MAX, BIG_CHAR);
+-
+- do_test (0, i, SIZE_MAX - i, BIG_CHAR);
+- do_test (0, i, i - buf_addr, BIG_CHAR);
+- do_test (0, i, -buf_addr - i, BIG_CHAR);
+- do_test (0, i, SIZE_MAX - buf_addr - i, BIG_CHAR);
+- do_test (0, i, SIZE_MAX - buf_addr + i, BIG_CHAR);
+-
+- len = 0;
+- for (j = 8 * sizeof(size_t) - 1; j ; --j)
+- {
+- len |= one << j;
+- do_test (0, i, len - i, BIG_CHAR);
+- do_test (0, i, len + i, BIG_CHAR);
+- do_test (0, i, len - buf_addr - i, BIG_CHAR);
+- do_test (0, i, len - buf_addr + i, BIG_CHAR);
+-
+- do_test (0, i, ~len - i, BIG_CHAR);
+- do_test (0, i, ~len + i, BIG_CHAR);
+- do_test (0, i, ~len - buf_addr - i, BIG_CHAR);
+- do_test (0, i, ~len - buf_addr + i, BIG_CHAR);
+-
+- do_test (0, i, -buf_addr, BIG_CHAR);
+- do_test (0, i, j - buf_addr, BIG_CHAR);
+- do_test (0, i, -buf_addr - j, BIG_CHAR);
+- }
++ for (repeats = 0; repeats < 2; ++repeats)
++ {
++ size_t align = repeats ? (getpagesize () - alignments[al_idx])
++ : alignments[al_idx];
++ align /= sizeof (CHAR);
++ for (i = 0; i < 750; ++i)
++ {
++ do_test (align, i, SIZE_MAX, BIG_CHAR);
++
++ do_test (align, i, SIZE_MAX - i, BIG_CHAR);
++ do_test (align, i, i - buf_addr, BIG_CHAR);
++ do_test (align, i, -buf_addr - i, BIG_CHAR);
++ do_test (align, i, SIZE_MAX - buf_addr - i, BIG_CHAR);
++ do_test (align, i, SIZE_MAX - buf_addr + i, BIG_CHAR);
++
++ len = 0;
++ for (j = 8 * sizeof (size_t) - 1; j; --j)
++ {
++ len |= one << j;
++ do_test (align, i, len, BIG_CHAR);
++ do_test (align, i, len - i, BIG_CHAR);
++ do_test (align, i, len + i, BIG_CHAR);
++ do_test (align, i, len - buf_addr - i, BIG_CHAR);
++ do_test (align, i, len - buf_addr + i, BIG_CHAR);
++
++ do_test (align, i, ~len - i, BIG_CHAR);
++ do_test (align, i, ~len + i, BIG_CHAR);
++ do_test (align, i, ~len - buf_addr - i, BIG_CHAR);
++ do_test (align, i, ~len - buf_addr + i, BIG_CHAR);
++
++ do_test (align, i, -buf_addr, BIG_CHAR);
++ do_test (align, i, j - buf_addr, BIG_CHAR);
++ do_test (align, i, -buf_addr - j, BIG_CHAR);
++ }
++ }
++ }
+ }
+ }
+
+diff --git a/sunrpc/netname.c b/sunrpc/netname.c
+index bf7f0b81c4..c1d1c43e50 100644
+--- a/sunrpc/netname.c
++++ b/sunrpc/netname.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+ #include <rpc/rpc.h>
+ #include <shlib-compat.h>
++#include <libc-diag.h>
+
+ #include "nsswitch.h"
+
+@@ -48,7 +49,12 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid,
+ if ((strlen (dfltdom) + OPSYS_LEN + 3 + MAXIPRINT) > (size_t) MAXNETNAMELEN)
+ return 0;
+
++ /* GCC with -Os warns that sprint might overflow while handling dfltdom,
++ however the above test does check if an overflow would happen. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wformat-overflow");
+ sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
++ DIAG_POP_NEEDS_COMMENT;
+ i = strlen (netname);
+ if (netname[i - 1] == '.')
+ netname[i - 1] = '\0';
+diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
+index 909b208578..d66f0b9c45 100644
+--- a/sysdeps/aarch64/dl-trampoline.S
++++ b/sysdeps/aarch64/dl-trampoline.S
+@@ -298,12 +298,11 @@ _dl_runtime_profile:
+ stp x2, x3, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*1]
+ stp x4, x5, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*2]
+ stp x6, x7, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*3]
+- str x8, [x29, #OFFSET_RG + DL_OFFSET_RG_X0 + 16*4]
+ stp q0, q1, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*0]
+ stp q2, q3, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*1]
+ stp q4, q5, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*2]
+ stp q6, q7, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*3]
+- str xzr, [X29, #OFFSET_RV + DL_OFFSET_RG_VPCS]
++ str xzr, [X29, #OFFSET_RV + DL_OFFSET_RV_VPCS]
+
+ /* Setup call to pltexit */
+ ldp x0, x1, [x29, #OFFSET_SAVED_CALL_X0]
+@@ -315,7 +314,6 @@ _dl_runtime_profile:
+ ldp x2, x3, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*1]
+ ldp x4, x5, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*2]
+ ldp x6, x7, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*3]
+- ldr x8, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*4]
+ ldp q0, q1, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*0]
+ ldp q2, q3, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*1]
+ ldp q4, q5, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*2]
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 050a3032de..6b256b8388 100644
--- a/sysdeps/generic/ldsodefs.h
@@ -5359,6 +6127,23 @@ index bcff909b2f..5cda9bb072 100644
res->got_ipv6 = true;
}
at[count].next = at + count + 1;
+diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
+index 2a82e53baf..d941024963 100644
+--- a/sysdeps/powerpc/mod-tlsopt-powerpc.c
++++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
+@@ -22,7 +22,11 @@ tls_get_addr_opt_test (void)
+ tls_index *tls_arg;
+ #ifdef __powerpc64__
+ register unsigned long thread_pointer __asm__ ("r13");
+- asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
++# ifdef __PCREL__
++ asm ("paddi %0,0,foo@got@tlsgd@pcrel,1" : "=b" (tls_arg));
++# else
++ asm ("addi %0,2,foo@got@tlsgd" : "=b" (tls_arg));
++# endif
+ #else
+ register unsigned long thread_pointer __asm__ ("r2");
+ asm ("bcl 20,31,1f\n1:\t"
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index a139a16532..3ceda9fdbf 100644
--- a/sysdeps/unix/sysv/linux/Makefile
@@ -6069,6 +6854,21 @@ index 0cd21ef0fa..079612e4aa 100644
+
+/* QEMU does not support set_robust_list. */
+#undef __ASSUME_SET_ROBUST_LIST
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
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
@@ -6157,6 +6957,89 @@ index 0000000000..fe6c3a0dda
+}
+
+weak_alias (__fstatat, fstatat)
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+ struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+ msgctl_arg_t *arg;
+-#endif
++# endif
++
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. msgctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
+
+ switch (cmd)
+ {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ if (buf != NULL)
+ {
+ msqid64_to_kmsqid64 (buf, &ksemid);
+ arg = &ksemid;
+ }
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ if (cmd == IPC_SET)
+ arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++# endif
++# else
+ arg = buf;
+-#endif
++# endif
+ break;
+
+ case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ arg->msg_perm.mode >>= 16;
+-#else
++# else
+ /* Old Linux kernel versions might not clear the mode padding. */
+ if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+ != sizeof (__kernel_mode_t))
+ arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+ }
+
+ return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++ return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
new file mode 100644
index 0000000000..e00e71173e
@@ -6335,6 +7218,24 @@ index d656aedcc2..4e65f337d4 100644
#define __NR_migrate_pages 238
#define __NR_mincore 232
#define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+ union semun64 arg64 = { 0 };
+ va_list ap;
+
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. semctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
++
+ /* Get the argument only if required. */
+ switch (cmd)
+ {
diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
new file mode 100644
index 0000000000..0f7c9cdc89
@@ -6480,6 +7381,89 @@ index 0000000000..0f7c9cdc89
+
+
+#endif /* _BITS_STRUCT_STAT_H */
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+ struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+ shmctl_arg_t *arg;
+-#endif
++# endif
++
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. shmctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
+
+ switch (cmd)
+ {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ if (buf != NULL)
+ {
+ shmid64_to_kshmid64 (buf, &kshmid);
+ arg = &kshmid;
+ }
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ if (cmd == IPC_SET)
+ arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++# endif
++# else
+ arg = buf;
+-#endif
++# endif
+ break;
+
+ case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ arg->shm_perm.mode >>= 16;
+-#else
++# else
+ /* Old Linux kernel versions might not clear the mode padding. */
+ if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ != sizeof (__kernel_mode_t))
+ arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+ }
+
+ return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++ return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index f965986ba8..19841d0738 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
@@ -7144,6 +8128,53 @@ index 68646ef199..7622af259c 100644
&& X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
AVX_Fast_Unaligned_Load, ))
{
+diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
+index afd450d020..51bc9344f0 100644
+--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
++++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
+@@ -308,7 +308,17 @@ L(ret_nonzero_vec_end_0):
+ setg %dl
+ leal -1(%rdx, %rdx), %eax
+ # else
+- addl %edx, %eax
++ /* Use `addq` instead of `addl` here so that even if `rax` + `rdx`
++ is negative value of the sum will be usable as a 64-bit offset
++ (negative 32-bit numbers zero-extend to a large and often
++ out-of-bounds 64-bit offsets). Note that `rax` + `rdx` >= 0 is
++ an invariant when `memcmp` is used correctly, but if the input
++ strings `rsi`/`rdi` are concurrently modified as the function
++ runs (there is a Data-Race) it is possible for `rax` + `rdx` to
++ be negative. Given that there is virtually no extra to cost
++ using `addq` instead of `addl` we may as well protect the
++ data-race case. */
++ addq %rdx, %rax
+ movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rsi, %rax), %ecx
+ movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rdi, %rax), %eax
+ subl %ecx, %eax
+diff --git a/sysdeps/x86_64/multiarch/rtld-strcpy.S b/sysdeps/x86_64/multiarch/rtld-strcpy.S
+new file mode 100644
+index 0000000000..19439c553d
+--- /dev/null
++++ b/sysdeps/x86_64/multiarch/rtld-strcpy.S
+@@ -0,0 +1,18 @@
++/* 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; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include "../strcpy.S"
diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
index fdd5afe3af..9d6c9f66ba 100644
--- a/sysdeps/x86_64/multiarch/strcmp.c
@@ -7163,6 +8194,27 @@ index fdd5afe3af..9d6c9f66ba 100644
return OPTIMIZE (evex);
if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+diff --git a/sysdeps/x86_64/multiarch/strlen-avx2.S b/sysdeps/x86_64/multiarch/strlen-avx2.S
+index 0593fb303b..b9b58ef599 100644
+--- a/sysdeps/x86_64/multiarch/strlen-avx2.S
++++ b/sysdeps/x86_64/multiarch/strlen-avx2.S
+@@ -544,14 +544,11 @@ L(return_vzeroupper):
+ L(cross_page_less_vec):
+ tzcntl %eax, %eax
+ # ifdef USE_AS_WCSLEN
+- /* NB: Multiply length by 4 to get byte count. */
+- sall $2, %esi
++ /* NB: Divide by 4 to convert from byte-count to length. */
++ shrl $2, %eax
+ # endif
+ cmpq %rax, %rsi
+ cmovb %esi, %eax
+-# ifdef USE_AS_WCSLEN
+- shrl $2, %eax
+-# endif
+ VZEROUPPER_RETURN
+ # endif
+
diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
index 4ebe4bde30..c4f8b6bbb5 100644
--- a/sysdeps/x86_64/multiarch/strncmp.c
@@ -7182,6 +8234,368 @@ index 4ebe4bde30..c4f8b6bbb5 100644
return OPTIMIZE (evex);
if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+diff --git a/time/Makefile b/time/Makefile
+index 470275b90c..2f4aa2d528 100644
+--- a/time/Makefile
++++ b/time/Makefile
+@@ -50,7 +50,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
+ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
+ tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
+ tst-settimeofday tst-itimer tst-gmtime tst-timegm \
+- tst-timespec_get tst-timespec_getres
++ tst-timespec_get tst-timespec_getres tst-strftime4
+
+ tests-time64 := \
+ tst-adjtime-time64 \
+@@ -65,6 +65,7 @@ tests-time64 := \
+ tst-itimer-time64 \
+ tst-mktime4-time64 \
+ tst-settimeofday-time64 \
++ tst-strftime4-time64 \
+ tst-timegm-time64 \
+ tst-timespec_get-time64 \
+ tst-timespec_getres-time64 \
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ time with the right value, and use its UTC offset.
+
+ Heuristic: probe the adjacent timestamps in both directions,
+- looking for the desired isdst. This should work for all real
+- time zone histories in the tz database. */
++ looking for the desired isdst. If none is found within a
++ reasonable duration bound, assume a one-hour DST difference.
++ This should work for all real time zone histories in the tz
++ database. */
++
++ /* +1 if we wanted standard time but got DST, -1 if the reverse. */
++ int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+
+ /* Distance between probes when looking for a DST boundary. In
+ tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ periods when probing. */
+ int stride = 601200;
+
+- /* The longest period of DST in tzdata2003a is 536454000 seconds
+- (e.g., America/Jujuy starting 1946-10-01 01:00). The longest
+- period of non-DST is much longer, but it makes no real sense
+- to search for more than a year of non-DST, so use the DST
+- max. */
+- int duration_max = 536454000;
++ /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++ which the DST (or adjacent DST) difference is not one hour,
++ is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++ seconds, starting 1965-10-31 00:00 in a switch from
++ double-daylight time (-05) to standard time (-07), and
++ continuing to 1980-04-27 02:00 in a switch from standard time
++ (-07) to daylight time (-06). */
++ int duration_max = 457243209;
+
+ /* Search in both directions, so the maximum distance is half
+ the duration; add the stride to avoid off-by-1 problems. */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ }
+ }
+
++ /* No unusual DST offset was found nearby. Assume one-hour DST. */
++ t += 60 * 60 * dst_difference;
++ if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++ goto offset_found;
++
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+diff --git a/time/strftime_l.c b/time/strftime_l.c
+index 75554fee7c..4d7c4ea828 100644
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -159,6 +159,10 @@ extern char *tzname[];
+ #ifdef _LIBC
+ # define tzname __tzname
+ # define tzset __tzset
++
++# define time_t __time64_t
++# define __gmtime_r(t, tp) __gmtime64_r (t, tp)
++# define mktime(tp) __mktime64 (tp)
+ #endif
+
+ #if !HAVE_TM_GMTOFF
+diff --git a/time/strptime_l.c b/time/strptime_l.c
+index a3c5681fc2..f927448204 100644
+--- a/time/strptime_l.c
++++ b/time/strptime_l.c
+@@ -30,8 +30,10 @@
+ #ifdef _LIBC
+ # define HAVE_LOCALTIME_R 0
+ # include "../locale/localeinfo.h"
+-#endif
+
++# define time_t __time64_t
++# define __localtime_r(t, tp) __localtime64_r (t, tp)
++#endif
+
+ #if ! HAVE_LOCALTIME_R && ! defined localtime_r
+ # ifdef _LIBC
+diff --git a/time/tst-strftime4-time64.c b/time/tst-strftime4-time64.c
+new file mode 100644
+index 0000000000..4d47ee7d79
+--- /dev/null
++++ b/time/tst-strftime4-time64.c
+@@ -0,0 +1 @@
++#include "tst-strftime4.c"
+diff --git a/time/tst-strftime4.c b/time/tst-strftime4.c
+new file mode 100644
+index 0000000000..659716d0fa
+--- /dev/null
++++ b/time/tst-strftime4.c
+@@ -0,0 +1,52 @@
++/* Test strftime and strptime after 2038-01-19 03:14:07 UTC (bug 30053).
++ 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 <time.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++ TEST_VERIFY_EXIT (setenv ("TZ", "UTC0", 1) == 0);
++ tzset ();
++ if (sizeof (time_t) > 4)
++ {
++ time_t wrap = (time_t) 2147483648LL;
++ char buf[80];
++ struct tm *tm = gmtime (&wrap);
++ TEST_VERIFY_EXIT (tm != NULL);
++ TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%s", tm) > 0);
++ puts (buf);
++ TEST_VERIFY (strcmp (buf, "2147483648") == 0);
++
++ struct tm tm2;
++ char *p = strptime (buf, "%s", &tm2);
++ TEST_VERIFY_EXIT (p != NULL && *p == '\0');
++ time_t t = mktime (&tm2);
++ printf ("%lld\n", (long long) t);
++ TEST_VERIFY (t == wrap);
++ }
++ else
++ FAIL_UNSUPPORTED ("32-bit time_t");
++ return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/time/tzfile.c b/time/tzfile.c
+index dd75848ba9..8bba4e5b8d 100644
+--- a/time/tzfile.c
++++ b/time/tzfile.c
+@@ -32,7 +32,7 @@
+ int __use_tzfile;
+ static dev_t tzfile_dev;
+ static ino64_t tzfile_ino;
+-static time_t tzfile_mtime;
++static __time64_t tzfile_mtime;
+
+ struct ttinfo
+ {
+@@ -61,6 +61,10 @@ static size_t num_leaps;
+ static struct leap *leaps;
+ static char *tzspec;
+
++/* Used to restore the daylight variable during time conversion, as if
++ tzset had been called. */
++static int daylight_saved;
++
+ #include <endian.h>
+ #include <byteswap.h>
+
+@@ -438,36 +442,35 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
+ if (__tzname[1] == NULL)
+ __tzname[1] = __tzname[0];
+
++ daylight_saved = 0;
+ if (num_transitions == 0)
+ /* Use the first rule (which should also be the only one). */
+ rule_stdoff = rule_dstoff = types[0].offset;
+ else
+ {
+- int stdoff_set = 0, dstoff_set = 0;
+- rule_stdoff = rule_dstoff = 0;
++ rule_stdoff = 0;
++
++ /* Search for the last rule with a standard time offset. This
++ will be used for the global timezone variable. */
+ i = num_transitions - 1;
+ do
+- {
+- if (!stdoff_set && !types[type_idxs[i]].isdst)
+- {
+- stdoff_set = 1;
+- rule_stdoff = types[type_idxs[i]].offset;
+- }
+- else if (!dstoff_set && types[type_idxs[i]].isdst)
+- {
+- dstoff_set = 1;
+- rule_dstoff = types[type_idxs[i]].offset;
+- }
+- if (stdoff_set && dstoff_set)
++ if (!types[type_idxs[i]].isdst)
++ {
++ rule_stdoff = types[type_idxs[i]].offset;
+ break;
+- }
++ }
++ else
++ daylight_saved = 1;
+ while (i-- > 0);
+
+- if (!dstoff_set)
+- rule_dstoff = rule_stdoff;
++ /* Keep searching to see if there is a DST rule. This
++ information will be used to set the global daylight
++ variable. */
++ while (i-- > 0 && !daylight_saved)
++ daylight_saved = types[type_idxs[i]].isdst;
+ }
+
+- __daylight = rule_stdoff != rule_dstoff;
++ __daylight = daylight_saved;
+ __timezone = -rule_stdoff;
+
+ done:
+@@ -731,7 +734,7 @@ __tzfile_compute (__time64_t timer, int use_localtime,
+ }
+
+ struct ttinfo *info = &types[i];
+- __daylight = rule_stdoff != rule_dstoff;
++ __daylight = daylight_saved;
+ __timezone = -rule_stdoff;
+
+ if (__tzname[0] == NULL)
+diff --git a/timezone/Makefile b/timezone/Makefile
+index a789c22d26..5002de39ad 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -23,7 +23,7 @@ subdir := timezone
+ include ../Makeconfig
+
+ others := zdump zic
+-tests := test-tz tst-timezone tst-tzset tst-bz28707
++tests := test-tz tst-timezone tst-tzset tst-bz28707 tst-bz29951
+
+ generated-dirs += testdata
+
+@@ -86,11 +86,13 @@ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
+ Europe/London)
+ $(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4)
+ $(objpfx)tst-bz28707.out: $(testdata)/XT5
++$(objpfx)tst-bz29951.out: $(testdata)/XT6
+
+ test-tz-ENV = TZDIR=$(testdata)
+ tst-timezone-ENV = TZDIR=$(testdata)
+ tst-tzset-ENV = TZDIR=$(testdata)
+ tst-bz28707-ENV = TZDIR=$(testdata)
++tst-bz29951-ENV = TZDIR=$(testdata)
+
+ # Note this must come second in the deps list for $(built-program-cmd) to work.
+ zic-deps = $(objpfx)zic $(leapseconds) yearistype
+diff --git a/timezone/testdata/XT6 b/timezone/testdata/XT6
+new file mode 100644
+index 0000000000..07b393bb7d
+Binary files /dev/null and b/timezone/testdata/XT6 differ
+diff --git a/timezone/tst-bz29951.c b/timezone/tst-bz29951.c
+new file mode 100644
+index 0000000000..abd334683b
+--- /dev/null
++++ b/timezone/tst-bz29951.c
+@@ -0,0 +1,68 @@
++/* Check that daylight is set if the last DST transition did not change offset.
++ 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 <errno.h>
++#include <stdlib.h>
++#include <support/check.h>
++#include <time.h>
++
++/* Set the specified time zone with error checking. */
++static void
++set_timezone (const char *name)
++{
++ TEST_VERIFY (setenv ("TZ", name, 1) == 0);
++ errno = 0;
++ tzset ();
++ TEST_COMPARE (errno, 0);
++}
++
++static int
++do_test (void)
++{
++ /* Test zone based on tz-2022g version of Africa/Tripoli. The last
++ DST transition coincided with a change in the standard time
++ offset, effectively making it a no-op.
++
++ Africa/Tripoli Thu Oct 24 23:59:59 2013 UT
++ = Fri Oct 25 01:59:59 2013 CEST isdst=1 gmtoff=7200
++ Africa/Tripoli Fri Oct 25 00:00:00 2013 UT
++ = Fri Oct 25 02:00:00 2013 EET isdst=0 gmtoff=7200
++ */
++ set_timezone ("XT6");
++ TEST_VERIFY (daylight != 0);
++ TEST_COMPARE (timezone, -7200);
++
++ /* Check that localtime re-initializes the two variables. */
++ daylight = timezone = 17;
++ time_t t = 844034401;
++ struct tm *tm = localtime (&t);
++ TEST_VERIFY (daylight != 0);
++ TEST_COMPARE (timezone, -7200);
++ TEST_COMPARE (tm->tm_year, 96);
++ TEST_COMPARE (tm->tm_mon, 8);
++ TEST_COMPARE (tm->tm_mday, 29);
++ TEST_COMPARE (tm->tm_hour, 23);
++ TEST_COMPARE (tm->tm_min, 0);
++ TEST_COMPARE (tm->tm_sec, 1);
++ TEST_COMPARE (tm->tm_gmtoff, 3600);
++ TEST_COMPARE (tm->tm_isdst, 0);
++
++ return 0;
++}
++
++#include <support/test-driver.c>
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index e6b9e8743a..4af102a3f6 100644
--- a/wcsmbs/Makefile
1
0
commit 19755cbff66a3397df4c8c44c98fc54e2cb4feaa
Author: Juergen Daubert <jue(a)jue.li>
Date: Mon Feb 27 12:54:14 2023 +0100
glibc: sync with upstream 2.36 branch
diff --git a/glibc/.signature b/glibc/.signature
index 34cc2da2..095b1e23 100644
--- a/glibc/.signature
+++ b/glibc/.signature
@@ -1,11 +1,10 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqpxv+Tno0pi4fzLop4M/Yw5pQpyH18DBILa9FBTapI9ZgqqUFYeoxqLTmZZ64IQtAMTl4BQBF25iRWragSnydQ4=
-SHA256 (Pkgfile) = 98ee9d177491b6af01069caa33480889a8e4cabfeefbfcbb605bad6cfb4ee305
+RWRJc1FUaeVeqgTOHuB8/rBhnErpd+XzLcgljGrIWBSuVymSw6v83cRQ7NSr3F6QYDxqq9zmgoYUbHELj7frHWYGfynV7eoSTgk=
+SHA256 (Pkgfile) = bccffd9bba06c7ebc3f1f293d6d590ac62394e1dcefe1461e6537ea8474a4d1c
SHA256 (.footprint) = 9eff4b9e8478995dd0aceacfe9301a250827c8b27cb1d4605c696ac55eec873c
SHA256 (glibc-2.36.tar.xz) = 1c959fea240906226062cb4b1e7ebce71a9f0e3c0836c09e7e3423d434fcfe75
SHA256 (linux-5.15.55.tar.xz) = 1ef6bd508b6c3af3bef2d5b337e4477254dba284c79e329aa38f9763ae3bfdcc
-SHA256 (glibc-2.36-3.patch) = 0733042e85defe47019d3f8a31a21015997c78137a876ce97d2e0e64c79e173f
-SHA256 (glibc-2.35-make-4.4-MAKEFLAGS.patch) = 7cfc3e52d840f5fb292e251209731ff83753cc5bf0056df3190ee4cb88ed3278
+SHA256 (glibc-2.36-4.patch) = c562f1a0b80b6ba8694df8a90fa7a3ff20604b6bf486c2ab76d02a62f3e77844
SHA256 (hosts) = 5c02b256c105f1d4a12fb738d71c1bab9eb126533074d7a0c8a14b92670c9431
SHA256 (resolv.conf) = 72ccb58768a72a771ec37142bc361a18478a07ec9de6e925a20760794389bf51
SHA256 (nsswitch.conf) = 859b8984e5e90aff3cce8f9779996ae4033b280d2122840e9411e2f44a1c2e61
diff --git a/glibc/Pkgfile b/glibc/Pkgfile
index a00ca881..af2eac96 100644
--- a/glibc/Pkgfile
+++ b/glibc/Pkgfile
@@ -4,13 +4,12 @@
name=glibc
version=2.36
-release=3
+release=4
_kernel_version=5.15.55
source=(https://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz
https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_kernel_version.tar.xz
- glibc-$version-3.patch
- glibc-2.35-make-4.4-MAKEFLAGS.patch
+ glibc-$version-4.patch
hosts resolv.conf nsswitch.conf host.conf ld.so.conf
locale-gen locale.gen.in)
@@ -21,8 +20,7 @@ build() {
make -C $SRC/linux-$_kernel_version INSTALL_HDR_PATH=$PKG/usr headers_install
chown root:root $PKG/usr
- patch -p1 -d $SRC/$name-${version:0:4} -i $SRC/$name-$version-3.patch
- patch -p1 -d $SRC/$name-${version:0:4} -i $SRC/glibc-2.35-make-4.4-MAKEFLAGS.patch
+ patch -p1 -d $SRC/$name-${version:0:4} -i $SRC/$name-$version-4.patch
mkdir $SRC/build
cd $SRC/build
diff --git a/glibc/glibc-2.35-make-4.4-MAKEFLAGS.patch b/glibc/glibc-2.35-make-4.4-MAKEFLAGS.patch
deleted file mode 100644
index 51fbe5f5..00000000
--- a/glibc/glibc-2.35-make-4.4-MAKEFLAGS.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d7ed98add14f75041499ac189696c9bd3d757fe
-https://bugs.gentoo.org/869263
-
-From 2d7ed98add14f75041499ac189696c9bd3d757fe Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyich(a)gmail.com>
-Date: Tue, 13 Sep 2022 13:39:13 -0400
-Subject: [PATCH] Makerules: fix MAKEFLAGS assignment for upcoming make-4.4
- [BZ# 29564]
-
-make-4.4 will add long flags to MAKEFLAGS variable:
-
- * WARNING: Backward-incompatibility!
- Previously only simple (one-letter) options were added to the MAKEFLAGS
- variable that was visible while parsing makefiles. Now, all options
- are available in MAKEFLAGS.
-
-This causes locale builds to fail when long options are used:
-
- $ make --shuffle
- ...
- make -C localedata install-locales
- make: invalid shuffle mode: '1662724426r'
-
-The change fixes it by passing eash option via whitespace and dashes.
-That way option is appended to both single-word form and whitespace
-separated form.
-
-While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering
-out --long-options. Otherwise options like --shuffle flag enable silent
-mode unintentionally. $(silent-make) variable consolidates the checks.
-
-Resolves: BZ# 29564
-
-CC: Paul Smith <psmith(a)gnu.org>
-CC: Siddhesh Poyarekar <siddhesh(a)gotplt.org>
-Signed-off-by: Sergei Trofimovich <slyich(a)gmail.com>
-Reviewed-by: Siddhesh Poyarekar <siddhesh(a)sourceware.org>
---- a/Makeconfig
-+++ b/Makeconfig
-@@ -43,6 +43,22 @@ else
- $(error objdir must be defined by the build-directory Makefile)
- endif
-
-+# Did we request 'make -s' run? "yes" or "no".
-+# Starting from make-4.4 MAKEFLAGS now contains long
-+# options like '--shuffle'. To detect presence of 's'
-+# we pick first word with short options. Long options
-+# are guaranteed to come after whitespace. We use '-'
-+# prefix to always have a word before long options
-+# even if no short options were passed.
-+# Typical MAKEFLAGS values to watch for:
-+# "rs --shuffle=42" (silent)
-+# " --shuffle" (not silent)
-+ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
-+silent-make := no
-+else
-+silent-make := yes
-+endif
-+
- # Root of the sysdeps tree.
- sysdep_dir := $(..)sysdeps
- export sysdep_dir := $(sysdep_dir)
-@@ -917,7 +933,7 @@ endif
- # umpteen zillion filenames along with it (we use `...' instead)
- # but we don't want this echoing done when the user has said
- # he doesn't want to see commands echoed by using -s.
--ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
-+ifeq ($(silent-make),yes) # if -s
- +cmdecho := echo >/dev/null
- else # not -s
- +cmdecho := echo
---- a/Makerules
-+++ b/Makerules
-@@ -794,7 +794,7 @@ endif
- # Maximize efficiency by minimizing the number of rules.
- .SUFFIXES: # Clear the suffix list. We don't use suffix rules.
- # Don't define any builtin rules.
--MAKEFLAGS := $(MAKEFLAGS)r
-+MAKEFLAGS := $(MAKEFLAGS) -r
-
- # Generic rule for making directories.
- %/:
-@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
- .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
-
- # Use the verbose option of ar and tar when not running silently.
--ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
-+ifeq ($(silent-make),no) # if not -s
- verbose := v
- else # -s
- verbose :=
---- a/elf/rtld-Rules
-+++ b/elf/rtld-Rules
-@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
- mv -f $@T $@
-
- # Use the verbose option of ar and tar when not running silently.
--ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
-+ifeq ($(silent-make),no) # if not -s
- verbose := v
- else # -s
- verbose :=
diff --git a/glibc/glibc-2.36-3.patch b/glibc/glibc-2.36-4.patch
similarity index 85%
rename from glibc/glibc-2.36-3.patch
rename to glibc/glibc-2.36-4.patch
index 864fdafd..e0722ac5 100644
--- a/glibc/glibc-2.36-3.patch
+++ b/glibc/glibc-2.36-4.patch
@@ -1,8 +1,75 @@
+diff --git a/Makeconfig b/Makeconfig
+index ba70321af1..9dd058e04b 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -43,6 +43,22 @@ else
+ $(error objdir must be defined by the build-directory Makefile)
+ endif
+
++# Did we request 'make -s' run? "yes" or "no".
++# Starting from make-4.4 MAKEFLAGS now contains long
++# options like '--shuffle'. To detect presence of 's'
++# we pick first word with short options. Long options
++# are guaranteed to come after whitespace. We use '-'
++# prefix to always have a word before long options
++# even if no short options were passed.
++# Typical MAKEFLAGS values to watch for:
++# "rs --shuffle=42" (silent)
++# " --shuffle" (not silent)
++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),)
++silent-make := no
++else
++silent-make := yes
++endif
++
+ # Root of the sysdeps tree.
+ sysdep_dir := $(..)sysdeps
+ export sysdep_dir := $(sysdep_dir)
+@@ -868,7 +884,7 @@ endif
+ # Use 64 bit time_t support for installed programs
+ installed-modules = nonlib nscd lddlibc4 ldconfig locale_programs \
+ iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \
+- libutil libpcprofile libSegFault
++ libutil libpcprofile libSegFault libnsl
+ +extra-time-flags = $(if $(filter $(installed-modules),\
+ $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64)
+
+@@ -917,7 +933,7 @@ endif
+ # umpteen zillion filenames along with it (we use `...' instead)
+ # but we don't want this echoing done when the user has said
+ # he doesn't want to see commands echoed by using -s.
+-ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s
++ifeq ($(silent-make),yes) # if -s
+ +cmdecho := echo >/dev/null
+ else # not -s
+ +cmdecho := echo
+diff --git a/Makerules b/Makerules
+index d1e139d03c..09c0cf8357 100644
+--- a/Makerules
++++ b/Makerules
+@@ -794,7 +794,7 @@ endif
+ # Maximize efficiency by minimizing the number of rules.
+ .SUFFIXES: # Clear the suffix list. We don't use suffix rules.
+ # Don't define any builtin rules.
+-MAKEFLAGS := $(MAKEFLAGS)r
++MAKEFLAGS := $(MAKEFLAGS) -r
+
+ # Generic rule for making directories.
+ %/:
+@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r
+ .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
+
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
++ifeq ($(silent-make),no) # if not -s
+ verbose := v
+ else # -s
+ verbose :=
diff --git a/NEWS b/NEWS
-index f61e521fc8..e92d547e2c 100644
+index f61e521fc8..aff6951c1d 100644
--- a/NEWS
+++ b/NEWS
-@@ -5,6 +5,48 @@ See the end for copying conditions.
+@@ -5,6 +5,57 @@ See the end for copying conditions.
Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
using `glibc' in the "product" field.
@@ -27,7 +94,10 @@ index f61e521fc8..e92d547e2c 100644
+ [12154] Do not fail DNS resolution for CNAMEs which are not host names
+ [24816] Fix tst-nss-files-hosts-long on single-stack hosts
+ [28846] CMSG_NXTHDR may trigger -Wstrict-overflow warning
++ [29864] libc: __libc_start_main() should obtain program headers
++ address (_dl_phdr) from the auxv, not the ELF header.
+ [29305] Conserve NSS buffer space during DNS packet parsing
++ [29402] nscd: nscd: No such file or directory
+ [29415] nscd: Fix netlink cache invalidation if epoll is used
+ [28937] New DSO dependency sorter does not put new map first if in a cycle
+ [29446] _dlopen now ignores dl_caller argument in static mode
@@ -39,6 +109,8 @@ index f61e521fc8..e92d547e2c 100644
+ [29528] elf: Call __libc_early_init for reused namespaces
+ [29537] libc: [2.34 regression]: Alignment issue on m68k when using
+ [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are
++ [29576] build: librtld.os: in function `_dl_start_profile':
++ (.text+0x9444): undefined reference to `strcpy'
+ [29583] Use 64-bit interfaces in gconv_parseconfdir
+ [29600] Do not completely clear reused namespace in dlmopen
+ [29607] nscd repeatably crashes calling __strlen_avx2 when hosts cache is
@@ -47,6 +119,10 @@ index f61e521fc8..e92d547e2c 100644
+ [29657] libc: Incorrect struct stat for 64-bit time on linux/generic
+ platforms
+ [29730] broken y2038 support in fstatat on MIPS N64
++ [29771] Restore IPC_64 support in sysvipc *ctl functions
++ [29776] elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10
++ [29951] time: Set daylight to 1 for matching DST/offset change
++ [30053] time: strftime %s returns -1 after 2038 on 32 bits systems
+
Version 2.36
@@ -114,6 +190,75 @@ index 2b99dea33b..aac8c49b00 100644
return __cmsg;
}
#endif /* Use `extern inline'. */
+diff --git a/csu/libc-start.c b/csu/libc-start.c
+index 543560f36c..bfeee6d851 100644
+--- a/csu/libc-start.c
++++ b/csu/libc-start.c
+@@ -262,28 +262,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
+ }
+ # endif
+ _dl_aux_init (auxvec);
+- if (GL(dl_phdr) == NULL)
+ # endif
+- {
+- /* Starting from binutils-2.23, the linker will define the
+- magic symbol __ehdr_start to point to our own ELF header
+- if it is visible in a segment that also includes the phdrs.
+- So we can set up _dl_phdr and _dl_phnum even without any
+- information from auxv. */
+-
+- extern const ElfW(Ehdr) __ehdr_start
+-# if BUILD_PIE_DEFAULT
+- __attribute__ ((visibility ("hidden")));
+-# else
+- __attribute__ ((weak, visibility ("hidden")));
+- if (&__ehdr_start != NULL)
+-# endif
+- {
+- assert (__ehdr_start.e_phentsize == sizeof *GL(dl_phdr));
+- GL(dl_phdr) = (const void *) &__ehdr_start + __ehdr_start.e_phoff;
+- GL(dl_phnum) = __ehdr_start.e_phnum;
+- }
+- }
+
+ __tunables_init (__environ);
+
+diff --git a/csu/libc-tls.c b/csu/libc-tls.c
+index 0a216c5502..7fdf7cd7a8 100644
+--- a/csu/libc-tls.c
++++ b/csu/libc-tls.c
+@@ -118,19 +118,18 @@ __libc_setup_tls (void)
+ __tls_pre_init_tp ();
+
+ /* Look through the TLS segment if there is any. */
+- if (_dl_phdr != NULL)
+- for (phdr = _dl_phdr; phdr < &_dl_phdr[_dl_phnum]; ++phdr)
+- if (phdr->p_type == PT_TLS)
+- {
+- /* Remember the values we need. */
+- memsz = phdr->p_memsz;
+- filesz = phdr->p_filesz;
+- initimage = (void *) phdr->p_vaddr + main_map->l_addr;
+- align = phdr->p_align;
+- if (phdr->p_align > max_align)
+- max_align = phdr->p_align;
+- break;
+- }
++ for (phdr = _dl_phdr; phdr < &_dl_phdr[_dl_phnum]; ++phdr)
++ if (phdr->p_type == PT_TLS)
++ {
++ /* Remember the values we need. */
++ memsz = phdr->p_memsz;
++ filesz = phdr->p_filesz;
++ initimage = (void *) phdr->p_vaddr + main_map->l_addr;
++ align = phdr->p_align;
++ if (phdr->p_align > max_align)
++ max_align = phdr->p_align;
++ break;
++ }
+
+ /* Calculate the size of the static TLS surplus, with 0 auditors. */
+ _dl_tls_static_surplus_init (0);
diff --git a/dlfcn/dlopen.c b/dlfcn/dlopen.c
index 2696dde4b1..9b07b4e132 100644
--- a/dlfcn/dlopen.c
@@ -128,7 +273,7 @@ index 2696dde4b1..9b07b4e132 100644
void *
diff --git a/elf/Makefile b/elf/Makefile
-index fd77d0c7c8..72178d33ff 100644
+index fd77d0c7c8..48788fcdb8 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -374,6 +374,8 @@ tests += \
@@ -148,7 +293,15 @@ index fd77d0c7c8..72178d33ff 100644
tst-dlopenfail \
tst-dlopenfail-2 \
tst-dlopenrpath \
-@@ -765,6 +768,8 @@ modules-names += \
+@@ -631,6 +634,7 @@ ifeq ($(run-built-tests),yes)
+ tests-special += \
+ $(objpfx)noload-mem.out \
+ $(objpfx)tst-ldconfig-X.out \
++ $(objpfx)tst-ldconfig-p.out \
+ $(objpfx)tst-leaks1-mem.out \
+ $(objpfx)tst-rtld-help.out \
+ # tests-special
+@@ -765,6 +769,8 @@ modules-names += \
tst-alignmod3 \
tst-array2dep \
tst-array5dep \
@@ -157,7 +310,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-audit11mod1 \
tst-audit11mod2 \
tst-audit12mod1 \
-@@ -798,6 +803,7 @@ modules-names += \
+@@ -798,6 +804,7 @@ modules-names += \
tst-auditmanymod7 \
tst-auditmanymod8 \
tst-auditmanymod9 \
@@ -165,7 +318,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-auditmod1 \
tst-auditmod9a \
tst-auditmod9b \
-@@ -834,6 +840,8 @@ modules-names += \
+@@ -834,6 +841,8 @@ modules-names += \
tst-dlmopen1mod \
tst-dlmopen-dlerror-mod \
tst-dlmopen-gethostbyname-mod \
@@ -174,7 +327,7 @@ index fd77d0c7c8..72178d33ff 100644
tst-dlopenfaillinkmod \
tst-dlopenfailmod1 \
tst-dlopenfailmod2 \
-@@ -990,23 +998,8 @@ modules-names += tst-gnu2-tls1mod
+@@ -990,23 +999,8 @@ modules-names += tst-gnu2-tls1mod
$(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
tst-gnu2-tls1mod.so-no-z-defs = yes
CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
@@ -199,7 +352,19 @@ index fd77d0c7c8..72178d33ff 100644
ifeq (yes,$(have-protected-data))
modules-names += tst-protected1moda tst-protected1modb
tests += tst-protected1a tst-protected1b
-@@ -2967,3 +2960,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
+@@ -2410,6 +2404,11 @@ $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
+ '$(run-program-env)' > $@; \
+ $(evaluate-test)
+
++$(objpfx)tst-ldconfig-p.out : tst-ldconfig-p.sh $(objpfx)ldconfig
++ $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \
++ '$(run-program-env)' > $@; \
++ $(evaluate-test)
++
+ # Test static linking of all the libraries we can possibly link
+ # together. Note that in some configurations this may be less than the
+ # complete list of libraries we build but we try to maxmimize this list.
+@@ -2967,3 +2966,25 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
grep -q '^Fatal glibc error: Cannot allocate TLS block$$' $@ \
&& grep -q '^status: 127$$' $@; \
$(evaluate-test)
@@ -412,6 +577,70 @@ index 96638d7ed1..3e2a6a584e 100644
}
#endif /* HAVE_TUNABLES. */
+diff --git a/elf/dl-support.c b/elf/dl-support.c
+index 4af0b5b2ce..f45b630ba5 100644
+--- a/elf/dl-support.c
++++ b/elf/dl-support.c
+@@ -255,6 +255,25 @@ _dl_aux_init (ElfW(auxv_t) *av)
+ for (int i = 0; i < array_length (auxv_values); ++i)
+ auxv_values[i] = 0;
+ _dl_parse_auxv (av, auxv_values);
++
++ _dl_phdr = (void*) auxv_values[AT_PHDR];
++ _dl_phnum = auxv_values[AT_PHNUM];
++
++ if (_dl_phdr == NULL)
++ {
++ /* Starting from binutils-2.23, the linker will define the
++ magic symbol __ehdr_start to point to our own ELF header
++ if it is visible in a segment that also includes the phdrs.
++ So we can set up _dl_phdr and _dl_phnum even without any
++ information from auxv. */
++
++ extern const ElfW(Ehdr) __ehdr_start attribute_hidden;
++ assert (__ehdr_start.e_phentsize == sizeof *GL(dl_phdr));
++ _dl_phdr = (const void *) &__ehdr_start + __ehdr_start.e_phoff;
++ _dl_phnum = __ehdr_start.e_phnum;
++ }
++
++ assert (_dl_phdr != NULL);
+ }
+ #endif
+
+@@ -323,20 +342,19 @@ _dl_non_dynamic_init (void)
+ if (_dl_platform != NULL)
+ _dl_platformlen = strlen (_dl_platform);
+
+- if (_dl_phdr != NULL)
+- for (const ElfW(Phdr) *ph = _dl_phdr; ph < &_dl_phdr[_dl_phnum]; ++ph)
+- switch (ph->p_type)
+- {
+- /* Check if the stack is nonexecutable. */
+- case PT_GNU_STACK:
+- _dl_stack_flags = ph->p_flags;
+- break;
+-
+- case PT_GNU_RELRO:
+- _dl_main_map.l_relro_addr = ph->p_vaddr;
+- _dl_main_map.l_relro_size = ph->p_memsz;
+- break;
+- }
++ for (const ElfW(Phdr) *ph = _dl_phdr; ph < &_dl_phdr[_dl_phnum]; ++ph)
++ switch (ph->p_type)
++ {
++ /* Check if the stack is nonexecutable. */
++ case PT_GNU_STACK:
++ _dl_stack_flags = ph->p_flags;
++ break;
++
++ case PT_GNU_RELRO:
++ _dl_main_map.l_relro_addr = ph->p_vaddr;
++ _dl_main_map.l_relro_size = ph->p_memsz;
++ break;
++ }
+
+ call_function_static_weak (_dl_find_object_init);
+
diff --git a/elf/dso-sort-tests-1.def b/elf/dso-sort-tests-1.def
index 5f7f18ef27..4bf9052db1 100644
--- a/elf/dso-sort-tests-1.def
@@ -445,6 +674,19 @@ index 02a1b3f52f..014393f3cc 100644
/* LoongArch specific dynamic relocations */
#define R_LARCH_NONE 0
+diff --git a/elf/rtld-Rules b/elf/rtld-Rules
+index ca00dd1fe2..3c5e273f2b 100644
+--- a/elf/rtld-Rules
++++ b/elf/rtld-Rules
+@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
+ mv -f $@T $@
+
+ # Use the verbose option of ar and tar when not running silently.
+-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
++ifeq ($(silent-make),no) # if not -s
+ verbose := v
+ else # -s
+ verbose :=
diff --git a/elf/rtld.c b/elf/rtld.c
index cbbaf4a331..3e771a93d8 100644
--- a/elf/rtld.c
@@ -621,6 +863,89 @@ index 0000000000..70c71fe19c
+}
+
+#include <support/test-driver.c>
+diff --git a/elf/tst-ldconfig-p.sh b/elf/tst-ldconfig-p.sh
+new file mode 100644
+index 0000000000..ec937bf4ec
+--- /dev/null
++++ b/elf/tst-ldconfig-p.sh
+@@ -0,0 +1,77 @@
++#!/bin/sh
++# Test that ldconfig -p prints something useful.
++# 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/>.
++
++# Check that the newly built ldconfig -p can dump the system
++# /etc/ld.so.cache file. This should always work even if the ABIs are
++# not compatible, except in a cross-endian build (that presumably
++# involves emulation when running ldconfig).
++
++common_objpfx=$1
++test_wrapper_env=$2
++run_program_env=$3
++
++if ! test -r /etc/ld.so.cache; then
++ echo "warning: /etc/ld.so.cache does not exist, test skipped"
++ exit 77
++fi
++
++testout="${common_objpfx}elf/tst-ldconfig-p.out"
++# Truncate file.
++: > "$testout"
++
++${test_wrapper_env} \
++${run_program_env} \
++${common_objpfx}elf/ldconfig -p \
++ $testroot/lib >>"$testout" 2>>"$testout"
++status=$?
++echo "info: ldconfig exit status: $status" >>"$testout"
++
++errors=0
++case $status in
++ (0)
++ if head -n 1 "$testout" | \
++ grep -q "libs found in cache \`/etc/ld.so.cache'\$" ; then
++ echo "info: initial string found" >>"$testout"
++ else
++ echo "error: initial string not found" >>"$testout"
++ errors=1
++ fi
++ if grep -q "^ libc\.so\..* => " "$testout"; then
++ echo "info: libc.so.* string found" >>"$testout"
++ else
++ echo "error: libc.so.* string not found" >>"$testout"
++ errors=1
++ fi
++ ;;
++ (1)
++ if head -n 1 "$testout" | \
++ grep -q ": Cache file has wrong endianness\.$" ; then
++ echo "info: cache file has wrong endianess" >> "$testout"
++ else
++ echo "error: unexpected ldconfig error message" >> "$testout"
++ errors=1
++ fi
++ ;;
++ (*)
++ echo "error: unexpected exit status" >> "$testout"
++ errors=1
++ ;;
++esac
++
++exit $errors
diff --git a/iconv/gconv_parseconfdir.h b/iconv/gconv_parseconfdir.h
index debb96b322..b72933b526 100644
--- a/iconv/gconv_parseconfdir.h
@@ -813,6 +1138,113 @@ index 3590b6f496..4dbbac3800 100644
+
# endif /* _RESOLV_H_ && !_ISOMAC */
#endif
+diff --git a/locale/weight.h b/locale/weight.h
+index 8be2d220f8..4a4d5aa6b2 100644
+--- a/locale/weight.h
++++ b/locale/weight.h
+@@ -27,7 +27,14 @@ findidx (const int32_t *table,
+ const unsigned char *extra,
+ const unsigned char **cpp, size_t len)
+ {
++ /* With GCC 8 when compiling with -Os the compiler warns that
++ seq1.back_us and seq2.back_us might be used uninitialized.
++ This uninitialized use is impossible for the same reason
++ as described in comments in locale/weightwc.h. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ int32_t i = table[*(*cpp)++];
++ DIAG_POP_NEEDS_COMMENT;
+ const unsigned char *cp;
+ const unsigned char *usrc;
+
+diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
+index fd30dd3114..916d2b6f12 100644
+--- a/misc/bits/syslog.h
++++ b/misc/bits/syslog.h
+@@ -24,6 +24,20 @@
+ extern void __syslog_chk (int __pri, int __flag, const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
++#ifdef __USE_MISC
++extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
++ __gnuc_va_list __ap)
++ __attribute__ ((__format__ (__printf__, 3, 0)));
++#endif
++
++#include <bits/floatn.h>
++#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
++# include <bits/syslog-ldbl.h>
++#endif
++
++/* The following functions must be used only after applying all asm
++ redirections, e.g. long double asm redirections. */
++
+ #ifdef __va_arg_pack
+ __fortify_function void
+ syslog (int __pri, const char *__fmt, ...)
+@@ -37,10 +51,6 @@ syslog (int __pri, const char *__fmt, ...)
+
+
+ #ifdef __USE_MISC
+-extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
+- __gnuc_va_list __ap)
+- __attribute__ ((__format__ (__printf__, 3, 0)));
+-
+ __fortify_function void
+ vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
+ {
+diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
+index f525f67547..294e633335 100644
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -152,6 +152,7 @@
+ # define __glibc_objsize(__o) __bos (__o)
+ #endif
+
++#if __USE_FORTIFY_LEVEL > 0
+ /* Compile time conditions to choose between the regular, _chk and _chk_warn
+ variants. These conditions should get evaluated to constant and optimized
+ away. */
+@@ -187,7 +188,7 @@
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
+- : __ ## f ## _chk (__VA_ARGS__, __osz))) \
++ : __ ## f ## _chk (__VA_ARGS__, __osz)))
+
+ /* Fortify function f, where object size argument passed to f is the number of
+ elements and not total size. */
+@@ -197,7 +198,8 @@
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
+- : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
++ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
++#endif
+
+ #if __GNUC_PREREQ (4,3)
+ # define __warnattr(msg) __attribute__((__warning__ (msg)))
+diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
+index d933fea104..3888153ed2 100644
+--- a/misc/sys/syslog.h
++++ b/misc/sys/syslog.h
+@@ -205,11 +205,11 @@ extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
+ /* Define some macros helping to catch buffer overflows. */
+ #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+ # include <bits/syslog.h>
+-#endif
+-
+-#include <bits/floatn.h>
+-#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+-# include <bits/syslog-ldbl.h>
++#else
++# include <bits/floatn.h>
++# if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
++# include <bits/syslog-ldbl.h>
++# endif
+ #endif
+
+ __END_DECLS
diff --git a/misc/syslog.c b/misc/syslog.c
index 554089bfc4..f67d4b58a4 100644
--- a/misc/syslog.c
@@ -1140,6 +1572,55 @@ index e550d15796..3560b518a2 100644
return 0;
}
+diff --git a/nis/nis_call.c b/nis/nis_call.c
+index 90187e30b1..5b9dd50151 100644
+--- a/nis/nis_call.c
++++ b/nis/nis_call.c
+@@ -574,7 +574,7 @@ static struct nis_server_cache
+ unsigned int size;
+ unsigned int server_used;
+ unsigned int current_ep;
+- __time64_t expires;
++ time_t expires;
+ char name[];
+ } *nis_server_cache[16];
+ static time_t nis_cold_start_mtime;
+@@ -583,7 +583,7 @@ __libc_lock_define_initialized (static, nis_server_cache_lock)
+ static directory_obj *
+ nis_server_cache_search (const_nis_name name, int search_parent,
+ unsigned int *server_used, unsigned int *current_ep,
+- struct __timespec64 *now)
++ struct timespec *now)
+ {
+ directory_obj *ret = NULL;
+ int i;
+@@ -641,7 +641,7 @@ nis_server_cache_search (const_nis_name name, int search_parent,
+ static void
+ nis_server_cache_add (const_nis_name name, int search_parent,
+ directory_obj *dir, unsigned int server_used,
+- unsigned int current_ep, struct __timespec64 *now)
++ unsigned int current_ep, struct timespec *now)
+ {
+ struct nis_server_cache **loc;
+ struct nis_server_cache *new;
+@@ -707,7 +707,7 @@ __nisfind_server (const_nis_name name, int search_parent,
+ nis_error result = NIS_SUCCESS;
+ nis_error status;
+ directory_obj *obj;
+- struct __timespec64 ts;
++ struct timespec ts;
+ unsigned int server_used = ~0;
+ unsigned int current_ep = ~0;
+
+@@ -717,7 +717,7 @@ __nisfind_server (const_nis_name name, int search_parent,
+ if (*dir != NULL)
+ return NIS_SUCCESS;
+
+- __clock_gettime64 (CLOCK_REALTIME, &ts);
++ clock_gettime (CLOCK_REALTIME, &ts);
+
+ if ((flags & NO_CACHE) == 0)
+ *dir = nis_server_cache_search (name, search_parent, &server_used,
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 51e793199f..e0baed170b 100644
--- a/nscd/aicache.c
@@ -1180,6 +1661,32 @@ index 61d1674eb4..531d2e83df 100644
}
# endif
else
+diff --git a/nscd/nscd.h b/nscd/nscd.h
+index 368091aef8..f15321585b 100644
+--- a/nscd/nscd.h
++++ b/nscd/nscd.h
+@@ -65,7 +65,7 @@ typedef enum
+ struct traced_file
+ {
+ /* Tracks the last modified time of the traced file. */
+- time_t mtime;
++ __time64_t mtime;
+ /* Support multiple registered files per database. */
+ struct traced_file *next;
+ int call_res_init;
+diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
+index 9becb62033..31c64275f0 100644
+--- a/nscd/nscd_gethst_r.c
++++ b/nscd/nscd_gethst_r.c
+@@ -112,7 +112,7 @@ __nscd_get_nl_timestamp (void)
+ if (map == NULL
+ || (map != NO_MAPPING
+ && map->head->nscd_certainly_running == 0
+- && map->head->timestamp + MAPPING_TIMEOUT < time_now ()))
++ && map->head->timestamp + MAPPING_TIMEOUT < time64_now ()))
+ map = __nscd_get_mapping (GETFDHST, "hosts", &__hst_map_handle.mapped);
+
+ if (map == NO_MAPPING)
diff --git a/nss/getent.c b/nss/getent.c
index 8178b4b470..d2d2524b0c 100644
--- a/nss/getent.c
@@ -5011,6 +5518,18 @@ index 0000000000..68c96d3c9d
+}
+
+#include <support/test-driver.c>
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index f7b25c1981..3d49c4941a 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
+@@ -171,6 +171,7 @@ tests := \
+ test-a64l \
+ test-at_quick_exit-race \
+ test-atexit-race \
++ test-atexit-recursive \
+ test-bz22786 \
+ test-canon \
+ test-canon2 \
diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
index e417ef624d..960a38f295 100644
--- a/stdlib/arc4random.c
@@ -5024,6 +5543,31 @@ index e417ef624d..960a38f295 100644
int fd;
if (n == 0)
+diff --git a/stdlib/exit.c b/stdlib/exit.c
+index bc46109f3e..dc12e212bc 100644
+--- a/stdlib/exit.c
++++ b/stdlib/exit.c
+@@ -53,7 +53,10 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
+ exit (). */
+ while (true)
+ {
+- struct exit_function_list *cur = *listp;
++ struct exit_function_list *cur;
++
++ restart:
++ cur = *listp;
+
+ if (cur == NULL)
+ {
+@@ -118,7 +121,7 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
+ if (__glibc_unlikely (new_exitfn_called != __new_exitfn_called))
+ /* The last exit function, or another thread, has registered
+ more exit functions. Start the loop over. */
+- continue;
++ goto restart;
+ }
+
+ *listp = cur->next;
diff --git a/stdlib/longlong.h b/stdlib/longlong.h
index 9b89469ac2..d8f76a43b5 100644
--- a/stdlib/longlong.h
@@ -5047,6 +5591,230 @@ index 9b89469ac2..d8f76a43b5 100644
#if defined (__M32R__) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
/* The cmp clears the condition bit. */ \
+diff --git a/stdlib/test-atexit-recursive.c b/stdlib/test-atexit-recursive.c
+new file mode 100644
+index 0000000000..0596b9763b
+--- /dev/null
++++ b/stdlib/test-atexit-recursive.c
+@@ -0,0 +1,75 @@
++/* Support file for atexit/exit, etc. race tests (BZ #27749).
++ 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/>. */
++
++/* Check that atexit handler registed from another handler still called. */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <support/check.h>
++#include <support/xunistd.h>
++#include <sys/wait.h>
++#include <unistd.h>
++
++static void
++atexit_cb (void)
++{
++}
++
++static void
++atexit_last (void)
++{
++ _exit (1);
++}
++
++static void
++atexit_recursive (void)
++{
++ atexit (&atexit_cb);
++ atexit (&atexit_last);
++}
++
++_Noreturn static void
++test_and_exit (int count)
++{
++ for (int i = 0; i < count; ++i)
++ atexit (&atexit_cb);
++ atexit (&atexit_recursive);
++ exit (0);
++}
++
++static int
++do_test (void)
++{
++ for (int i = 0; i < 100; ++i)
++ if (xfork () == 0)
++ test_and_exit (i);
++
++ for (int i = 0; i < 100; ++i)
++ {
++ int status;
++ xwaitpid (0, &status, 0);
++ if (!WIFEXITED (status))
++ FAIL_EXIT1 ("Failed iterations %d", i);
++ TEST_COMPARE (WEXITSTATUS (status), 1);
++ }
++
++ return 0;
++}
++
++#define TEST_FUNCTION do_test
++#include <support/test-driver.c>
+diff --git a/string/test-strnlen.c b/string/test-strnlen.c
+index 4a9375112a..5cbaf4b734 100644
+--- a/string/test-strnlen.c
++++ b/string/test-strnlen.c
+@@ -73,7 +73,7 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char)
+ {
+ size_t i;
+
+- align &= 63;
++ align &= (getpagesize () / sizeof (CHAR) - 1);
+ if ((align + len) * sizeof (CHAR) >= page_size)
+ return;
+
+@@ -90,38 +90,50 @@ do_test (size_t align, size_t len, size_t maxlen, int max_char)
+ static void
+ do_overflow_tests (void)
+ {
+- size_t i, j, len;
++ size_t i, j, al_idx, repeats, len;
+ const size_t one = 1;
+ uintptr_t buf_addr = (uintptr_t) buf1;
++ const size_t alignments[] = { 0, 1, 7, 9, 31, 33, 63, 65, 95, 97, 127, 129 };
+
+- for (i = 0; i < 750; ++i)
++ for (al_idx = 0; al_idx < sizeof (alignments) / sizeof (alignments[0]);
++ al_idx++)
+ {
+- do_test (1, i, SIZE_MAX, BIG_CHAR);
+-
+- do_test (0, i, SIZE_MAX - i, BIG_CHAR);
+- do_test (0, i, i - buf_addr, BIG_CHAR);
+- do_test (0, i, -buf_addr - i, BIG_CHAR);
+- do_test (0, i, SIZE_MAX - buf_addr - i, BIG_CHAR);
+- do_test (0, i, SIZE_MAX - buf_addr + i, BIG_CHAR);
+-
+- len = 0;
+- for (j = 8 * sizeof(size_t) - 1; j ; --j)
+- {
+- len |= one << j;
+- do_test (0, i, len - i, BIG_CHAR);
+- do_test (0, i, len + i, BIG_CHAR);
+- do_test (0, i, len - buf_addr - i, BIG_CHAR);
+- do_test (0, i, len - buf_addr + i, BIG_CHAR);
+-
+- do_test (0, i, ~len - i, BIG_CHAR);
+- do_test (0, i, ~len + i, BIG_CHAR);
+- do_test (0, i, ~len - buf_addr - i, BIG_CHAR);
+- do_test (0, i, ~len - buf_addr + i, BIG_CHAR);
+-
+- do_test (0, i, -buf_addr, BIG_CHAR);
+- do_test (0, i, j - buf_addr, BIG_CHAR);
+- do_test (0, i, -buf_addr - j, BIG_CHAR);
+- }
++ for (repeats = 0; repeats < 2; ++repeats)
++ {
++ size_t align = repeats ? (getpagesize () - alignments[al_idx])
++ : alignments[al_idx];
++ align /= sizeof (CHAR);
++ for (i = 0; i < 750; ++i)
++ {
++ do_test (align, i, SIZE_MAX, BIG_CHAR);
++
++ do_test (align, i, SIZE_MAX - i, BIG_CHAR);
++ do_test (align, i, i - buf_addr, BIG_CHAR);
++ do_test (align, i, -buf_addr - i, BIG_CHAR);
++ do_test (align, i, SIZE_MAX - buf_addr - i, BIG_CHAR);
++ do_test (align, i, SIZE_MAX - buf_addr + i, BIG_CHAR);
++
++ len = 0;
++ for (j = 8 * sizeof (size_t) - 1; j; --j)
++ {
++ len |= one << j;
++ do_test (align, i, len, BIG_CHAR);
++ do_test (align, i, len - i, BIG_CHAR);
++ do_test (align, i, len + i, BIG_CHAR);
++ do_test (align, i, len - buf_addr - i, BIG_CHAR);
++ do_test (align, i, len - buf_addr + i, BIG_CHAR);
++
++ do_test (align, i, ~len - i, BIG_CHAR);
++ do_test (align, i, ~len + i, BIG_CHAR);
++ do_test (align, i, ~len - buf_addr - i, BIG_CHAR);
++ do_test (align, i, ~len - buf_addr + i, BIG_CHAR);
++
++ do_test (align, i, -buf_addr, BIG_CHAR);
++ do_test (align, i, j - buf_addr, BIG_CHAR);
++ do_test (align, i, -buf_addr - j, BIG_CHAR);
++ }
++ }
++ }
+ }
+ }
+
+diff --git a/sunrpc/netname.c b/sunrpc/netname.c
+index bf7f0b81c4..c1d1c43e50 100644
+--- a/sunrpc/netname.c
++++ b/sunrpc/netname.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+ #include <rpc/rpc.h>
+ #include <shlib-compat.h>
++#include <libc-diag.h>
+
+ #include "nsswitch.h"
+
+@@ -48,7 +49,12 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid,
+ if ((strlen (dfltdom) + OPSYS_LEN + 3 + MAXIPRINT) > (size_t) MAXNETNAMELEN)
+ return 0;
+
++ /* GCC with -Os warns that sprint might overflow while handling dfltdom,
++ however the above test does check if an overflow would happen. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wformat-overflow");
+ sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
++ DIAG_POP_NEEDS_COMMENT;
+ i = strlen (netname);
+ if (netname[i - 1] == '.')
+ netname[i - 1] = '\0';
+diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
+index 909b208578..d66f0b9c45 100644
+--- a/sysdeps/aarch64/dl-trampoline.S
++++ b/sysdeps/aarch64/dl-trampoline.S
+@@ -298,12 +298,11 @@ _dl_runtime_profile:
+ stp x2, x3, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*1]
+ stp x4, x5, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*2]
+ stp x6, x7, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*3]
+- str x8, [x29, #OFFSET_RG + DL_OFFSET_RG_X0 + 16*4]
+ stp q0, q1, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*0]
+ stp q2, q3, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*1]
+ stp q4, q5, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*2]
+ stp q6, q7, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*3]
+- str xzr, [X29, #OFFSET_RV + DL_OFFSET_RG_VPCS]
++ str xzr, [X29, #OFFSET_RV + DL_OFFSET_RV_VPCS]
+
+ /* Setup call to pltexit */
+ ldp x0, x1, [x29, #OFFSET_SAVED_CALL_X0]
+@@ -315,7 +314,6 @@ _dl_runtime_profile:
+ ldp x2, x3, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*1]
+ ldp x4, x5, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*2]
+ ldp x6, x7, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*3]
+- ldr x8, [x29, #OFFSET_RV + DL_OFFSET_RV_X0 + 16*4]
+ ldp q0, q1, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*0]
+ ldp q2, q3, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*1]
+ ldp q4, q5, [x29, #OFFSET_RV + DL_OFFSET_RV_V0 + 32*2]
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 050a3032de..6b256b8388 100644
--- a/sysdeps/generic/ldsodefs.h
@@ -5359,6 +6127,23 @@ index bcff909b2f..5cda9bb072 100644
res->got_ipv6 = true;
}
at[count].next = at + count + 1;
+diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
+index 2a82e53baf..d941024963 100644
+--- a/sysdeps/powerpc/mod-tlsopt-powerpc.c
++++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
+@@ -22,7 +22,11 @@ tls_get_addr_opt_test (void)
+ tls_index *tls_arg;
+ #ifdef __powerpc64__
+ register unsigned long thread_pointer __asm__ ("r13");
+- asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
++# ifdef __PCREL__
++ asm ("paddi %0,0,foo@got@tlsgd@pcrel,1" : "=b" (tls_arg));
++# else
++ asm ("addi %0,2,foo@got@tlsgd" : "=b" (tls_arg));
++# endif
+ #else
+ register unsigned long thread_pointer __asm__ ("r2");
+ asm ("bcl 20,31,1f\n1:\t"
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index a139a16532..3ceda9fdbf 100644
--- a/sysdeps/unix/sysv/linux/Makefile
@@ -6069,6 +6854,21 @@ index 0cd21ef0fa..079612e4aa 100644
+
+/* QEMU does not support set_robust_list. */
+#undef __ASSUME_SET_ROBUST_LIST
+diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h
+index 87893a6757..2f50c31a8e 100644
+--- a/sysdeps/unix/sysv/linux/ipc_priv.h
++++ b/sysdeps/unix/sysv/linux/ipc_priv.h
+@@ -63,4 +63,10 @@ struct __old_ipc_perm
+ # define __IPC_TIME64 0
+ #endif
+
++#if __IPC_TIME64 || defined __ASSUME_SYSVIPC_BROKEN_MODE_T
++# define IPC_CTL_NEED_TRANSLATION 1
++#else
++# define IPC_CTL_NEED_TRANSLATION 0
++#endif
++
+ #include <ipc_ops.h>
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
@@ -6157,6 +6957,89 @@ index 0000000000..fe6c3a0dda
+}
+
+weak_alias (__fstatat, fstatat)
+diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
+index e824ebb095..2072205252 100644
+--- a/sysdeps/unix/sysv/linux/msgctl.c
++++ b/sysdeps/unix/sysv/linux/msgctl.c
+@@ -85,11 +85,19 @@ msgctl_syscall (int msqid, int cmd, msgctl_arg_t *buf)
+ int
+ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+ struct kernel_msqid64_ds ksemid, *arg = NULL;
+-#else
++# else
+ msgctl_arg_t *arg;
+-#endif
++# endif
++
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. msgctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
+
+ switch (cmd)
+ {
+@@ -101,19 +109,19 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ if (buf != NULL)
+ {
+ msqid64_to_kmsqid64 (buf, &ksemid);
+ arg = &ksemid;
+ }
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ if (cmd == IPC_SET)
+ arg->msg_perm.mode *= 0x10000U;
+-# endif
+-#else
++# endif
++# else
+ arg = buf;
+-#endif
++# endif
+ break;
+
+ case IPC_INFO:
+@@ -137,21 +145,25 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ arg->msg_perm.mode >>= 16;
+-#else
++# else
+ /* Old Linux kernel versions might not clear the mode padding. */
+ if (sizeof ((struct msqid_ds){0}.msg_perm.mode)
+ != sizeof (__kernel_mode_t))
+ arg->msg_perm.mode &= 0xFFFF;
+-#endif
++# endif
+
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ kmsqid64_to_msqid64 (arg, buf);
+-#endif
++# endif
+ }
+
+ return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++ return msgctl_syscall (msqid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__msgctl64)
diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h
new file mode 100644
index 0000000000..e00e71173e
@@ -6335,6 +7218,24 @@ index d656aedcc2..4e65f337d4 100644
#define __NR_migrate_pages 238
#define __NR_mincore 232
#define __NR_mkdirat 34
+diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
+index 77a8130c18..3458b018bc 100644
+--- a/sysdeps/unix/sysv/linux/semctl.c
++++ b/sysdeps/unix/sysv/linux/semctl.c
+@@ -140,6 +140,13 @@ __semctl64 (int semid, int semnum, int cmd, ...)
+ union semun64 arg64 = { 0 };
+ va_list ap;
+
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. semctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
++
+ /* Get the argument only if required. */
+ switch (cmd)
+ {
diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h
new file mode 100644
index 0000000000..0f7c9cdc89
@@ -6480,6 +7381,89 @@ index 0000000000..0f7c9cdc89
+
+
+#endif /* _BITS_STRUCT_STAT_H */
+diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
+index ea38935497..f00817a6f6 100644
+--- a/sysdeps/unix/sysv/linux/shmctl.c
++++ b/sysdeps/unix/sysv/linux/shmctl.c
+@@ -85,11 +85,19 @@ shmctl_syscall (int shmid, int cmd, shmctl_arg_t *buf)
+ int
+ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ {
+-#if __IPC_TIME64
++#if IPC_CTL_NEED_TRANSLATION
++# if __IPC_TIME64
+ struct kernel_shmid64_ds kshmid, *arg = NULL;
+-#else
++# else
+ shmctl_arg_t *arg;
+-#endif
++# endif
++
++ /* Some applications pass the __IPC_64 flag in cmd, to invoke
++ previously unsupported commands back when there was no EINVAL
++ error checking in glibc. Mask the flag for the switch statements
++ below. shmctl_syscall adds back the __IPC_64 flag for the actual
++ system call. */
++ cmd &= ~__IPC_64;
+
+ switch (cmd)
+ {
+@@ -103,19 +111,19 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ if (buf != NULL)
+ {
+ shmid64_to_kshmid64 (buf, &kshmid);
+ arg = &kshmid;
+ }
+-# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ if (cmd == IPC_SET)
+ arg->shm_perm.mode *= 0x10000U;
+-# endif
+-#else
++# endif
++# else
+ arg = buf;
+-#endif
++# endif
+ break;
+
+ case IPC_INFO:
+@@ -140,21 +148,25 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+-#ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
++# ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
+ arg->shm_perm.mode >>= 16;
+-#else
++# else
+ /* Old Linux kernel versions might not clear the mode padding. */
+ if (sizeof ((struct shmid_ds){0}.shm_perm.mode)
+ != sizeof (__kernel_mode_t))
+ arg->shm_perm.mode &= 0xFFFF;
+-#endif
++# endif
+
+-#if __IPC_TIME64
++# if __IPC_TIME64
+ kshmid64_to_shmid64 (arg, buf);
+-#endif
++# endif
+ }
+
+ return ret;
++
++#else /* !IPC_CTL_NEED_TRANSLATION */
++ return shmctl_syscall (shmid, cmd, buf);
++#endif
+ }
+ #if __TIMESIZE != 64
+ libc_hidden_def (__shmctl64)
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index f965986ba8..19841d0738 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
@@ -7144,6 +8128,53 @@ index 68646ef199..7622af259c 100644
&& X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
AVX_Fast_Unaligned_Load, ))
{
+diff --git a/sysdeps/x86_64/multiarch/memcmp-sse2.S b/sysdeps/x86_64/multiarch/memcmp-sse2.S
+index afd450d020..51bc9344f0 100644
+--- a/sysdeps/x86_64/multiarch/memcmp-sse2.S
++++ b/sysdeps/x86_64/multiarch/memcmp-sse2.S
+@@ -308,7 +308,17 @@ L(ret_nonzero_vec_end_0):
+ setg %dl
+ leal -1(%rdx, %rdx), %eax
+ # else
+- addl %edx, %eax
++ /* Use `addq` instead of `addl` here so that even if `rax` + `rdx`
++ is negative value of the sum will be usable as a 64-bit offset
++ (negative 32-bit numbers zero-extend to a large and often
++ out-of-bounds 64-bit offsets). Note that `rax` + `rdx` >= 0 is
++ an invariant when `memcmp` is used correctly, but if the input
++ strings `rsi`/`rdi` are concurrently modified as the function
++ runs (there is a Data-Race) it is possible for `rax` + `rdx` to
++ be negative. Given that there is virtually no extra to cost
++ using `addq` instead of `addl` we may as well protect the
++ data-race case. */
++ addq %rdx, %rax
+ movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rsi, %rax), %ecx
+ movzbl (VEC_SIZE * -1 + SIZE_OFFSET)(%rdi, %rax), %eax
+ subl %ecx, %eax
+diff --git a/sysdeps/x86_64/multiarch/rtld-strcpy.S b/sysdeps/x86_64/multiarch/rtld-strcpy.S
+new file mode 100644
+index 0000000000..19439c553d
+--- /dev/null
++++ b/sysdeps/x86_64/multiarch/rtld-strcpy.S
+@@ -0,0 +1,18 @@
++/* 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; if not, see
++ <https://www.gnu.org/licenses/>. */
++
++#include "../strcpy.S"
diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c
index fdd5afe3af..9d6c9f66ba 100644
--- a/sysdeps/x86_64/multiarch/strcmp.c
@@ -7163,6 +8194,27 @@ index fdd5afe3af..9d6c9f66ba 100644
return OPTIMIZE (evex);
if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+diff --git a/sysdeps/x86_64/multiarch/strlen-avx2.S b/sysdeps/x86_64/multiarch/strlen-avx2.S
+index 0593fb303b..b9b58ef599 100644
+--- a/sysdeps/x86_64/multiarch/strlen-avx2.S
++++ b/sysdeps/x86_64/multiarch/strlen-avx2.S
+@@ -544,14 +544,11 @@ L(return_vzeroupper):
+ L(cross_page_less_vec):
+ tzcntl %eax, %eax
+ # ifdef USE_AS_WCSLEN
+- /* NB: Multiply length by 4 to get byte count. */
+- sall $2, %esi
++ /* NB: Divide by 4 to convert from byte-count to length. */
++ shrl $2, %eax
+ # endif
+ cmpq %rax, %rsi
+ cmovb %esi, %eax
+-# ifdef USE_AS_WCSLEN
+- shrl $2, %eax
+-# endif
+ VZEROUPPER_RETURN
+ # endif
+
diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c
index 4ebe4bde30..c4f8b6bbb5 100644
--- a/sysdeps/x86_64/multiarch/strncmp.c
@@ -7182,6 +8234,368 @@ index 4ebe4bde30..c4f8b6bbb5 100644
return OPTIMIZE (evex);
if (CPU_FEATURE_USABLE_P (cpu_features, RTM))
+diff --git a/time/Makefile b/time/Makefile
+index 470275b90c..2f4aa2d528 100644
+--- a/time/Makefile
++++ b/time/Makefile
+@@ -50,7 +50,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
+ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
+ tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
+ tst-settimeofday tst-itimer tst-gmtime tst-timegm \
+- tst-timespec_get tst-timespec_getres
++ tst-timespec_get tst-timespec_getres tst-strftime4
+
+ tests-time64 := \
+ tst-adjtime-time64 \
+@@ -65,6 +65,7 @@ tests-time64 := \
+ tst-itimer-time64 \
+ tst-mktime4-time64 \
+ tst-settimeofday-time64 \
++ tst-strftime4-time64 \
+ tst-timegm-time64 \
+ tst-timespec_get-time64 \
+ tst-timespec_getres-time64 \
+diff --git a/time/mktime.c b/time/mktime.c
+index 494c89bf54..e9a6006710 100644
+--- a/time/mktime.c
++++ b/time/mktime.c
+@@ -429,8 +429,13 @@ __mktime_internal (struct tm *tp,
+ time with the right value, and use its UTC offset.
+
+ Heuristic: probe the adjacent timestamps in both directions,
+- looking for the desired isdst. This should work for all real
+- time zone histories in the tz database. */
++ looking for the desired isdst. If none is found within a
++ reasonable duration bound, assume a one-hour DST difference.
++ This should work for all real time zone histories in the tz
++ database. */
++
++ /* +1 if we wanted standard time but got DST, -1 if the reverse. */
++ int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+
+ /* Distance between probes when looking for a DST boundary. In
+ tzdata2003a, the shortest period of DST is 601200 seconds
+@@ -441,12 +446,14 @@ __mktime_internal (struct tm *tp,
+ periods when probing. */
+ int stride = 601200;
+
+- /* The longest period of DST in tzdata2003a is 536454000 seconds
+- (e.g., America/Jujuy starting 1946-10-01 01:00). The longest
+- period of non-DST is much longer, but it makes no real sense
+- to search for more than a year of non-DST, so use the DST
+- max. */
+- int duration_max = 536454000;
++ /* In TZDB 2021e, the longest period of DST (or of non-DST), in
++ which the DST (or adjacent DST) difference is not one hour,
++ is 457243209 seconds: e.g., America/Cambridge_Bay with leap
++ seconds, starting 1965-10-31 00:00 in a switch from
++ double-daylight time (-05) to standard time (-07), and
++ continuing to 1980-04-27 02:00 in a switch from standard time
++ (-07) to daylight time (-06). */
++ int duration_max = 457243209;
+
+ /* Search in both directions, so the maximum distance is half
+ the duration; add the stride to avoid off-by-1 problems. */
+@@ -483,6 +490,11 @@ __mktime_internal (struct tm *tp,
+ }
+ }
+
++ /* No unusual DST offset was found nearby. Assume one-hour DST. */
++ t += 60 * 60 * dst_difference;
++ if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
++ goto offset_found;
++
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+diff --git a/time/strftime_l.c b/time/strftime_l.c
+index 75554fee7c..4d7c4ea828 100644
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -159,6 +159,10 @@ extern char *tzname[];
+ #ifdef _LIBC
+ # define tzname __tzname
+ # define tzset __tzset
++
++# define time_t __time64_t
++# define __gmtime_r(t, tp) __gmtime64_r (t, tp)
++# define mktime(tp) __mktime64 (tp)
+ #endif
+
+ #if !HAVE_TM_GMTOFF
+diff --git a/time/strptime_l.c b/time/strptime_l.c
+index a3c5681fc2..f927448204 100644
+--- a/time/strptime_l.c
++++ b/time/strptime_l.c
+@@ -30,8 +30,10 @@
+ #ifdef _LIBC
+ # define HAVE_LOCALTIME_R 0
+ # include "../locale/localeinfo.h"
+-#endif
+
++# define time_t __time64_t
++# define __localtime_r(t, tp) __localtime64_r (t, tp)
++#endif
+
+ #if ! HAVE_LOCALTIME_R && ! defined localtime_r
+ # ifdef _LIBC
+diff --git a/time/tst-strftime4-time64.c b/time/tst-strftime4-time64.c
+new file mode 100644
+index 0000000000..4d47ee7d79
+--- /dev/null
++++ b/time/tst-strftime4-time64.c
+@@ -0,0 +1 @@
++#include "tst-strftime4.c"
+diff --git a/time/tst-strftime4.c b/time/tst-strftime4.c
+new file mode 100644
+index 0000000000..659716d0fa
+--- /dev/null
++++ b/time/tst-strftime4.c
+@@ -0,0 +1,52 @@
++/* Test strftime and strptime after 2038-01-19 03:14:07 UTC (bug 30053).
++ 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 <time.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <support/check.h>
++
++static int
++do_test (void)
++{
++ TEST_VERIFY_EXIT (setenv ("TZ", "UTC0", 1) == 0);
++ tzset ();
++ if (sizeof (time_t) > 4)
++ {
++ time_t wrap = (time_t) 2147483648LL;
++ char buf[80];
++ struct tm *tm = gmtime (&wrap);
++ TEST_VERIFY_EXIT (tm != NULL);
++ TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%s", tm) > 0);
++ puts (buf);
++ TEST_VERIFY (strcmp (buf, "2147483648") == 0);
++
++ struct tm tm2;
++ char *p = strptime (buf, "%s", &tm2);
++ TEST_VERIFY_EXIT (p != NULL && *p == '\0');
++ time_t t = mktime (&tm2);
++ printf ("%lld\n", (long long) t);
++ TEST_VERIFY (t == wrap);
++ }
++ else
++ FAIL_UNSUPPORTED ("32-bit time_t");
++ return 0;
++}
++
++#include <support/test-driver.c>
+diff --git a/time/tzfile.c b/time/tzfile.c
+index dd75848ba9..8bba4e5b8d 100644
+--- a/time/tzfile.c
++++ b/time/tzfile.c
+@@ -32,7 +32,7 @@
+ int __use_tzfile;
+ static dev_t tzfile_dev;
+ static ino64_t tzfile_ino;
+-static time_t tzfile_mtime;
++static __time64_t tzfile_mtime;
+
+ struct ttinfo
+ {
+@@ -61,6 +61,10 @@ static size_t num_leaps;
+ static struct leap *leaps;
+ static char *tzspec;
+
++/* Used to restore the daylight variable during time conversion, as if
++ tzset had been called. */
++static int daylight_saved;
++
+ #include <endian.h>
+ #include <byteswap.h>
+
+@@ -438,36 +442,35 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
+ if (__tzname[1] == NULL)
+ __tzname[1] = __tzname[0];
+
++ daylight_saved = 0;
+ if (num_transitions == 0)
+ /* Use the first rule (which should also be the only one). */
+ rule_stdoff = rule_dstoff = types[0].offset;
+ else
+ {
+- int stdoff_set = 0, dstoff_set = 0;
+- rule_stdoff = rule_dstoff = 0;
++ rule_stdoff = 0;
++
++ /* Search for the last rule with a standard time offset. This
++ will be used for the global timezone variable. */
+ i = num_transitions - 1;
+ do
+- {
+- if (!stdoff_set && !types[type_idxs[i]].isdst)
+- {
+- stdoff_set = 1;
+- rule_stdoff = types[type_idxs[i]].offset;
+- }
+- else if (!dstoff_set && types[type_idxs[i]].isdst)
+- {
+- dstoff_set = 1;
+- rule_dstoff = types[type_idxs[i]].offset;
+- }
+- if (stdoff_set && dstoff_set)
++ if (!types[type_idxs[i]].isdst)
++ {
++ rule_stdoff = types[type_idxs[i]].offset;
+ break;
+- }
++ }
++ else
++ daylight_saved = 1;
+ while (i-- > 0);
+
+- if (!dstoff_set)
+- rule_dstoff = rule_stdoff;
++ /* Keep searching to see if there is a DST rule. This
++ information will be used to set the global daylight
++ variable. */
++ while (i-- > 0 && !daylight_saved)
++ daylight_saved = types[type_idxs[i]].isdst;
+ }
+
+- __daylight = rule_stdoff != rule_dstoff;
++ __daylight = daylight_saved;
+ __timezone = -rule_stdoff;
+
+ done:
+@@ -731,7 +734,7 @@ __tzfile_compute (__time64_t timer, int use_localtime,
+ }
+
+ struct ttinfo *info = &types[i];
+- __daylight = rule_stdoff != rule_dstoff;
++ __daylight = daylight_saved;
+ __timezone = -rule_stdoff;
+
+ if (__tzname[0] == NULL)
+diff --git a/timezone/Makefile b/timezone/Makefile
+index a789c22d26..5002de39ad 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -23,7 +23,7 @@ subdir := timezone
+ include ../Makeconfig
+
+ others := zdump zic
+-tests := test-tz tst-timezone tst-tzset tst-bz28707
++tests := test-tz tst-timezone tst-tzset tst-bz28707 tst-bz29951
+
+ generated-dirs += testdata
+
+@@ -86,11 +86,13 @@ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
+ Europe/London)
+ $(objpfx)tst-tzset.out: $(addprefix $(testdata)/XT, 1 2 3 4)
+ $(objpfx)tst-bz28707.out: $(testdata)/XT5
++$(objpfx)tst-bz29951.out: $(testdata)/XT6
+
+ test-tz-ENV = TZDIR=$(testdata)
+ tst-timezone-ENV = TZDIR=$(testdata)
+ tst-tzset-ENV = TZDIR=$(testdata)
+ tst-bz28707-ENV = TZDIR=$(testdata)
++tst-bz29951-ENV = TZDIR=$(testdata)
+
+ # Note this must come second in the deps list for $(built-program-cmd) to work.
+ zic-deps = $(objpfx)zic $(leapseconds) yearistype
+diff --git a/timezone/testdata/XT6 b/timezone/testdata/XT6
+new file mode 100644
+index 0000000000..07b393bb7d
+Binary files /dev/null and b/timezone/testdata/XT6 differ
+diff --git a/timezone/tst-bz29951.c b/timezone/tst-bz29951.c
+new file mode 100644
+index 0000000000..abd334683b
+--- /dev/null
++++ b/timezone/tst-bz29951.c
+@@ -0,0 +1,68 @@
++/* Check that daylight is set if the last DST transition did not change offset.
++ 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 <errno.h>
++#include <stdlib.h>
++#include <support/check.h>
++#include <time.h>
++
++/* Set the specified time zone with error checking. */
++static void
++set_timezone (const char *name)
++{
++ TEST_VERIFY (setenv ("TZ", name, 1) == 0);
++ errno = 0;
++ tzset ();
++ TEST_COMPARE (errno, 0);
++}
++
++static int
++do_test (void)
++{
++ /* Test zone based on tz-2022g version of Africa/Tripoli. The last
++ DST transition coincided with a change in the standard time
++ offset, effectively making it a no-op.
++
++ Africa/Tripoli Thu Oct 24 23:59:59 2013 UT
++ = Fri Oct 25 01:59:59 2013 CEST isdst=1 gmtoff=7200
++ Africa/Tripoli Fri Oct 25 00:00:00 2013 UT
++ = Fri Oct 25 02:00:00 2013 EET isdst=0 gmtoff=7200
++ */
++ set_timezone ("XT6");
++ TEST_VERIFY (daylight != 0);
++ TEST_COMPARE (timezone, -7200);
++
++ /* Check that localtime re-initializes the two variables. */
++ daylight = timezone = 17;
++ time_t t = 844034401;
++ struct tm *tm = localtime (&t);
++ TEST_VERIFY (daylight != 0);
++ TEST_COMPARE (timezone, -7200);
++ TEST_COMPARE (tm->tm_year, 96);
++ TEST_COMPARE (tm->tm_mon, 8);
++ TEST_COMPARE (tm->tm_mday, 29);
++ TEST_COMPARE (tm->tm_hour, 23);
++ TEST_COMPARE (tm->tm_min, 0);
++ TEST_COMPARE (tm->tm_sec, 1);
++ TEST_COMPARE (tm->tm_gmtoff, 3600);
++ TEST_COMPARE (tm->tm_isdst, 0);
++
++ return 0;
++}
++
++#include <support/test-driver.c>
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index e6b9e8743a..4af102a3f6 100644
--- a/wcsmbs/Makefile
1
0
commit 202f9152e1c5a1e6517fabbca07ca167e1c642c4
Author: Juergen Daubert <jue(a)jue.li>
Date: Mon Feb 27 12:52:05 2023 +0100
make: update to 4.4.1
diff --git a/make/.signature b/make/.signature
index 101f6b62..3ac71893 100644
--- a/make/.signature
+++ b/make/.signature
@@ -1,6 +1,5 @@
untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqoXDuWrY15k8jV1y1IY3Ub0XxrB+N87lSe5pXwzy47rX8pA5LUsLLuRF0sa2H44QCWhiKcQSS05fnQAxp2BEsQk=
-SHA256 (Pkgfile) = 1ef61e26be47b2a6bc292ce327f90817d5f0c23689bf6a598a55e0dc37287200
+RWRJc1FUaeVeqklV2AsW+orzajnuTKYh+z/ufq8CoqmQXgsn3+XyDpidcqPZkZEy0DaMKPGhGHJVuijOddDybz0hgEXqU943vQo=
+SHA256 (Pkgfile) = b6c1ae4087ba3a764c28df3340e23e60169684a571c1fb181fd97ce48412fd95
SHA256 (.footprint) = b6da4d8d5f42687f723b196c608941bfe0f0211397dc663c56e43459f0c8be75
-SHA256 (make-4.4.tar.lz) = 48d0fc0b2a04bb50f2911c16da65723285f7f4804c74fc5a2124a3df6c5f78c4
-SHA256 (upstream-fixes-20221116.patch) = d053aa03111bb4f49eb9d2c527b961fb53c608188883e3eb3d94c44f3e288391
+SHA256 (make-4.4.1.tar.lz) = 8814ba072182b605d156d7589c19a43b89fc58ea479b9355146160946f8cf6e9
diff --git a/make/Pkgfile b/make/Pkgfile
index bf928da9..e31536f7 100644
--- a/make/Pkgfile
+++ b/make/Pkgfile
@@ -3,14 +3,12 @@
# Maintainer: CRUX System Team, core-ports at crux dot nu
name=make
-version=4.4
-release=2
-source=(https://ftpmirror.gnu.org/gnu/$name/$name-$version.tar.lz
- upstream-fixes-20221116.patch)
+version=4.4.1
+release=1
+source=(https://ftpmirror.gnu.org/gnu/$name/$name-$version.tar.lz)
build() {
cd $name-$version
- patch -p1 -i $SRC/upstream-fixes-20221116.patch
./configure --prefix=/usr --disable-nls
make
make DESTDIR=$PKG install
diff --git a/make/upstream-fixes-20221116.patch b/make/upstream-fixes-20221116.patch
deleted file mode 100644
index a7db8087..00000000
--- a/make/upstream-fixes-20221116.patch
+++ /dev/null
@@ -1,1213 +0,0 @@
-diff --git a/src/config.h.W32 b/src/config.h.W32
-index 1a03a041..369e897d 100644
---- a/src/config.h.W32
-+++ b/src/config.h.W32
-@@ -344,6 +344,14 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
-
- /* Define to 1 if you have the `strtoll' function. */
- #define HAVE_STRTOLL 1
-+#ifdef __TINYC__
-+# ifndef strtoll
-+# define strtoll _strtoi64
-+# endif
-+# ifndef strtoull
-+# define strtoull _strtoui64
-+# endif
-+#endif
-
- /* Define to 1 if `d_type' is a member of `struct dirent'. */
- /* SV 57152: MinGW64 version of dirent doesn't support d_type. */
-diff --git a/src/dir.c b/src/dir.c
-index b47e94fe..1e6e7397 100644
---- a/src/dir.c
-+++ b/src/dir.c
-@@ -456,7 +456,7 @@ dirfile_hash_cmp (const void *xv, const void *yv)
- #define DIRFILE_BUCKETS 107
- #endif
-
--static int dir_contents_file_exists_p (struct directory_contents *dir,
-+static int dir_contents_file_exists_p (struct directory *dir,
- const char *filename);
- static struct directory *find_directory (const char *name);
-
-@@ -623,7 +623,7 @@ find_directory (const char *name)
- if (open_directories == MAX_OPEN_DIRECTORIES)
- /* We have too many directories open already.
- Read the entire directory and then close it. */
-- dir_contents_file_exists_p (dc, 0);
-+ dir_contents_file_exists_p (dir, 0);
- }
- }
-
-@@ -634,17 +634,18 @@ find_directory (const char *name)
- FILENAME must contain no slashes. */
-
- static int
--dir_contents_file_exists_p (struct directory_contents *dir,
-+dir_contents_file_exists_p (struct directory *dir,
- const char *filename)
- {
- struct dirfile *df;
- struct dirent *d;
-+ struct directory_contents *dc = dir->contents;
- #ifdef WINDOWS32
- struct stat st;
- int rehash = 0;
- #endif
-
-- if (dir == 0 || dir->dirfiles.ht_vec == 0)
-+ if (dc == 0 || dc->dirfiles.ht_vec == 0)
- /* The directory could not be stat'd or opened. */
- return 0;
-
-@@ -671,7 +672,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- }
- dirfile_key.name = filename;
- dirfile_key.length = strlen (filename);
-- df = hash_find_item (&dir->dirfiles, &dirfile_key);
-+ df = hash_find_item (&dc->dirfiles, &dirfile_key);
- if (df)
- return !df->impossible;
- }
-@@ -679,7 +680,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- /* The file was not found in the hashed list.
- Try to read the directory further. */
-
-- if (dir->dirstream == 0)
-+ if (dc->dirstream == 0)
- {
- #ifdef WINDOWS32
- /*
-@@ -687,17 +688,17 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- * filesystems force a rehash always as mtime does not change
- * on directories (ugh!).
- */
-- if (dir->path_key)
-+ if (dc->path_key)
- {
-- if ((dir->fs_flags & FS_FAT) != 0)
-+ if ((dc->fs_flags & FS_FAT) != 0)
- {
-- dir->mtime = time ((time_t *) 0);
-+ dc->mtime = time ((time_t *) 0);
- rehash = 1;
- }
-- else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
-+ else if (stat (dc->path_key, &st) == 0 && st.st_mtime > dc->mtime)
- {
- /* reset date stamp to show most recent re-process. */
-- dir->mtime = st.st_mtime;
-+ dc->mtime = st.st_mtime;
- rehash = 1;
- }
-
-@@ -706,8 +707,8 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- return 0;
-
- /* make sure directory can still be opened; if not return. */
-- dir->dirstream = opendir (dir->path_key);
-- if (!dir->dirstream)
-+ dc->dirstream = opendir (dc->path_key);
-+ if (!dc->dirstream)
- return 0;
- }
- else
-@@ -723,11 +724,11 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- struct dirfile dirfile_key;
- struct dirfile **dirfile_slot;
-
-- ENULLLOOP (d, readdir (dir->dirstream));
-+ ENULLLOOP (d, readdir (dc->dirstream));
- if (d == 0)
- {
- if (errno)
-- pfatal_with_name ("INTERNAL: readdir");
-+ OSS (fatal, NILF, "readdir %s: %s", dir->name, strerror (errno));
- break;
- }
-
-@@ -747,7 +748,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- len = NAMLEN (d);
- dirfile_key.name = d->d_name;
- dirfile_key.length = len;
-- dirfile_slot = (struct dirfile **) hash_find_slot (&dir->dirfiles, &dirfile_key);
-+ dirfile_slot = (struct dirfile **) hash_find_slot (&dc->dirfiles, &dirfile_key);
- #ifdef WINDOWS32
- /*
- * If re-reading a directory, don't cache files that have
-@@ -768,7 +769,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
- #endif
- df->length = len;
- df->impossible = 0;
-- hash_insert_at (&dir->dirfiles, df, dirfile_slot);
-+ hash_insert_at (&dc->dirfiles, df, dirfile_slot);
- }
- /* Check if the name matches the one we're searching for. */
- if (filename != 0 && patheq (d->d_name, filename))
-@@ -777,12 +778,13 @@ dir_contents_file_exists_p (struct directory_contents *dir,
-
- /* If the directory has been completely read in,
- close the stream and reset the pointer to nil. */
-- if (d == 0)
-+ if (d == NULL)
- {
- --open_directories;
-- closedir (dir->dirstream);
-- dir->dirstream = 0;
-+ closedir (dc->dirstream);
-+ dc->dirstream = NULL;
- }
-+
- return 0;
- }
-
-@@ -794,15 +796,10 @@ int
- dir_file_exists_p (const char *dirname, const char *filename)
- {
- #ifdef VMS
-- if ((filename != NULL) && (dirname != NULL))
-- {
-- int want_vmsify;
-- want_vmsify = (strpbrk (dirname, ":<[") != NULL);
-- if (want_vmsify)
-- filename = vmsify (filename, 0);
-- }
-+ if (filename && dirname && strpbrk (dirname, ":<[") != NULL)
-+ filename = vmsify (filename, 0);
- #endif
-- return dir_contents_file_exists_p (find_directory (dirname)->contents,
-+ return dir_contents_file_exists_p (find_directory (dirname),
- filename);
- }
-
-@@ -1225,7 +1222,7 @@ open_dirstream (const char *directory)
- /* Read all the contents of the directory now. There is no benefit
- in being lazy, since glob will want to see every file anyway. */
-
-- dir_contents_file_exists_p (dir->contents, 0);
-+ dir_contents_file_exists_p (dir, 0);
-
- new = xmalloc (sizeof (struct dirstream));
- new->contents = dir->contents;
-diff --git a/src/function.c b/src/function.c
-index f0ef3434..e4a3af86 100644
---- a/src/function.c
-+++ b/src/function.c
-@@ -2801,7 +2801,7 @@ define_new_function (const floc *flocp, const char *name,
- _("Invalid maximum argument count (%u) for function %s"), max, name);
-
- ent = xmalloc (sizeof (struct function_table_entry));
-- ent->name = name;
-+ ent->name = strcache_add (name);
- ent->len = (unsigned char) len;
- ent->minimum_args = (unsigned char) min;
- ent->maximum_args = (unsigned char) max;
-diff --git a/src/hash.c b/src/hash.c
-index 5d7ea81b..d1652f84 100644
---- a/src/hash.c
-+++ b/src/hash.c
-@@ -361,7 +361,7 @@ round_up_2 (unsigned long n)
- #define sum_get_unaligned_32(r, p) \
- do { \
- unsigned int val; \
-- memcpy(&val, (p), 4); \
-+ memcpy (&val, (p), 4); \
- r += val; \
- } while(0);
-
-@@ -413,13 +413,16 @@ jhash(unsigned const char *k, int length)
- #define UINTSZ sizeof (unsigned int)
-
- #ifdef WORDS_BIGENDIAN
--/* The ifs are ordered from the first byte in memory to the last. */
-+/* The ifs are ordered from the first byte in memory to the last.
-+ Help the compiler optimize by using static memcpy length. */
- #define sum_up_to_nul(r, p, plen, flag) \
- do { \
- unsigned int val = 0; \
- size_t pn = (plen); \
-- size_t n = pn < UINTSZ ? pn : UINTSZ; \
-- memcpy (&val, (p), n); \
-+ if (pn >= UINTSZ) \
-+ memcpy (&val, (p), UINTSZ); \
-+ else \
-+ memcpy (&val, (p), pn); \
- if ((val & 0xFF000000) == 0) \
- flag = 1; \
- else if ((val & 0xFF0000) == 0) \
-@@ -432,13 +435,16 @@ jhash(unsigned const char *k, int length)
- #else
- /* First detect the presence of zeroes. If there is none, we can
- sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
-- big endian case, from the first byte in memory to the last. */
-+ big endian case, from the first byte in memory to the last.
-+ Help the compiler optimize by using static memcpy length. */
- #define sum_up_to_nul(r, p, plen, flag) \
- do { \
- unsigned int val = 0; \
- size_t pn = (plen); \
-- size_t n = pn < UINTSZ ? pn : UINTSZ; \
-- memcpy (&val, (p), n); \
-+ if (pn >= UINTSZ) \
-+ memcpy (&val, (p), UINTSZ); \
-+ else \
-+ memcpy (&val, (p), pn); \
- flag = ((val - 0x01010101) & ~val) & 0x80808080; \
- if (!flag) \
- r += val; \
-diff --git a/src/main.c b/src/main.c
-index eec93656..b31ddd4d 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -1182,11 +1182,6 @@ main (int argc, char **argv, char **envp)
- /* Useful for attaching debuggers, etc. */
- SPIN ("main-entry");
-
-- /* Don't die if our stdout sends us SIGPIPE. */
--#ifdef SIGPIPE
-- bsd_signal (SIGPIPE, SIG_IGN);
--#endif
--
- #ifdef HAVE_ATEXIT
- if (ANY_SET (check_io_state (), IO_STDOUT_OK))
- atexit (close_stdout);
-@@ -1264,6 +1259,9 @@ main (int argc, char **argv, char **envp)
- #endif
- #ifdef SIGQUIT
- FATAL_SIG (SIGQUIT);
-+#endif
-+#ifdef SIGPIPE
-+ FATAL_SIG (SIGPIPE);
- #endif
- FATAL_SIG (SIGINT);
- FATAL_SIG (SIGTERM);
-@@ -1505,7 +1503,7 @@ main (int argc, char **argv, char **envp)
-
- /* If this is MAKE_RESTARTS, check to see if the "already printed
- the enter statement" flag is set. */
-- if (len == 13 && memcmp (envp[i], STRING_SIZE_TUPLE ("MAKE_RESTARTS")) == 0)
-+ if (len == 13 && memcmp (envp[i], "MAKE_RESTARTS", CSTRLEN ("MAKE_RESTARTS")) == 0)
- {
- if (*ep == '-')
- {
-@@ -1930,6 +1928,9 @@ main (int argc, char **argv, char **envp)
- _("Makefile from standard input specified twice"));
-
- outfile = get_tmpfile (&newnm);
-+ if (!outfile)
-+ O (fatal, NILF,
-+ _("cannot store makefile from stdin to a temporary file"));
-
- while (!feof (stdin) && ! ferror (stdin))
- {
-diff --git a/src/misc.c b/src/misc.c
-index 8264fe9f..00dce749 100644
---- a/src/misc.c
-+++ b/src/misc.c
-@@ -20,8 +20,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
- #include "os.h"
- #include "debug.h"
-
--/* GNU make no longer supports pre-ANSI89 environments. */
--
-+#include <assert.h>
- #include <stdarg.h>
-
- #ifdef WINDOWS32
-@@ -650,11 +649,19 @@ get_tmppath ()
- # ifdef HAVE_MKTEMP
- path = get_tmptemplate ();
- if (*mktemp (path) == '\0')
-- pfatal_with_name ("mktemp");
-+ {
-+ OSS (error, NILF,
-+ _("cannot generate temp path from %s: %s"), path, strerror (errno));
-+ return NULL;
-+ }
- # else
- path = xmalloc (L_tmpnam + 1);
- if (tmpnam (path) == NULL)
-- pfatal_with_name ("tmpnam");
-+ {
-+ OS (error, NILF,
-+ _("cannot generate temp name: %s"), strerror (errno));
-+ return NULL;
-+ }
- # endif
-
- return path;
-@@ -662,7 +669,9 @@ get_tmppath ()
- #endif
-
- /* Generate a temporary file and return an fd for it. If name is NULL then
-- the temp file is anonymous and will be deleted when the process exits. */
-+ the temp file is anonymous and will be deleted when the process exits. If
-+ name is not null then *name will point to an allocated buffer, or set to
-+ NULL on failure. */
- int
- get_tmpfd (char **name)
- {
-@@ -670,9 +679,11 @@ get_tmpfd (char **name)
- char *tmpnm;
- mode_t mask;
-
-- /* If there's an os-specific way to get an anoymous temp file use it. */
-- if (!name)
-+ if (name)
-+ *name = NULL;
-+ else
- {
-+ /* If there's an os-specific way to get an anoymous temp file use it. */
- fd = os_anontmp ();
- if (fd >= 0)
- return fd;
-@@ -689,13 +700,19 @@ get_tmpfd (char **name)
- EINTRLOOP (fd, mkstemp (tmpnm));
- #else
- tmpnm = get_tmppath ();
-+ if (!tmpnm)
-+ return -1;
-
- /* Can't use mkstemp(), but try to guard against a race condition. */
- EINTRLOOP (fd, open (tmpnm, O_CREAT|O_EXCL|O_RDWR, 0600));
- #endif
- if (fd < 0)
-- OSS (fatal, NILF,
-- _("create temporary file %s: %s"), tmpnm, strerror (errno));
-+ {
-+ OSS (error, NILF,
-+ _("cannot create temporary file %s: %s"), tmpnm, strerror (errno));
-+ free (tmpnm);
-+ return -1;
-+ }
-
- if (name)
- *name = tmpnm;
-@@ -704,8 +721,8 @@ get_tmpfd (char **name)
- int r;
- EINTRLOOP (r, unlink (tmpnm));
- if (r < 0)
-- OSS (fatal, NILF,
-- _("unlink temporary file %s: %s"), tmpnm, strerror (errno));
-+ OSS (error, NILF,
-+ _("cannot unlink temporary file %s: %s"), tmpnm, strerror (errno));
- free (tmpnm);
- }
-
-@@ -715,8 +732,8 @@ get_tmpfd (char **name)
- }
-
- /* Return a FILE* for a temporary file, opened in the safest way possible.
-- Set name to point to an allocated buffer containing the name of the file.
-- Note, this cannot be NULL! */
-+ Set name to point to an allocated buffer containing the name of the file,
-+ or NULL on failure. Note, name cannot be NULL! */
- FILE *
- get_tmpfile (char **name)
- {
-@@ -725,26 +742,37 @@ get_tmpfile (char **name)
- FILE *file;
-
- #if defined(HAVE_FDOPEN)
-- int fd = get_tmpfd (name);
-+ int fd;
-+ assert (name);
-+ fd = get_tmpfd (name);
-+ if (fd < 0)
-+ return NULL;
-+ assert (*name);
-
- ENULLLOOP (file, fdopen (fd, tmpfile_mode));
- if (file == NULL)
-- OSS (fatal, NILF,
-+ OSS (error, NILF,
- _("fdopen: temporary file %s: %s"), *name, strerror (errno));
- #else
- /* Preserve the current umask, and set a restrictive one for temp files. */
- mode_t mask = umask (0077);
-- int err;
-
-+ assert (name);
- *name = get_tmppath ();
-+ if (!*name)
-+ return NULL;
-
- /* Although this fopen is insecure, it is executed only on non-fdopen
- platforms, which should be a rarity nowadays. */
-
- ENULLLOOP (file, fopen (*name, tmpfile_mode));
- if (file == NULL)
-- OSS (fatal, NILF,
-- _("fopen: temporary file %s: %s"), *name, strerror (errno));
-+ {
-+ OSS (error, NILF,
-+ _("fopen: temporary file %s: %s"), *name, strerror (errno));
-+ free (*name);
-+ *name = NULL;
-+ }
-
- umask (mask);
- #endif
-diff --git a/src/output.c b/src/output.c
-index 43eb2f06..22387dff 100644
---- a/src/output.c
-+++ b/src/output.c
-@@ -248,6 +248,9 @@ setup_tmpfile (struct output *out)
-
- /* If we failed to create a temp file, disable output sync going forward. */
- error:
-+ O (error, NILF,
-+ _("cannot open output-sync lock file, suppressing output-sync."));
-+
- output_close (out);
- output_sync = OUTPUT_SYNC_NONE;
- osync_clear ();
-diff --git a/src/posixos.c b/src/posixos.c
-index 44aeb346..78358dd8 100644
---- a/src/posixos.c
-+++ b/src/posixos.c
-@@ -167,12 +167,12 @@ jobserver_setup (int slots, const char *style)
- hang until the write side is open. */
- EINTRLOOP (job_fds[0], open (fifo_name, O_RDONLY|O_NONBLOCK));
- if (job_fds[0] < 0)
-- OSS (fatal, NILF, _("Cannot open jobserver %s: %s"),
-+ OSS (fatal, NILF, _("cannot open jobserver %s: %s"),
- fifo_name, strerror (errno));
-
- EINTRLOOP (job_fds[1], open (fifo_name, O_WRONLY));
- if (job_fds[0] < 0)
-- OSS (fatal, NILF, _("Cannot open jobserver %s: %s"),
-+ OSS (fatal, NILF, _("cannot open jobserver %s: %s"),
- fifo_name, strerror (errno));
-
- js_type = js_fifo;
-@@ -183,7 +183,7 @@ jobserver_setup (int slots, const char *style)
- if (js_type == js_none)
- {
- if (style && strcmp (style, "pipe") != 0)
-- OS (fatal, NILF, _("Unknown jobserver auth style '%s'"), style);
-+ OS (fatal, NILF, _("unknown jobserver auth style '%s'"), style);
-
- EINTRLOOP (r, pipe (job_fds));
- if (r < 0)
-@@ -229,14 +229,19 @@ jobserver_parse_auth (const char *auth)
-
- EINTRLOOP (job_fds[0], open (fifo_name, O_RDONLY));
- if (job_fds[0] < 0)
-- OSS (fatal, NILF,
-- _("Cannot open jobserver %s: %s"), fifo_name, strerror (errno));
-+ {
-+ OSS (error, NILF,
-+ _("cannot open jobserver %s: %s"), fifo_name, strerror (errno));
-+ return 0;
-+ }
-
- EINTRLOOP (job_fds[1], open (fifo_name, O_WRONLY));
-- if (job_fds[0] < 0)
-- OSS (fatal, NILF,
-- _("Cannot open jobserver %s: %s"), fifo_name, strerror (errno));
--
-+ if (job_fds[1] < 0)
-+ {
-+ OSS (error, NILF,
-+ _("cannot open jobserver %s: %s"), fifo_name, strerror (errno));
-+ return 0;
-+ }
- js_type = js_fifo;
- }
- /* If not, it must be a simple pipe. */
-@@ -867,12 +872,15 @@ os_anontmp ()
- FILE *tfile;
- ENULLLOOP (tfile, tmpfile ());
- if (!tfile)
-- pfatal_with_name ("tmpfile");
-+ {
-+ OS (error, NILF, "tmpfile: %s", strerror (errno));
-+ return -1;
-+ }
- umask (mask);
-
- EINTRLOOP (fd, dup (fileno (tfile)));
- if (fd < 0)
-- pfatal_with_name ("dup");
-+ OS (error, NILF, "dup: %s", strerror (errno));
- fclose (tfile);
- }
- #endif
-diff --git a/src/read.c b/src/read.c
-index 07431240..15f58ecf 100644
---- a/src/read.c
-+++ b/src/read.c
-@@ -1140,20 +1140,29 @@ eval (struct ebuffer *ebuf, int set_default)
-
- p2 = next_token (variable_buffer);
-
-- /* If the word we're looking at is EOL, see if there's _anything_
-- on the line. If not, a variable expanded to nothing, so ignore
-- it. If so, we can't parse this line so punt. */
-+ /* If we're at EOL we didn't find a separator so we don't know what
-+ kind of line this is. */
- if (wtype == w_eol)
- {
-+ /* Ignore an empty line. */
- if (*p2 == '\0')
- continue;
-
-- /* There's no need to be ivory-tower about this: check for
-- one of the most common bugs found in makefiles... */
-+ /* Check for spaces instead of TAB. */
- if (cmd_prefix == '\t' && strneq (line, " ", 8))
- O (fatal, fstart, _("missing separator (did you mean TAB instead of 8 spaces?)"));
-- else
-- O (fatal, fstart, _("missing separator"));
-+
-+ /* Check for conditionals without whitespace afterward.
-+ We don't check ifdef/ifndef because there's no real way to miss
-+ whitespace there. */
-+ p2 = next_token (line);
-+ if (strneq (p2, "if", 2) &&
-+ ((strneq (&p2[2], "neq", 3) && !STOP_SET (p2[5], MAP_BLANK))
-+ || (strneq (&p2[2], "eq", 2) && !STOP_SET (p2[4], MAP_BLANK))))
-+ O (fatal, fstart, _("missing separator (ifeq/ifneq must be followed by whitespace)"));
-+
-+ /* No idea... */
-+ O (fatal, fstart, _("missing separator"));
- }
-
- {
-diff --git a/src/w32/w32os.c b/src/w32/w32os.c
-index 9c5dec24..213bbf12 100644
---- a/src/w32/w32os.c
-+++ b/src/w32/w32os.c
-@@ -216,12 +216,12 @@ jobserver_setup (int slots, const char *style)
- /* sub_proc.c is limited in the number of objects it can wait for. */
-
- if (style && strcmp (style, "sem") != 0)
-- OS (fatal, NILF, _("Unknown jobserver auth style '%s'"), style);
-+ OS (fatal, NILF, _("unknown jobserver auth style '%s'"), style);
-
- if (slots > process_table_usable_size())
- {
- slots = process_table_usable_size();
-- DB (DB_JOBS, (_("Jobserver slots limited to %d\n"), slots));
-+ DB (DB_JOBS, (_("jobserver slots limited to %d\n"), slots));
- }
-
- sprintf (jobserver_semaphore_name, "gmake_semaphore_%d", _getpid ());
-@@ -255,10 +255,12 @@ jobserver_parse_auth (const char *auth)
- {
- DWORD err = GetLastError ();
- const char *estr = map_windows32_error_to_string (err);
-- fatal (NILF, strlen (auth) + INTSTR_LENGTH + strlen (estr),
-- _("internal error: unable to open jobserver semaphore '%s': (Error %ld: %s)"),
-+ error (NILF, strlen (auth) + INTSTR_LENGTH + strlen (estr),
-+ _("unable to open jobserver semaphore '%s': (Error %ld: %s)"),
- auth, err, estr);
-+ return 0;
- }
-+
- DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), auth));
-
- return 1;
-diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
-index 70dd1821..5fc37595 100644
---- a/tests/run_make_tests.pl
-+++ b/tests/run_make_tests.pl
-@@ -185,7 +185,6 @@ sub subst_make_string
- s/#PERL#/$perl_name/g;
- s/#PWD#/$cwdpath/g;
- s/#WORK#/$workdir/g;
-- # If we're using a shell
- s/#HELPER#/$perl_name $helptool/g;
- return $_;
- }
-diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
-index 8ecbe345..e12facf0 100644
---- a/tests/scripts/features/jobserver
-+++ b/tests/scripts/features/jobserver
-@@ -14,6 +14,7 @@ if (!$parallel_jobs) {
-
- # Shorthand
- my $np = '--no-print-directory';
-+my $j1err = "warning: jobserver unavailable: using -j1. Add '+' to parent make rule.";
-
- # Simple test of MAKEFLAGS settings
- run_make_test(q!
-@@ -90,7 +91,7 @@ if ($port_type ne 'W32') {
- default: ; @ #MAKEPATH# -f Makefile2
- !,
- "--jobserver-style=pipe -j2 $np",
--"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
-+"#MAKE#[1]: $j1err
- #MAKE#[1]: Nothing to be done for 'foo'.");
-
- rmfiles('Makefile2');
-@@ -98,15 +99,15 @@ default: ; @ #MAKEPATH# -f Makefile2
-
- # For Windows and named pipes, we don't need to worry about recursion
- if ($port_type eq 'W32' || exists $FEATURES{'jobserver-fifo'}) {
-- create_file('Makefile2', "vpath %.c ../\n", "foo:\n");
-+ create_file('Makefile2', "vpath %.c ../\n", "foo:\n");
-
-- run_make_test(q!
-+ run_make_test(q!
- default: ; @ #MAKEPATH# -f Makefile2
- !,
- "-j2 $np",
- "#MAKE#[1]: Nothing to be done for 'foo'.");
-
-- rmfiles('Makefile2');
-+ rmfiles('Makefile2');
- }
-
- # Ensure enter/leave directory messages appear before jobserver warnings
-@@ -129,17 +130,17 @@ all: a
- all a: ; @echo $@
- !,
- '--jobserver-style=foo -j8',
-- "#MAKE#: *** Unknown jobserver auth style 'foo'. Stop.", 512);
--
--# sv 62908.
--# Test that when mkfifo fails, make switches to pipe and succeeds.
--# Force mkfifo to fail by attempting to create a fifo in a non existent
--# directory.
--# run_make_test does not allow matching a multiline pattern, therefore run the
--# test twice.
--# First time look for /$ERR_no_such_file/ to ensure mkfifo failed.
--# Second time look for /Nothing to be done/ to ensure make succeeded.
-+ "#MAKE#: *** unknown jobserver auth style 'foo'. Stop.", 512);
-+
- if (exists $FEATURES{'jobserver-fifo'}) {
-+ # sv 62908.
-+ # Test that when mkfifo fails, make switches to pipe and succeeds.
-+ # Force mkfifo to fail by attempting to create a fifo in a non existent
-+ # directory.
-+ # run_make_test does not allow matching a multiline pattern, therefore run
-+ # the test twice.
-+ # First time look for /$ERR_no_such_file/ to ensure mkfifo failed.
-+ # Second time look for /Nothing to be done/ to ensure make succeeded.
- $ENV{TMPDIR} = "nosuchdir";
- run_make_test("all:\n", '-j2', "/$ERR_no_such_file/");
-
-@@ -155,6 +156,10 @@ recurse: ; @$(MAKE) -f #MAKEFILE# all
- all:;@echo "$$MAKEFLAGS"
- !,
- "-j2 --no-print-directory", "/--jobserver-auth=fifo:\\./");
-+
-+ # Verify we fall back to -j1 but continue, of the auth is bad.
-+ $ENV{MAKEFLAGS} = '-j2 --jobserver-auth=fifo:nosuchfile';
-+ run_make_test(q!all:;@echo hi!, "", "#MAKE#: cannot open jobserver nosuchfile: $ERR_no_such_file\n#MAKE#: $j1err\nhi\n");
- }
-
- 1;
-diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
-index 13a54ca0..18c85c0a 100644
---- a/tests/scripts/features/output-sync
-+++ b/tests/scripts/features/output-sync
-@@ -360,11 +360,27 @@ use POSIX ();
- # file.
- run_make_test(q!
- pid:=$(shell echo $$PPID)
--all:; @kill -TERM $(pid) && sleep 16
-+all:; @#HELPER# term $(pid) sleep 10
- !, '-O -j2', '/#MAKE#: \*\*\* \[#MAKEFILE#:3: all] Terminated/', POSIX::SIGTERM);
- }
--
- unlink($fout);
-+
-+# SV 63333. Test that make continues to run without output sync when we
-+# cannot create a temporary file.
-+# Create a non-writable temporary directory.
-+# Run the test twice, because run_make_test cannot match a regex againt a
-+# multiline input.
-+my $tdir = 'test_tmp_dir';
-+mkdir($tdir, 0500);
-+$ENV{'TMPDIR'} = $tdir;
-+
-+run_make_test(q!
-+all:; $(info hello, world)
-+!, '-Orecurse', "/suppressing output-sync/");
-+
-+run_make_test(undef, '-Orecurse', "/#MAKE#: 'all' is up to date./");
-+
-+rmdir($tdir);
- }
-
- # This tells the test driver that the perl test script executed properly.
-diff --git a/tests/scripts/features/temp_stdin b/tests/scripts/features/temp_stdin
-index b06df53e..3bd53e02 100644
---- a/tests/scripts/features/temp_stdin
-+++ b/tests/scripts/features/temp_stdin
-@@ -71,7 +71,7 @@ run_make_test(q!
- include bye.mk
- pid:=$(shell echo $$PPID)
- all:;
--bye.mk: force; @kill -TERM $(pid) && sleep 16
-+bye.mk: force; @#HELPER# term $(pid) sleep 10
- force:
- !, '-f-', '/#MAKE#: \*\*\* \[#MAKEFILE#:5: bye.mk] Terminated/', POSIX::SIGTERM);
- }
-@@ -109,6 +109,21 @@ force:
- @make_command = @make_orig;
- unlink($makecopy);
- rmdir($tmakedir);
-+
-+# SV 63333. Test that make exits with an error message if we cannot store a
-+# makefile from stdin to a temporary file.
-+# Create a non-writable temporary directory.
-+
-+my $tdir = 'test_tmp_dir';
-+mkdir($tdir, 0500);
-+$ENV{'TMPDIR'} = $tdir;
-+close(STDIN);
-+open(STDIN, "<", 'input.mk') || die "$0: cannot open input.mk for reading: $!";
-+
-+run_make_test(q!
-+all:; $(info hello, world)
-+!, '-f-', '/cannot store makefile from stdin to a temporary file. Stop./', 512);
-+rmdir($tdir);
- }
-
- close(STDIN);
-diff --git a/tests/scripts/misc/failure b/tests/scripts/misc/failure
-new file mode 100644
-index 00000000..edd90fbb
---- /dev/null
-+++ b/tests/scripts/misc/failure
-@@ -0,0 +1,49 @@
-+# -*-perl-*-
-+
-+$description = "Test miscellaneous failures.";
-+
-+
-+# Test that the "did you mean TAB" message is printed properly
-+
-+run_make_test(q!
-+$x.
-+!,
-+ '', '#MAKEFILE#:2: *** missing separator. Stop.', 512);
-+
-+run_make_test(q!
-+foo:
-+ bar
-+!,
-+ '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512);
-+
-+run_make_test(q!
-+.RECIPEPREFIX = :
-+foo:
-+ bar
-+!,
-+ '', '#MAKEFILE#:4: *** missing separator. Stop.', 512);
-+
-+for my $kw ('eq', 'neq') {
-+run_make_test(qq!
-+if$kw(foo,bar)
-+\$(error ouch)
-+endif
-+!,
-+ '', '#MAKEFILE#:2: *** missing separator (ifeq/ifneq must be followed by whitespace). Stop.', 512);
-+
-+run_make_test(qq!
-+if$kw
-+\$(error ouch)
-+endif
-+!,
-+ '', '#MAKEFILE#:2: *** invalid syntax in conditional. Stop.', 512);
-+
-+run_make_test(qq!
-+if$kw blah
-+\$(error ouch)
-+endif
-+!,
-+ '', '#MAKEFILE#:2: *** invalid syntax in conditional. Stop.', 512);
-+}
-+
-+1;
-diff --git a/tests/scripts/variables/special b/tests/scripts/variables/special
-index 68f3128c..abe9fc0c 100644
---- a/tests/scripts/variables/special
-+++ b/tests/scripts/variables/special
-@@ -122,26 +122,6 @@ reset-four \
- : foo-three
- : foo-four');
-
--# Test that the "did you mean TAB" message is printed properly
--
--run_make_test(q!
--$x.
--!,
-- '', '#MAKEFILE#:2: *** missing separator. Stop.', 512);
--
--run_make_test(q!
--foo:
-- bar
--!,
-- '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512);
--
--run_make_test(q!
--.RECIPEPREFIX = :
--foo:
-- bar
--!,
-- '', '#MAKEFILE#:4: *** missing separator. Stop.', 512);
--
- 1;
-
- ### Local Variables:
-diff --git a/tests/test_driver.pl b/tests/test_driver.pl
-index b64fffb6..efe4981d 100644
---- a/tests/test_driver.pl
-+++ b/tests/test_driver.pl
-@@ -806,12 +806,135 @@ sub error
- die "$caller: $message";
- }
-
-+sub compare_answer_vms
-+{
-+ my ($kgo, $log) = @_;
-+
-+ # VMS has extra blank lines in output sometimes.
-+ # Ticket #41760
-+ $log =~ s/\n\n+/\n/gm;
-+ $log =~ s/\A\n+//g;
-+ return 1 if ($kgo eq $log);
-+
-+ # VMS adding a "Waiting for unfinished jobs..."
-+ # Remove it for now to see what else is going on.
-+ $log =~ s/^.+\*\*\* Waiting for unfinished jobs.+$//m;
-+ $log =~ s/\n\n/\n/gm;
-+ $log =~ s/^\n+//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS wants target device to exist or generates an error,
-+ # Some test tagets look like VMS devices and trip this.
-+ $log =~ s/^.+\: no such device or address.*$//gim;
-+ $log =~ s/\n\n/\n/gm;
-+ $log =~ s/^\n+//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS error message has a different case
-+ $log =~ s/no such file /No such file /gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS is putting comas instead of spaces in output
-+ $log =~ s/,/ /gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS Is sometimes adding extra leading spaces to output?
-+ {
-+ (my $mlog = $log) =~ s/^ +//gm;
-+ return 1 if ($mlog eq $kgo);
-+ }
-+
-+ # VMS port not handling POSIX encoded child status
-+ # Translate error case it for now.
-+ $log =~ s/0x1035a00a/1/gim;
-+ return 1 if ($log =~ /\Q$kgo\E/i);
-+
-+ $log =~ s/0x1035a012/2/gim;
-+ return 1 if ($log eq $kgo);
-+
-+ # Tests are using a UNIX null command, temp hack
-+ # until this can be handled by the VMS port.
-+ # ticket # 41761
-+ $log =~ s/^.+DCL-W-NOCOMD.*$//gim;
-+ $log =~ s/\n\n+/\n/gm;
-+ $log =~ s/^\n+//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # Tests are using exit 0;
-+ # this generates a warning that should stop the make, but does not
-+ $log =~ s/^.+NONAME-W-NOMSG.*$//gim;
-+ $log =~ s/\n\n+/\n/gm;
-+ $log =~ s/^\n+//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS is sometimes adding single quotes to output?
-+ $log =~ s/\'//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # And missing an extra space in output
-+ $kgo =~ s/\h\h+/ /gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS adding ; to end of some lines.
-+ $log =~ s/;\n/\n/gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS adding trailing space to end of some quoted lines.
-+ $log =~ s/\h+\n/\n/gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # And VMS missing leading blank line
-+ $kgo =~ s/\A\n//g;
-+ return 1 if ($log eq $kgo);
-+
-+ # Unix double quotes showing up as single quotes on VMS.
-+ $kgo =~ s/\"//g;
-+ return 1 if ($log eq $kgo);
-+
-+ return 0;
-+}
-+
-+sub compare_answer
-+{
-+ my ($kgo, $log) = @_;
-+ my ($mkgo, $mlog);
-+
-+ # For make, get rid of any time skew error before comparing--too bad this
-+ # has to go into the "generic" driver code :-/
-+ $log =~ s/^.*modification time .*in the future.*\n//gm;
-+ $log =~ s/^.*Clock skew detected.*\n//gm;
-+ return 1 if ($log eq $kgo);
-+
-+ # Get rid of newline differences, forever
-+ $kgo =~ s,\r\n,\n,gs;
-+ $log =~ s,\r\n,\n,gs;
-+ return 1 if ($log eq $kgo);
-+
-+ # See if it is a backslash problem (only on W32?)
-+ ($mkgo = $kgo) =~ tr,\\,/,;
-+ ($mlog = $log) =~ tr,\\,/,;
-+ return 1 if ($log eq $kgo);
-+
-+ # VMS is a whole thing...
-+ return 1 if ($^O eq 'VMS' && compare_answer_vms($mkgo, $mlog));
-+
-+ # See if the answer might be a regex.
-+ if ($kgo =~ m,^/(.+)/$,) {
-+ return 1 if ($log =~ /$1/);
-+
-+ # We can't test with backslashes converted to forward slashes, because
-+ # backslashes could be escaping RE special characters!
-+ }
-+
-+ return 0;
-+}
-+
- my %old_tempfiles = ();
-
- sub compare_output
- {
- my ($answer, $logfile) = @_;
-- my ($slurp, $answer_matched, $extra) = ('', 0, 0);
-+ my ($slurp, $matched, $extra) = ('', 0, 0);
-
- ++$tests_run;
-
-@@ -831,169 +954,25 @@ sub compare_output
-
- if (! defined $answer) {
- print "Ignoring output ........ " if $debug;
-- $answer_matched = 1;
-+ $matched = 1;
- } else {
- print "Comparing output ........ " if $debug;
-
-- $slurp = &read_file_into_string ($logfile);
--
-- # For make, get rid of any time skew error before comparing--too bad this
-- # has to go into the "generic" driver code :-/
-- $slurp =~ s/^.*modification time .*in the future.*\n//gm;
-- $slurp =~ s/^.*Clock skew detected.*\n//gm;
--
-- if ($slurp eq $answer) {
-- $answer_matched = 1;
-- } else {
-- # See if it is a slash or CRLF problem
-- my ($answer_mod, $slurp_mod) = ($answer, $slurp);
--
-- $answer_mod =~ tr,\\,/,;
-- $answer_mod =~ s,\r\n,\n,gs;
--
-- $slurp_mod =~ tr,\\,/,;
-- $slurp_mod =~ s,\r\n,\n,gs;
--
-- $answer_matched = ($slurp_mod eq $answer_mod);
--
-- if (!$answer_matched && $^O eq 'VMS') {
--
-- # VMS has extra blank lines in output sometimes.
-- # Ticket #41760
-- if (!$answer_matched) {
-- $slurp_mod =~ s/\n\n+/\n/gm;
-- $slurp_mod =~ s/\A\n+//g;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS adding a "Waiting for unfinished jobs..."
-- # Remove it for now to see what else is going on.
-- if (!$answer_matched) {
-- $slurp_mod =~ s/^.+\*\*\* Waiting for unfinished jobs.+$//m;
-- $slurp_mod =~ s/\n\n/\n/gm;
-- $slurp_mod =~ s/^\n+//gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS wants target device to exist or generates an error,
-- # Some test tagets look like VMS devices and trip this.
-- if (!$answer_matched) {
-- $slurp_mod =~ s/^.+\: no such device or address.*$//gim;
-- $slurp_mod =~ s/\n\n/\n/gm;
-- $slurp_mod =~ s/^\n+//gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS error message has a different case
-- if (!$answer_matched) {
-- $slurp_mod =~ s/no such file /No such file /gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS is putting comas instead of spaces in output
-- if (!$answer_matched) {
-- $slurp_mod =~ s/,/ /gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS Is sometimes adding extra leading spaces to output?
-- if (!$answer_matched) {
-- my $slurp_mod = $slurp_mod;
-- $slurp_mod =~ s/^ +//gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS port not handling POSIX encoded child status
-- # Translate error case it for now.
-- if (!$answer_matched) {
-- $slurp_mod =~ s/0x1035a00a/1/gim;
-- $answer_matched = 1 if $slurp_mod =~ /\Q$answer_mod\E/i;
--
-- }
-- if (!$answer_matched) {
-- $slurp_mod =~ s/0x1035a012/2/gim;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # Tests are using a UNIX null command, temp hack
-- # until this can be handled by the VMS port.
-- # ticket # 41761
-- if (!$answer_matched) {
-- $slurp_mod =~ s/^.+DCL-W-NOCOMD.*$//gim;
-- $slurp_mod =~ s/\n\n+/\n/gm;
-- $slurp_mod =~ s/^\n+//gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
-- # Tests are using exit 0;
-- # this generates a warning that should stop the make, but does not
-- if (!$answer_matched) {
-- $slurp_mod =~ s/^.+NONAME-W-NOMSG.*$//gim;
-- $slurp_mod =~ s/\n\n+/\n/gm;
-- $slurp_mod =~ s/^\n+//gm;
-- $answer_matched = ($slurp_mod eq $answer_mod);
-- }
--
-- # VMS is sometimes adding single quotes to output?
-- if (!$answer_matched) {
-- my $noq_slurp_mod = $slurp_mod;
-- $noq_slurp_mod =~ s/\'//gm;
-- $answer_matched = ($noq_slurp_mod eq $answer_mod);
--
-- # And missing an extra space in output
-- if (!$answer_matched) {
-- $noq_answer_mod = $answer_mod;
-- $noq_answer_mod =~ s/\h\h+/ /gm;
-- $answer_matched = ($noq_slurp_mod eq $noq_answer_mod);
-- }
--
-- # VMS adding ; to end of some lines.
-- if (!$answer_matched) {
-- $noq_slurp_mod =~ s/;\n/\n/gm;
-- $answer_matched = ($noq_slurp_mod eq $noq_answer_mod);
-- }
--
-- # VMS adding trailing space to end of some quoted lines.
-- if (!$answer_matched) {
-- $noq_slurp_mod =~ s/\h+\n/\n/gm;
-- $answer_matched = ($noq_slurp_mod eq $noq_answer_mod);
-- }
--
-- # And VMS missing leading blank line
-- if (!$answer_matched) {
-- $noq_answer_mod =~ s/\A\n//g;
-- $answer_matched = ($noq_slurp_mod eq $noq_answer_mod);
-- }
--
-- # Unix double quotes showing up as single quotes on VMS.
-- if (!$answer_matched) {
-- $noq_answer_mod =~ s/\"//g;
-- $answer_matched = ($noq_slurp_mod eq $noq_answer_mod);
-- }
-- }
-- }
--
-- # If it still doesn't match, see if the answer might be a regex.
-- if (!$answer_matched && $answer =~ m,^/(.+)/$,) {
-- $answer_matched = ($slurp =~ /$1/);
-- if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) {
-- $answer_matched = ($slurp_mod =~ /$1/);
-- }
-- }
-- }
-+ $matched = compare_answer($answer, &read_file_into_string ($logfile));
- }
-
-- if ($keep || ! $answer_matched) {
-+ if ($keep || ! $matched) {
- &create_file(&get_basefile, $answer);
- &create_file(&get_runfile, $command_string);
- }
-
-- if ($answer_matched && $test_passed && !$extra) {
-+ if ($matched && $test_passed && !$extra) {
- print "ok\n" if $debug;
- ++$tests_passed;
- return 1;
- }
-
-- if (! $answer_matched) {
-+ if (! $matched) {
- print "DIFFERENT OUTPUT\n" if $debug;
-
- print "\nCreating Difference File ...\n" if $debug;
-@@ -1001,10 +980,11 @@ sub compare_output
- # Create the difference file
- my $base = get_basefile();
- if ($diff_name) {
-- my $command = "$diff_name -c $base $logfile";
-- &run_command_with_output(get_difffile(), $command);
-+ &run_command_with_output(get_difffile(),
-+ "$diff_name -c $base $logfile");
- } else {
-- create_file(get_difffile(), "Log file $logfile differs from base file $base\n");
-+ create_file(get_difffile(),
-+ "Log file $logfile differs from base file $base\n");
- }
- }
-
-diff --git a/tests/thelp.pl b/tests/thelp.pl
-index 993339cb..c243bcb8 100755
---- a/tests/thelp.pl
-+++ b/tests/thelp.pl
-@@ -16,6 +16,7 @@
- # wait <word> : wait for a file named <word> to exist
- # tmout <secs> : Change the timeout for waiting. Default is 4 seconds.
- # sleep <secs> : Sleep for <secs> seconds then echo <secs>
-+# term <pid> : send SIGTERM to PID <pid>
- # fail <err> : echo <err> to stdout then exit with error code err
- #
- # If given -q only the "out" command generates output.
-@@ -95,6 +96,12 @@ sub op {
- return 1;
- }
-
-+ if ($op eq 'term') {
-+ print "term $nm\n";
-+ kill('TERM', $nm);
-+ return 1;
-+ }
-+
- if ($op eq 'fail') {
- print "fail $nm\n";
- exit($nm);
1
0
commit 88026b12f521a09ea3f1e25a6a0e21ad1ac835b4
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:41:54 2023 +0100
gutenprint-gimp: moved from opt
diff --git a/gutenprint-gimp/.footprint b/gutenprint-gimp/.footprint
new file mode 100644
index 000000000..2f5648675
--- /dev/null
+++ b/gutenprint-gimp/.footprint
@@ -0,0 +1,19 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/include/
+drwxr-xr-x root/root usr/include/gutenprintui2/
+-rw-r--r-- root/root usr/include/gutenprintui2/curve.h
+-rw-r--r-- root/root usr/include/gutenprintui2/gammacurve.h
+-rw-r--r-- root/root usr/include/gutenprintui2/gutenprintui.h
+-rw-r--r-- root/root usr/include/gutenprintui2/typebuiltins.h
+drwxr-xr-x root/root usr/lib/
+drwxr-xr-x root/root usr/lib/gimp/
+drwxr-xr-x root/root usr/lib/gimp/2.0/
+drwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/
+-rwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/gutenprint
+-rw-r--r-- root/root usr/lib/libgutenprintui2.a
+-rwxr-xr-x root/root usr/lib/libgutenprintui2.la
+lrwxrwxrwx root/root usr/lib/libgutenprintui2.so -> libgutenprintui2.so.2.5.0
+lrwxrwxrwx root/root usr/lib/libgutenprintui2.so.2 -> libgutenprintui2.so.2.5.0
+-rwxr-xr-x root/root usr/lib/libgutenprintui2.so.2.5.0
+drwxr-xr-x root/root usr/lib/pkgconfig/
+-rw-r--r-- root/root usr/lib/pkgconfig/gutenprintui2.pc
diff --git a/gutenprint-gimp/.signature b/gutenprint-gimp/.signature
new file mode 100644
index 000000000..58eb84419
--- /dev/null
+++ b/gutenprint-gimp/.signature
@@ -0,0 +1,5 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF37SMdif0jnkuUPjQ6u4IFNo9ntuNWFiAgiOE55PuDNhGeFBNg951qmiqUktbqcjAgYZtFCw3xSTgkTn3yVkougw=
+SHA256 (Pkgfile) = dc38cd2cad6ed3059c0e45bad405adddcb55d1901c83b3c095ddb6d441617958
+SHA256 (.footprint) = 95c1e8464d4aa218f36645eb4415c0b183bb05939872aaa6dcdb3e5b9009046c
+SHA256 (gutenprint-5.3.4.tar.xz) = db44a701d2b8e6a8931c83cec06c91226be266d23e5c189d20a39dd175f2023b
diff --git a/gutenprint-gimp/Pkgfile b/gutenprint-gimp/Pkgfile
new file mode 100644
index 000000000..fde182037
--- /dev/null
+++ b/gutenprint-gimp/Pkgfile
@@ -0,0 +1,29 @@
+# Description: Print plugin for gimp
+# URL: http://gimp-print.sourceforge.net/
+# Maintainer: Juergen Daubert, jue at crux dot nu
+# Depends on: gimp gutenprint
+
+name=gutenprint-gimp
+version=5.3.4
+release=1
+source=(http://downloads.sourceforge.net/project/gimp-print/gutenprint-5.3/$version/gutenprint-$version.tar.xz)
+
+build () {
+ cd gutenprint-$version
+
+ CONFIG_SHELL=/bin/bash \
+ ./configure --prefix=/usr \
+ --disable-{nls,samples,escputil} \
+ --without-{foomatic,ghostscript,doc} \
+ --enable-libgutenprintui2 \
+ --with-gimp2
+ make
+ make DESTDIR=$PKG install
+
+ rm $PKG/usr/lib/libgutenprint.*
+ rm $PKG/usr/lib/pkgconfig/gutenprint.pc
+ rm -r $PKG/usr/include/gutenprint
+ rm -r $PKG/usr/lib/gutenprint
+ rm -r $PKG/usr/lib/cups
+ rm -r $PKG/usr/{bin,sbin,share} $PKG/etc
+}
1
0
commit 4174fbac9fb02f75a0533cb5537cd3d49ac1a5cf
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:40:43 2023 +0100
xsane: moved from opt
diff --git a/xsane/.footprint b/xsane/.footprint
new file mode 100644
index 000000000..7a7def338
--- /dev/null
+++ b/xsane/.footprint
@@ -0,0 +1,30 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/xsane
+drwxr-xr-x root/root usr/lib/
+drwxr-xr-x root/root usr/lib/gimp/
+drwxr-xr-x root/root usr/lib/gimp/2.0/
+drwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/
+lrwxrwxrwx root/root usr/lib/gimp/2.0/plug-ins/xsane -> /usr/bin/xsane
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/applications/
+-rw-r--r-- root/root usr/share/applications/xsane.desktop
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/xsane.1.gz
+drwxr-xr-x root/root usr/share/pixmaps/
+-rw-r--r-- root/root usr/share/pixmaps/xsane.xpm
+drwxr-xr-x root/root usr/share/sane/
+drwxr-xr-x root/root usr/share/sane/xsane/
+-rw-r--r-- root/root usr/share/sane/xsane/Mustek-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/Plustek-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/UMAX-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/sane-epson-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/sane-hp-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/sane-umax-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/sane-xsane-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/xsane-calibration.pnm
+-rw-r--r-- root/root usr/share/sane/xsane/xsane-eula.txt
+-rw-r--r-- root/root usr/share/sane/xsane/xsane-logo.xpm
+-rw-r--r-- root/root usr/share/sane/xsane/xsane-startimage.pnm
+-rw-r--r-- root/root usr/share/sane/xsane/xsane-style.rc
diff --git a/xsane/.signature b/xsane/.signature
new file mode 100644
index 000000000..18fa0d0d3
--- /dev/null
+++ b/xsane/.signature
@@ -0,0 +1,5 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF31pwtIJD7hgtbUfEJv8MuA4G1pMoYxjfpRb0WHjMTevrKAMMTOzFDhd49gqbXDIx5jXg6fu9/ZN2U0O98mc1yQc=
+SHA256 (Pkgfile) = 88fde78aa9571b7c542542cb4c9b68ebef2973301449f27974d2184b38b20507
+SHA256 (.footprint) = 9660de3c0ad7b91d9b3d92d80c7ff2893da1858898abb34b7c3bced97bf1c152
+SHA256 (xsane-0.999.tar.gz) = 5782d23e67dc961c81eef13a87b17eb0144cae3d1ffc5cf7e0322da751482b4b
diff --git a/xsane/Pkgfile b/xsane/Pkgfile
new file mode 100644
index 000000000..4007994b5
--- /dev/null
+++ b/xsane/Pkgfile
@@ -0,0 +1,30 @@
+# Description: Scanner frontend and GIMP plugin for sane
+# URL: http://www.sane-project.org
+# Maintainer: Juergen Daubert, jue at crux dot nu
+# Depends on: gimp, sane
+
+name=xsane
+version=0.999
+release=1
+source=(https://fossies.org/linux/misc/$name-$version.tar.gz)
+
+build () {
+ cd $name-$version
+
+ # http://www.linuxfromscratch.org/blfs/view/svn/pst/xsane.html
+ sed -i -e 's/png_ptr->jmpbuf/png_jmpbuf(png_ptr)/' src/xsane-save.c
+
+ ./configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --disable-nls \
+ --enable-gtk2 \
+ --enable-gimp2
+ make
+ make DESTDIR=$PKG install
+
+ rm -r $PKG/usr/{sbin,share/sane/xsane/doc}
+ rm $PKG/usr/share/sane/xsane/xsane-gpl.txt
+
+ install -d $PKG/usr/lib/gimp/2.0/plug-ins
+ ln -s /usr/bin/xsane $PKG/usr/lib/gimp/2.0/plug-ins
+}
1
0
commit 88cf85452646c56c20d0b4635af7ccd387e1170d
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:39:11 2023 +0100
gutenprint-gimp: moved to contrib
diff --git a/gutenprint-gimp/.footprint b/gutenprint-gimp/.footprint
deleted file mode 100644
index 2f5648675..000000000
--- a/gutenprint-gimp/.footprint
+++ /dev/null
@@ -1,19 +0,0 @@
-drwxr-xr-x root/root usr/
-drwxr-xr-x root/root usr/include/
-drwxr-xr-x root/root usr/include/gutenprintui2/
--rw-r--r-- root/root usr/include/gutenprintui2/curve.h
--rw-r--r-- root/root usr/include/gutenprintui2/gammacurve.h
--rw-r--r-- root/root usr/include/gutenprintui2/gutenprintui.h
--rw-r--r-- root/root usr/include/gutenprintui2/typebuiltins.h
-drwxr-xr-x root/root usr/lib/
-drwxr-xr-x root/root usr/lib/gimp/
-drwxr-xr-x root/root usr/lib/gimp/2.0/
-drwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/
--rwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/gutenprint
--rw-r--r-- root/root usr/lib/libgutenprintui2.a
--rwxr-xr-x root/root usr/lib/libgutenprintui2.la
-lrwxrwxrwx root/root usr/lib/libgutenprintui2.so -> libgutenprintui2.so.2.5.0
-lrwxrwxrwx root/root usr/lib/libgutenprintui2.so.2 -> libgutenprintui2.so.2.5.0
--rwxr-xr-x root/root usr/lib/libgutenprintui2.so.2.5.0
-drwxr-xr-x root/root usr/lib/pkgconfig/
--rw-r--r-- root/root usr/lib/pkgconfig/gutenprintui2.pc
diff --git a/gutenprint-gimp/.signature b/gutenprint-gimp/.signature
deleted file mode 100644
index 0a97b15c1..000000000
--- a/gutenprint-gimp/.signature
+++ /dev/null
@@ -1,5 +0,0 @@
-untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/cQ57v2DPoO8dEbidlnPftNI4ivhDSVVeVtfsEpMkO4cv3i6VHqSc1dbWLTcjNrocxWlHcVpRz37QATVFv3FpAI=
-SHA256 (Pkgfile) = dc38cd2cad6ed3059c0e45bad405adddcb55d1901c83b3c095ddb6d441617958
-SHA256 (.footprint) = 95c1e8464d4aa218f36645eb4415c0b183bb05939872aaa6dcdb3e5b9009046c
-SHA256 (gutenprint-5.3.4.tar.xz) = db44a701d2b8e6a8931c83cec06c91226be266d23e5c189d20a39dd175f2023b
diff --git a/gutenprint-gimp/Pkgfile b/gutenprint-gimp/Pkgfile
deleted file mode 100644
index fde182037..000000000
--- a/gutenprint-gimp/Pkgfile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Description: Print plugin for gimp
-# URL: http://gimp-print.sourceforge.net/
-# Maintainer: Juergen Daubert, jue at crux dot nu
-# Depends on: gimp gutenprint
-
-name=gutenprint-gimp
-version=5.3.4
-release=1
-source=(http://downloads.sourceforge.net/project/gimp-print/gutenprint-5.3/$version/gutenprint-$version.tar.xz)
-
-build () {
- cd gutenprint-$version
-
- CONFIG_SHELL=/bin/bash \
- ./configure --prefix=/usr \
- --disable-{nls,samples,escputil} \
- --without-{foomatic,ghostscript,doc} \
- --enable-libgutenprintui2 \
- --with-gimp2
- make
- make DESTDIR=$PKG install
-
- rm $PKG/usr/lib/libgutenprint.*
- rm $PKG/usr/lib/pkgconfig/gutenprint.pc
- rm -r $PKG/usr/include/gutenprint
- rm -r $PKG/usr/lib/gutenprint
- rm -r $PKG/usr/lib/cups
- rm -r $PKG/usr/{bin,sbin,share} $PKG/etc
-}
1
0
commit 13c00226afb528f50eb3d7f29264310096c145b1
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:38:25 2023 +0100
xsane: moved to contrib
diff --git a/xsane/.footprint b/xsane/.footprint
deleted file mode 100644
index 7a7def338..000000000
--- a/xsane/.footprint
+++ /dev/null
@@ -1,30 +0,0 @@
-drwxr-xr-x root/root usr/
-drwxr-xr-x root/root usr/bin/
--rwxr-xr-x root/root usr/bin/xsane
-drwxr-xr-x root/root usr/lib/
-drwxr-xr-x root/root usr/lib/gimp/
-drwxr-xr-x root/root usr/lib/gimp/2.0/
-drwxr-xr-x root/root usr/lib/gimp/2.0/plug-ins/
-lrwxrwxrwx root/root usr/lib/gimp/2.0/plug-ins/xsane -> /usr/bin/xsane
-drwxr-xr-x root/root usr/share/
-drwxr-xr-x root/root usr/share/applications/
--rw-r--r-- root/root usr/share/applications/xsane.desktop
-drwxr-xr-x root/root usr/share/man/
-drwxr-xr-x root/root usr/share/man/man1/
--rw-r--r-- root/root usr/share/man/man1/xsane.1.gz
-drwxr-xr-x root/root usr/share/pixmaps/
--rw-r--r-- root/root usr/share/pixmaps/xsane.xpm
-drwxr-xr-x root/root usr/share/sane/
-drwxr-xr-x root/root usr/share/sane/xsane/
--rw-r--r-- root/root usr/share/sane/xsane/Mustek-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/Plustek-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/UMAX-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/sane-epson-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/sane-hp-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/sane-umax-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/sane-xsane-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/xsane-calibration.pnm
--rw-r--r-- root/root usr/share/sane/xsane/xsane-eula.txt
--rw-r--r-- root/root usr/share/sane/xsane/xsane-logo.xpm
--rw-r--r-- root/root usr/share/sane/xsane/xsane-startimage.pnm
--rw-r--r-- root/root usr/share/sane/xsane/xsane-style.rc
diff --git a/xsane/.signature b/xsane/.signature
deleted file mode 100644
index e98a99a76..000000000
--- a/xsane/.signature
+++ /dev/null
@@ -1,5 +0,0 @@
-untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/dHDEuUTpZb/Z2TWmM8bkOE+VWYyJDrBdXjUeY5Gqt6W6GtMRKzNtGxMq+1uPVonA4O1p2j50Z8WNhnP01TTTgg=
-SHA256 (Pkgfile) = 88fde78aa9571b7c542542cb4c9b68ebef2973301449f27974d2184b38b20507
-SHA256 (.footprint) = 9660de3c0ad7b91d9b3d92d80c7ff2893da1858898abb34b7c3bced97bf1c152
-SHA256 (xsane-0.999.tar.gz) = 5782d23e67dc961c81eef13a87b17eb0144cae3d1ffc5cf7e0322da751482b4b
diff --git a/xsane/Pkgfile b/xsane/Pkgfile
deleted file mode 100644
index 4007994b5..000000000
--- a/xsane/Pkgfile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Description: Scanner frontend and GIMP plugin for sane
-# URL: http://www.sane-project.org
-# Maintainer: Juergen Daubert, jue at crux dot nu
-# Depends on: gimp, sane
-
-name=xsane
-version=0.999
-release=1
-source=(https://fossies.org/linux/misc/$name-$version.tar.gz)
-
-build () {
- cd $name-$version
-
- # http://www.linuxfromscratch.org/blfs/view/svn/pst/xsane.html
- sed -i -e 's/png_ptr->jmpbuf/png_jmpbuf(png_ptr)/' src/xsane-save.c
-
- ./configure --prefix=/usr \
- --mandir=/usr/share/man \
- --disable-nls \
- --enable-gtk2 \
- --enable-gimp2
- make
- make DESTDIR=$PKG install
-
- rm -r $PKG/usr/{sbin,share/sane/xsane/doc}
- rm $PKG/usr/share/sane/xsane/xsane-gpl.txt
-
- install -d $PKG/usr/lib/gimp/2.0/plug-ins
- ln -s /usr/bin/xsane $PKG/usr/lib/gimp/2.0/plug-ins
-}
1
0
commit f240092870d5fe4723c3bb3f81b90b4d03346ee2
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:32:29 2023 +0100
qpdf: update to 11.3.0
diff --git a/qpdf/.footprint b/qpdf/.footprint
index 3a4ee6813..128aa0d11 100644
--- a/qpdf/.footprint
+++ b/qpdf/.footprint
@@ -82,8 +82,8 @@ drwxr-xr-x root/root usr/lib/cmake/qpdf/
-rw-r--r-- root/root usr/lib/cmake/qpdf/qpdfConfigVersion.cmake
-rw-r--r-- root/root usr/lib/libqpdf.a
lrwxrwxrwx root/root usr/lib/libqpdf.so -> libqpdf.so.29
-lrwxrwxrwx root/root usr/lib/libqpdf.so.29 -> libqpdf.so.29.2.0
--rwxr-xr-x root/root usr/lib/libqpdf.so.29.2.0
+lrwxrwxrwx root/root usr/lib/libqpdf.so.29 -> libqpdf.so.29.3.0
+-rwxr-xr-x root/root usr/lib/libqpdf.so.29.3.0
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/libqpdf.pc
drwxr-xr-x root/root usr/share/
diff --git a/qpdf/.signature b/qpdf/.signature
index f8ac2e7cf..704dd68ef 100644
--- a/qpdf/.signature
+++ b/qpdf/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/cbyYE9ZXeLjmb/NNqx7y8UOXePr2bN95MiggWBtoSYKiqfpokdB7VFfj6gDNAjUM/1lbrUuChyCVlrPrizZPAg=
-SHA256 (Pkgfile) = 06220b93fefdbdafcede5b9a11ae292a1f697819520c162a4efc791ebb7e91ca
-SHA256 (.footprint) = f5a3cca8c0c4b1ffe3f4631488137f257620cc32d3e079a2a8f8743ccbe00e8d
-SHA256 (qpdf-11.2.0.tar.gz) = fbd2d75050933487929dbbe1b5c50a238487194bc7263c277d6e49abb90ab7f2
+RWSE3ohX2g5d/X3bLFHJid3N5vns0XQEaXrqk0tv6jvGaf0UEoV7nHVCp+gbnN0Ai9F2+oNH/6gyJJ3QK5JBGDRCfPt6U5UqCgQ=
+SHA256 (Pkgfile) = 19a3868a3163ba9f15c7d41408ff2ca9fde043fdfa1442b0d77d566bef08d6a3
+SHA256 (.footprint) = 86140ca8319725c51e762fb7498738dbd662c77a5b40ac86de80e236e4152300
+SHA256 (qpdf-11.3.0.tar.gz) = 547cee67de77b5c4ef4917e57d2db9c848cfe3aa950361f68d36367a3a03936e
diff --git a/qpdf/Pkgfile b/qpdf/Pkgfile
index dc810eadf..cd299ebfc 100644
--- a/qpdf/Pkgfile
+++ b/qpdf/Pkgfile
@@ -5,12 +5,12 @@
# Optional: gnutls
name=qpdf
-version=11.2.0
+version=11.3.0
release=1
source=(http://downloads.sourceforge.net/project/$name/$name/$version/$name…
build() {
- cmake -S $name-$version -B build \
+ cmake -S $name-$version -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=/usr/lib \
-D CMAKE_BUILD_TYPE=Release \
1
0
commit 9c6ec6d70520359806df2fa72f3ebe09e1239d28
Author: Juergen Daubert <jue(a)jue.li>
Date: Sun Feb 26 15:32:08 2023 +0100
fetchmail: update to 6.4.37
diff --git a/fetchmail/.signature b/fetchmail/.signature
index 5e9d601d4..013af9924 100644
--- a/fetchmail/.signature
+++ b/fetchmail/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/be3l/M4hRtolAdaZEety/UFhXB9o2o5ZBGPAQNLuFAzy9iC6+uC8BFBDfUH4eQlNKvuXRXTR1uP56X9dYOQqgw=
-SHA256 (Pkgfile) = 86130651dfa1e61b6307e4921f1ef12738283cc26e3cf59016d166c11fd26f1c
+RWSE3ohX2g5d/UupNCCJZZITCF5Ormo4IQnCKRZg4ec90FF9g4B1aRZ+ai88VprwBxWNffIWJSNWmhsZbx529lpRTdn3yKRx0wA=
+SHA256 (Pkgfile) = 9b91fdc994fbbfec9fc605286e318cd76649559fcc59f2f7a8186ec3e1d45f81
SHA256 (.footprint) = c52f9b61b3ffbab88aa941546c7721245d6c825056bd4948b84b94966203996d
-SHA256 (fetchmail-6.4.36.tar.xz) = 700d433838d3e29e304452aec56b21874f538ec24113fdcbb25139c5f2edc23a
+SHA256 (fetchmail-6.4.37.tar.xz) = 4a182e5d893e9abe6ac37ae71e542651fce6d606234fc735c2aaae18657e69ea
diff --git a/fetchmail/Pkgfile b/fetchmail/Pkgfile
index b1db919d7..a816bfad2 100644
--- a/fetchmail/Pkgfile
+++ b/fetchmail/Pkgfile
@@ -4,7 +4,7 @@
# Depends on: openssl
name=fetchmail
-version=6.4.36
+version=6.4.37
release=1
source=(https://downloads.sourceforge.net/project/$name/branch_${version%.*…
1
0