]> Savannah Git Hosting - gnulib.git/commitdiff
localename, gettext: Avoid crash on macOS 14.
authorBruno Haible <bruno@clisp.org>
Mon, 2 Oct 2023 22:28:31 +0000 (00:28 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 3 Oct 2023 07:49:25 +0000 (09:49 +0200)
Reported by Shupeng Xue <dspxue@gmail.com> at
<https://lists.gnu.org/archive/html/bug-gettext/2023-10/msg00001.html>.

Cf <https://github.com/aria2/aria2/issues/2083#issuecomment-1694662007>.

* m4/intlmacosx.m4 (gt_INTL_MACOSX): Link with the CoreServices
framework in addition to the CoreFoundation framework.

ChangeLog
m4/intlmacosx.m4

index def332398f7766a033d6a531f34d8aeb65a88ccc..1112ba613ddd103f59dadccee434ddf281e0ca18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-10-02  Bruno Haible  <bruno@clisp.org>
+
+       localename, gettext: Avoid crash on macOS 14.
+       Reported by Shupeng Xue <dspxue@gmail.com> at
+       <https://lists.gnu.org/archive/html/bug-gettext/2023-10/msg00001.html>.
+       Cf <https://github.com/aria2/aria2/issues/2083#issuecomment-1694662007>.
+       * m4/intlmacosx.m4 (gt_INTL_MACOSX): Link with the CoreServices
+       framework in addition to the CoreFoundation framework.
+
 2023-10-02  Bruno Haible  <bruno@clisp.org>
 
        localcharset: Avoid internal compiler error with -Wextra on macOS 10.5.
index 81eefd750b52e29b6a2c884467f2439179a6b6df..3141bf8c5e4c949f03d4757701ca9c5fc3c6c9a1 100644 (file)
@@ -1,4 +1,4 @@
-# intlmacosx.m4 serial 8 (gettext-0.20.2)
+# intlmacosx.m4 serial 9 (gettext-0.22.3)
 dnl Copyright (C) 2004-2014, 2016, 2019-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -59,7 +59,11 @@ AC_DEFUN([gt_INTL_MACOSX],
   INTL_MACOSX_LIBS=
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
      || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
-    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+    dnl Starting with macOS version 14, CoreFoundation relies on CoreServices,
+    dnl and we have to link it in explicitly, otherwise an exception
+    dnl NSInvalidArgumentException "unrecognized selector sent to instance"
+    dnl occurs.
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreServices"
   fi
   AC_SUBST([INTL_MACOSX_LIBS])
 ])