diff options
author | Tim-Philipp Muller <tim@centricular.com> | 2022-12-26 12:00:19 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2023-01-12 21:57:08 +0000 |
commit | 6320aaccc5a0f67fd9c1554a1758d685d859ae2f (patch) | |
tree | 8a5c635ef16a620c7c8f55a8f0743e1a46a2fc6c /recipes | |
parent | 8c02c7bfd2d6797a614d30ae6daff3f2b89bb6ac (diff) |
glib: add workaround for clang toolchain issue on 32-bit armv7/x86
To fix gdk-pixbuf build issues when using g_uint64_checked_mul()
and friends.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/864>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/glib.recipe | 2 | ||||
-rw-r--r-- | recipes/glib/0001-gtypes.h-workaround-for-g_uint64_checked_mul-issue-w.patch | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/recipes/glib.recipe b/recipes/glib.recipe index 0b02a56e..d9d79982 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -40,6 +40,8 @@ class Recipe(recipe.Recipe): 'glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch', # TODO upstreaming 'glib/0001-gio-gsocket-fix-compiler-warnings-on-armv7-Android.patch', + # TODO upstreaming + 'glib/0001-gtypes.h-workaround-for-g_uint64_checked_mul-issue-w.patch', ] files_libs = [ diff --git a/recipes/glib/0001-gtypes.h-workaround-for-g_uint64_checked_mul-issue-w.patch b/recipes/glib/0001-gtypes.h-workaround-for-g_uint64_checked_mul-issue-w.patch new file mode 100644 index 00000000..7a49e87c --- /dev/null +++ b/recipes/glib/0001-gtypes.h-workaround-for-g_uint64_checked_mul-issue-w.patch @@ -0,0 +1,46 @@ +From 83d3c22ad4ce732e5a4f060aa74550585a1d0549 Mon Sep 17 00:00:00 2001 +From: Tim-Philipp Muller <tim@centricular.com> +Date: Mon, 26 Dec 2022 11:56:42 +0000 +Subject: [PATCH] gtypes.h: workaround for g_uint64_checked_mul() issue with + clang on 32-bit ARM + +gdk-pixbuf would fail to build on Android on armv7, with: + + error: undefined reference to '__multi3' + +and on x86 with + + error: undefined reference to '__mulodi4' + +which looks like a toolchain issue, so hack around it for now by making +it not use the builtins in that case. + +https://reviews.llvm.org/D103906 +https://bugs.llvm.org/show_bug.cgi?id=16404 +https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/864#note_1698211 +--- + glib/gtypes.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/glib/gtypes.h b/glib/gtypes.h +index 8ef1909..3edf0dc 100644 +--- a/glib/gtypes.h ++++ b/glib/gtypes.h +@@ -452,6 +452,14 @@ typedef const gchar * (*GTranslateFunc) (const gchar *str, + #endif + #endif + ++/* HACK: work around clang toolchain issue on android armv7/x86 compiling gdk-pixbuf ++ * in GStreamer cerbero: https://reviews.llvm.org/D103906 (undefined ref to __multi3) ++ * Android (5900059 based on r365631c) clang version 9.0.8 ++ * https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/864#note_1698211 */ ++#if defined(__clang__) && !defined(CRT_HAS_128BIT) ++#undef _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS ++#endif ++ + #ifdef _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS + + #define g_uint_checked_add(dest, a, b) \ +-- +2.30.2 + |