summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-11-16 16:36:54 +1100
committerSebastian Dröge <sebastian@centricular.com>2017-11-20 10:32:55 +0200
commit12a8f0f9f369480e9761f4f2176522beb6305080 (patch)
treebd5ba9cadb1268ef3d80ce5fbcc160261fb5e28d
parent39203b26e854903bcfe8ddfc81e31517dab57038 (diff)
gettext: Fix 'Illegal Instruction 4' on macOS 10.13
e.g. https://stackoverflow.com/questions/46726504/bison-3-0-4-fails-in-illegal-instruction-4-on-macos-high-sierra-10-13
-rw-r--r--recipes/build-tools/gettext-m4.recipe2
-rw-r--r--recipes/build-tools/gettext-tools.recipe3
-rw-r--r--recipes/gettext.recipe3
-rw-r--r--recipes/gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch69
4 files changed, 75 insertions, 2 deletions
diff --git a/recipes/build-tools/gettext-m4.recipe b/recipes/build-tools/gettext-m4.recipe
index 186f3b85..f6215ee2 100644
--- a/recipes/build-tools/gettext-m4.recipe
+++ b/recipes/build-tools/gettext-m4.recipe
@@ -12,6 +12,8 @@ class Recipe(recipe.Recipe):
autoreconf = True
btype = BuildType.CUSTOM
+ patches = ['../gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch']
+
files_devel = [
'share/aclocal/codeset.m4',
'share/aclocal/fcntl-o.m4',
diff --git a/recipes/build-tools/gettext-tools.recipe b/recipes/build-tools/gettext-tools.recipe
index 9b0529f9..63573798 100644
--- a/recipes/build-tools/gettext-tools.recipe
+++ b/recipes/build-tools/gettext-tools.recipe
@@ -14,7 +14,8 @@ class Recipe(recipe.Recipe):
Platform.WINDOWS: ['libiconv', 'mingw-runtime'],}
configure_options = ' --disable-java --disable-csharp --disable-native-java --without-csv'
patches = ['../gettext/0001-Fix-linker-error-redefinition-of-vasprintf.patch',
- '../gettext/0001-Undefine-__USE_MINGW_ANSI_STDIO-as-otherwise-stdio.h.patch' ]
+ '../gettext/0001-Undefine-__USE_MINGW_ANSI_STDIO-as-otherwise-stdio.h.patch',
+ '../gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch' ]
def prepare(self):
if self.config.target_platform == Platform.WINDOWS:
diff --git a/recipes/gettext.recipe b/recipes/gettext.recipe
index d1904610..d7043b19 100644
--- a/recipes/gettext.recipe
+++ b/recipes/gettext.recipe
@@ -10,7 +10,8 @@ class Recipe(recipe.Recipe):
url = 'http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.8.1.tar.gz'
srcdir = 'gettext-runtime'
patches = ['gettext/0001-Fix-linker-error-redefinition-of-vasprintf.patch',
- 'gettext/0001-Undefine-__USE_MINGW_ANSI_STDIO-as-otherwise-stdio.h.patch' ]
+ 'gettext/0001-Undefine-__USE_MINGW_ANSI_STDIO-as-otherwise-stdio.h.patch',
+ 'gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch' ]
platform_deps = {
Platform.ANDROID: ['libiconv'],
Platform.WINDOWS: ['mingw-runtime'],
diff --git a/recipes/gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch b/recipes/gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch
new file mode 100644
index 00000000..366c9f02
--- /dev/null
+++ b/recipes/gettext/0001-Fix-build-invalid-instruction-on-macOS-10.13.patch
@@ -0,0 +1,69 @@
+From ec2d9a1b91c238a55784d6d75008290acae49246 Mon Sep 17 00:00:00 2001
+From: Matthew Waters <matthew@centricular.com>
+Date: Thu, 16 Nov 2017 16:29:08 +1100
+Subject: [PATCH] Fix build/invalid instruction on macOS 10.13
+
+Similar issue for bison:
+https://stackoverflow.com/questions/46726504/bison-3-0-4-fails-in-illegal-instruction-4-on-macos-high-sierra-10-13
+---
+ gettext-runtime/intl/vasnprintf.c | 2 +-
+ gettext-runtime/libasprintf/vasnprintf.c | 2 +-
+ gettext-tools/gnulib-lib/vasnprintf.c | 2 +-
+ gettext-tools/libgettextpo/vasnprintf.c | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c
+index 236bfe5..48f91cd 100644
+--- a/gettext-runtime/intl/vasnprintf.c
++++ b/gettext-runtime/intl/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+ *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !((defined __APPLE__ && __clang_major__ >= 9) || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c
+index 236bfe5..4b1d63a 100644
+--- a/gettext-runtime/libasprintf/vasnprintf.c
++++ b/gettext-runtime/libasprintf/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+ *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !((defined __APPLE__ && __clang_major__ >= 9) || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__):)
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+diff --git a/gettext-tools/gnulib-lib/vasnprintf.c b/gettext-tools/gnulib-lib/vasnprintf.c
+index 72bf3bc..065e9c6 100644
+--- a/gettext-tools/gnulib-lib/vasnprintf.c
++++ b/gettext-tools/gnulib-lib/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+ *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !((defined __APPLE__ && __clang_major__ >= 9) || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+diff --git a/gettext-tools/libgettextpo/vasnprintf.c b/gettext-tools/libgettextpo/vasnprintf.c
+index 72bf3bc..065e9c6 100644
+--- a/gettext-tools/libgettextpo/vasnprintf.c
++++ b/gettext-tools/libgettextpo/vasnprintf.c
+@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+ *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !((defined __APPLE__ && __clang_major__ >= 9) || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+--
+2.15.0
+