download.lst                                                                   
       |    4 
 
external/postgresql/0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1
 |  190 ----------
 external/postgresql/UnpackedTarball_postgresql.mk                              
       |    1 
 3 files changed, 2 insertions(+), 193 deletions(-)

New commits:
commit 9d9345877a898ab4d216c82475f08a408e4cbf33
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri May 9 08:36:18 2025 +0200
Commit:     Christian Lohmaier <[email protected]>
CommitDate: Mon May 19 19:00:33 2025 +0200

    postgresql: upgrade to 14.18
    
    * 0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1 has
    been fixed upstream
    Downloaded from 
https://ftp.postgresql.org/pub/source/v14.18/postgresql-14.18.tar.bz2
    
    Change-Id: I59fc2b25c25e9eb7a8e408b7f9555a8663f29f87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185080
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <[email protected]>

diff --git a/download.lst b/download.lst
index 71e038197b60..12c479a98664 100644
--- a/download.lst
+++ b/download.lst
@@ -585,8 +585,8 @@ POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-POSTGRESQL_SHA256SUM := 
6ce0ccd6403bf7f0f2eddd333e2ee9ba02edfa977c66660ed9b4b1057e7630a1
-POSTGRESQL_TARBALL := postgresql-14.17.tar.bz2
+POSTGRESQL_SHA256SUM := 
83ab29d6bfc3dc58b2ed3c664114fdfbeb6a0450c4b8d7fa69aee91e3ca14f8e
+POSTGRESQL_TARBALL := postgresql-14.18.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git 
a/external/postgresql/0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1
 
b/external/postgresql/0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1
deleted file mode 100644
index cba40cb565d6..000000000000
--- 
a/external/postgresql/0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1
+++ /dev/null
@@ -1,190 +0,0 @@
-From 71790aef1a6eea6f9662a1edcd669d89d5486b03 Mon Sep 17 00:00:00 2001
-From: Tom Lane <[email protected]>
-Date: Tue, 1 Apr 2025 16:49:51 -0400
-Subject: [PATCH] Fix detection and handling of strchrnul() for macOS 15.4.
-
-As of 15.4, macOS has strchrnul(), but access to it is blocked behind
-a check for MACOSX_DEPLOYMENT_TARGET >= 15.4.  But our does-it-link
-configure check finds it, so we try to use it, and fail with the
-present default deployment target (namely 15.0).  This accounts for
-today's buildfarm failures on indri and sifaka.
-
-This is the identical problem that we faced some years ago when Apple
-introduced preadv and pwritev in the same way.  We solved that in
-commit f014b1b9b by using AC_CHECK_DECLS instead of AC_CHECK_FUNCS
-to check the functions' availability.  So do the same now for
-strchrnul().  Interestingly, we already had a workaround for
-"the link check doesn't agree with <string.h>" cases with glibc,
-which we no longer need since only the header declaration is being
-checked.
-
-Testing this revealed that the meson version of this check has never
-worked, because it failed to use "-Werror=unguarded-availability-new".
-(Apparently nobody's tried to build with meson on macOS versions that
-lack preadv/pwritev as standard.)  Adjust that while at it.  Also,
-we had never put support for "-Werror=unguarded-availability-new"
-into v13, but we need that now.
-
-Co-authored-by: Tom Lane <[email protected]>
-Co-authored-by: Peter Eisentraut <[email protected]>
-Discussion: https://postgr.es/m/[email protected]
-Backpatch-through: 13
----
- configure                  | 14 +++++++++++++-
- configure.ac               |  2 +-
- src/include/pg_config.h.in |  7 ++++---
- src/port/snprintf.c        | 29 +++++++++++++----------------
- src/tools/msvc/Solution.pm |  2 +-
- 5 files changed, 32 insertions(+), 22 deletions(-)
-
-diff --git a/configure b/configure
-index fa9085b1c0d..33bc3203b36 100755
---- a/configure
-+++ b/configure
-@@ -16037,7 +16037,7 @@ fi
- LIBS_including_readline="$LIBS"
- LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
- 
--for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs 
getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll 
pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast 
setsid shm_open strchrnul strsignal symlink syncfs sync_file_range uselocale 
wcstombs_l writev
-+for ac_func in backtrace_symbols clock_gettime copyfile fdatasync getifaddrs 
getpeerucred getrlimit kqueue mbstowcs_l memset_s poll posix_fallocate ppoll 
pstat pthread_is_threaded_np readlink readv setproctitle setproctitle_fast 
setsid shm_open strsignal symlink syncfs sync_file_range uselocale wcstombs_l 
writev
- do :
-   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
- ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-@@ -16601,6 +16601,18 @@ esac
- 
- fi
- 
-+ac_fn_c_check_decl "$LINENO" "strchrnul" "ac_cv_have_decl_strchrnul" 
"#include <string.h>
-+"
-+if test "x$ac_cv_have_decl_strchrnul" = xyes; then :
-+  ac_have_decl=1
-+else
-+  ac_have_decl=0
-+fi
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE_DECL_STRCHRNUL $ac_have_decl
-+_ACEOF
-+
- 
- # This is probably only present on macOS, but may as well check always
- ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" 
"#include <fcntl.h>
-diff --git a/configure.ac b/configure.ac
-index 35dc9f74b73..53d341c1751 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1807,7 +1807,6 @@ AC_CHECK_FUNCS(m4_normalize([
-       setproctitle_fast
-       setsid
-       shm_open
--      strchrnul
-       strsignal
-       symlink
-       syncfs
-@@ -1849,6 +1848,7 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
- # won't handle deployment target restrictions on macOS
- AC_CHECK_DECLS([preadv], [], [AC_LIBOBJ(preadv)], [#include <sys/uio.h>])
- AC_CHECK_DECLS([pwritev], [], [AC_LIBOBJ(pwritev)], [#include <sys/uio.h>])
-+AC_CHECK_DECLS([strchrnul], [], [], [#include <string.h>])
- 
- # This is probably only present on macOS, but may as well check always
- AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
-diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
-index d9ef9a41bf2..605c830a1b2 100644
---- a/src/include/pg_config.h.in
-+++ b/src/include/pg_config.h.in
-@@ -155,6 +155,10 @@
-    don't. */
- #undef HAVE_DECL_RTLD_NOW
- 
-+/* Define to 1 if you have the declaration of `strchrnul', and to 0 if you
-+   don't. */
-+#undef HAVE_DECL_STRCHRNUL
-+
- /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
-    don't. */
- #undef HAVE_DECL_STRLCAT
-@@ -523,9 +527,6 @@
- /* Define to 1 if you have the <stdlib.h> header file. */
- #undef HAVE_STDLIB_H
- 
--/* Define to 1 if you have the `strchrnul' function. */
--#undef HAVE_STRCHRNUL
--
- /* Define to 1 if you have the `strerror_r' function. */
- #undef HAVE_STRERROR_R
- 
-diff --git a/src/port/snprintf.c b/src/port/snprintf.c
-index 8306ab4f2b8..79c5f523bf1 100644
---- a/src/port/snprintf.c
-+++ b/src/port/snprintf.c
-@@ -348,13 +348,22 @@ static void leading_pad(int zpad, int signvalue, int 
*padlen,
- static void trailing_pad(int padlen, PrintfTarget *target);
- 
- /*
-- * If strchrnul exists (it's a glibc-ism), it's a good bit faster than the
-- * equivalent manual loop.  If it doesn't exist, provide a replacement.
-+ * If strchrnul exists (it's a glibc-ism, but since adopted by some other
-+ * platforms), it's a good bit faster than the equivalent manual loop.
-+ * Use it if possible, and if it doesn't exist, use this replacement.
-  *
-  * Note: glibc declares this as returning "char *", but that would require
-  * casting away const internally, so we don't follow that detail.
-+ *
-+ * Note: macOS has this too as of Sequoia 15.4, but it's hidden behind
-+ * a deployment-target check that causes compile errors if the deployment
-+ * target isn't high enough.  So !HAVE_DECL_STRCHRNUL may mean "yes it's
-+ * declared, but it doesn't compile".  To avoid failing in that scenario,
-+ * use a macro to avoid matching <string.h>'s name.
-  */
--#ifndef HAVE_STRCHRNUL
-+#if !HAVE_DECL_STRCHRNUL
-+
-+#define strchrnul pg_strchrnul
- 
- static inline const char *
- strchrnul(const char *s, int c)
-@@ -364,19 +373,7 @@ strchrnul(const char *s, int c)
-       return s;
- }
- 
--#else
--
--/*
-- * glibc's <string.h> declares strchrnul only if _GNU_SOURCE is defined.
-- * While we typically use that on glibc platforms, configure will set
-- * HAVE_STRCHRNUL whether it's used or not.  Fill in the missing declaration
-- * so that this file will compile cleanly with or without _GNU_SOURCE.
-- */
--#ifndef _GNU_SOURCE
--extern char *strchrnul(const char *s, int c);
--#endif
--
--#endif                                                        /* 
HAVE_STRCHRNUL */
-+#endif                                                        /* 
!HAVE_DECL_STRCHRNUL */
- 
- 
- /*
-diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
-index f0ce2ac8040..040e9d98b1f 100644
---- a/src/tools/msvc/Solution.pm
-+++ b/src/tools/msvc/Solution.pm
-@@ -248,6 +248,7 @@ sub GenerateFiles
-               HAVE_DECL_PWRITEV                           => 0,
-               HAVE_DECL_RTLD_GLOBAL                       => 0,
-               HAVE_DECL_RTLD_NOW                          => 0,
-+              HAVE_DECL_STRCHRNUL                         => 0,
-               HAVE_DECL_STRLCAT                           => 0,
-               HAVE_DECL_STRLCPY                           => 0,
-               HAVE_DECL_STRNLEN                           => 1,
-@@ -367,7 +368,6 @@ sub GenerateFiles
-               HAVE_SRANDOM                             => undef,
-               HAVE_STDINT_H                            => 1,
-               HAVE_STDLIB_H                            => 1,
--              HAVE_STRCHRNUL                           => undef,
-               HAVE_STRERROR_R                          => undef,
-               HAVE_STRINGS_H                           => undef,
-               HAVE_STRING_H                            => 1,
--- 
-2.39.5
-
diff --git a/external/postgresql/UnpackedTarball_postgresql.mk 
b/external/postgresql/UnpackedTarball_postgresql.mk
index fa97e1e13391..11fb603ef34f 100644
--- a/external/postgresql/UnpackedTarball_postgresql.mk
+++ b/external/postgresql/UnpackedTarball_postgresql.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,postgresql, \
        external/postgresql/windows.patch.0 \
        external/postgresql/postgresql.exit.patch.0 \
        external/postgresql/postgres-msvc-build.patch.1 \
-       
external/postgresql/0001-Fix-detection-and-handling-of-strchrnul-for-macOS-15.patch.1
 \
        $(if $(filter WNT_AARCH64,$(OS)_$(CPUNAME)), 
external/postgresql/arm64.patch.1) \
 ))
 

Reply via email to