From dcef17d26ae5170f8b5f315fa06dfc45ca844906 Mon Sep 17 00:00:00 2001 From: Peter Zhigalov Date: Mon, 26 Sep 2022 10:33:39 +0700 Subject: [PATCH] Fix -Wunguarded-availability-new warnings --- modulesets/bootstrap.modules | 50 +++++++++++-------- ...1-GETTEXT-disable-futimens-utimensat.patch | 38 ++++++++++++++ patches/0001-GLIB-disable-utimensat.patch | 47 +++++++++++++++++ ...acOS-10.13-guard-for-inflateValidate.patch | 28 +++++++++++ ...emove-error-on-build-for-macos-11.0.patch} | 17 ++++--- patches/0001-XZ-disable-futimens.patch | 27 ++++++++++ 6 files changed, 179 insertions(+), 28 deletions(-) create mode 100644 patches/0001-GETTEXT-disable-futimens-utimensat.patch create mode 100644 patches/0001-GLIB-disable-utimensat.patch create mode 100644 patches/0001-LIBPNG-add-macOS-10.13-guard-for-inflateValidate.patch rename patches/{0001-PCRE2-remove-unneeded-macOS-version-check.patch => 0001-PCRE2-remove-error-on-build-for-macos-11.0.patch} (53%) create mode 100644 patches/0001-XZ-disable-futimens.patch diff --git a/modulesets/bootstrap.modules b/modulesets/bootstrap.modules index cded143..a418c47 100644 --- a/modulesets/bootstrap.modules +++ b/modulesets/bootstrap.modules @@ -52,11 +52,15 @@ - + + + - + + + @@ -64,7 +68,7 @@ - + @@ -117,7 +121,9 @@ - + + + @@ -140,7 +146,7 @@ - + @@ -156,7 +162,7 @@ - + @@ -179,12 +185,14 @@ - + - + + + @@ -192,7 +200,7 @@ - + @@ -228,18 +236,18 @@ - + - + - + @@ -252,7 +260,7 @@ - + @@ -260,7 +268,7 @@ - + @@ -269,11 +277,11 @@ - + - + @@ -301,7 +309,7 @@ - + @@ -318,14 +326,14 @@ - + - + @@ -333,7 +341,7 @@ - + @@ -355,7 +363,7 @@ - + diff --git a/patches/0001-GETTEXT-disable-futimens-utimensat.patch b/patches/0001-GETTEXT-disable-futimens-utimensat.patch new file mode 100644 index 0000000..ba3fbaa --- /dev/null +++ b/patches/0001-GETTEXT-disable-futimens-utimensat.patch @@ -0,0 +1,38 @@ +From 38a2bd810baf13107a87eb86087d0a24c47b0396 Mon Sep 17 00:00:00 2001 +From: Peter Zhigalov +Date: Mon, 26 Sep 2022 09:08:56 +0700 +Subject: [PATCH] GETTEXT: disable futimens/utimensat + +--- + gettext-tools/config.h.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/gettext-tools/config.h.in b/gettext-tools/config.h.in +index 030077b..346fec2 100644 +--- a/gettext-tools/config.h.in ++++ b/gettext-tools/config.h.in +@@ -1044,7 +1044,10 @@ + #undef HAVE_FUNLOCKFILE + + /* Define to 1 if you have the `futimens' function. */ ++/* ++// warning: 'futimens' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] + #undef HAVE_FUTIMENS ++*/ + + /* Define to 1 if you have the `futimes' function. */ + #undef HAVE_FUTIMES +@@ -1697,7 +1700,10 @@ + #undef HAVE_UTIME + + /* Define to 1 if you have the `utimensat' function. */ ++/* ++// warning: 'utimensat' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] + #undef HAVE_UTIMENSAT ++*/ + + /* Define to 1 if you have the header file. */ + #undef HAVE_UTIME_H +-- +2.37.0 (Apple Git-136) + diff --git a/patches/0001-GLIB-disable-utimensat.patch b/patches/0001-GLIB-disable-utimensat.patch new file mode 100644 index 0000000..ebb20d9 --- /dev/null +++ b/patches/0001-GLIB-disable-utimensat.patch @@ -0,0 +1,47 @@ +From 6506b885fa34679df2c35bc281ea35fb8ee8129b Mon Sep 17 00:00:00 2001 +From: Peter Zhigalov +Date: Mon, 26 Sep 2022 09:33:09 +0700 +Subject: [PATCH] GLIB: disable utimensat + +--- + gio/glocalfileinfo.c | 2 ++ + meson.build | 3 ++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c +index 6f18695..c9e5c8b 100644 +--- a/gio/glocalfileinfo.c ++++ b/gio/glocalfileinfo.c +@@ -2800,6 +2800,7 @@ set_mtime_atime (char *filename, + return FALSE; + } + ++#if defined (HAVE_UTIMENSAT) + res = utimensat (AT_FDCWD, filename, times_n, 0); + if (res == -1) + { +@@ -2811,6 +2812,7 @@ set_mtime_atime (char *filename, + g_strerror (errsv)); + return FALSE; + } ++#endif + return TRUE; + } + #endif +diff --git a/meson.build b/meson.build +index 3aa1a10..d7118fd 100644 +--- a/meson.build ++++ b/meson.build +@@ -635,7 +635,8 @@ functions = [ + 'unsetenv', + 'uselocale', + 'utimes', +- 'utimensat', ++ # warning: 'utimensat' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] ++ # 'utimensat', + 'valloc', + 'vasprintf', + 'vsnprintf', +-- +2.37.0 (Apple Git-136) + diff --git a/patches/0001-LIBPNG-add-macOS-10.13-guard-for-inflateValidate.patch b/patches/0001-LIBPNG-add-macOS-10.13-guard-for-inflateValidate.patch new file mode 100644 index 0000000..bf97603 --- /dev/null +++ b/patches/0001-LIBPNG-add-macOS-10.13-guard-for-inflateValidate.patch @@ -0,0 +1,28 @@ +From 9f48523e5c41afb145349f4b7f4bbe9a0e520bf3 Mon Sep 17 00:00:00 2001 +From: Peter Zhigalov +Date: Mon, 26 Sep 2022 09:18:50 +0700 +Subject: [PATCH] LIBPNG: add macOS 10.13 guard for inflateValidate + +--- + pngrutil.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/pngrutil.c b/pngrutil.c +index ca060dd..610272c 100644 +--- a/pngrutil.c ++++ b/pngrutil.c +@@ -425,7 +425,10 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) + defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) + if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) + /* Turn off validation of the ADLER32 checksum in IDAT chunks */ +- ret = inflateValidate(&png_ptr->zstream, 0); ++ /* warning: 'inflateValidate' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] */ ++ if (__builtin_available(macOS 10.13, *)) { ++ ret = inflateValidate(&png_ptr->zstream, 0); ++ } + #endif + + if (ret == Z_OK) +-- +2.37.0 (Apple Git-136) + diff --git a/patches/0001-PCRE2-remove-unneeded-macOS-version-check.patch b/patches/0001-PCRE2-remove-error-on-build-for-macos-11.0.patch similarity index 53% rename from patches/0001-PCRE2-remove-unneeded-macOS-version-check.patch rename to patches/0001-PCRE2-remove-error-on-build-for-macos-11.0.patch index 66c8ce2..7fa3062 100644 --- a/patches/0001-PCRE2-remove-unneeded-macOS-version-check.patch +++ b/patches/0001-PCRE2-remove-error-on-build-for-macos-11.0.patch @@ -1,25 +1,28 @@ -From af11089244154e613cf3c265cee152216be40516 Mon Sep 17 00:00:00 2001 +From 0dfb08db4b77545d730d2c65b6a3b30ccfe8684f Mon Sep 17 00:00:00 2001 From: Peter Zhigalov Date: Tue, 20 Sep 2022 23:28:42 +0700 -Subject: [PATCH] PCRE2: remove unneeded macOS version check +Subject: [PATCH] PCRE2: remove error on build for macos < 11.0 --- - src/sljit/sljitExecAllocator.c | 4 ---- - 1 file changed, 4 deletions(-) + src/sljit/sljitExecAllocator.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/sljit/sljitExecAllocator.c b/src/sljit/sljitExecAllocator.c -index 92d940d..30b23d5 100644 +index 92d940d..b9d0e33 100644 --- a/src/sljit/sljitExecAllocator.c +++ b/src/sljit/sljitExecAllocator.c -@@ -150,11 +150,7 @@ static SLJIT_INLINE int get_map_jit_flag() +@@ -150,11 +150,9 @@ static SLJIT_INLINE int get_map_jit_flag() static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 - pthread_jit_write_protect_np(enable_exec); +- pthread_jit_write_protect_np(enable_exec); -#else -#error "Must target Big Sur or newer" -#endif /* BigSur */ ++ if (__builtin_available(macOS 11.0, *)) { ++ pthread_jit_write_protect_np(enable_exec); ++ } } #endif /* SLJIT_CONFIG_X86 */ #else /* !TARGET_OS_OSX */ diff --git a/patches/0001-XZ-disable-futimens.patch b/patches/0001-XZ-disable-futimens.patch new file mode 100644 index 0000000..cecee18 --- /dev/null +++ b/patches/0001-XZ-disable-futimens.patch @@ -0,0 +1,27 @@ +From f641dccf2eebd527d5a6e8073d1b813766a43929 Mon Sep 17 00:00:00 2001 +From: Peter Zhigalov +Date: Mon, 26 Sep 2022 08:59:50 +0700 +Subject: [PATCH] XZ: disable futimens + +--- + config.h.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/config.h.in b/config.h.in +index c8ba420..f95b12c 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -133,7 +133,10 @@ + #undef HAVE_FCNTL_H + + /* Define to 1 if you have the `futimens' function. */ ++/* ++// warning: 'futimens' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] + #undef HAVE_FUTIMENS ++*/ + + /* Define to 1 if you have the `futimes' function. */ + #undef HAVE_FUTIMES +-- +2.37.0 (Apple Git-136) +