summaryrefslogtreecommitdiff
path: root/extra/glib
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-01 21:21:05 +0000
committerdavidovski <david@davidovski.xyz>2022-05-01 21:21:05 +0000
commit606bc59d0f8f67815c6a717843835477d44db6b3 (patch)
tree687b3fe5bc844b90a3841e1ea543aa9f9934a93a /extra/glib
parent1084afc3c4d9c83e61620de60ba59a4393a33cb0 (diff)
added ungoogled chromium
Diffstat (limited to 'extra/glib')
-rw-r--r--extra/glib/0001-gquark-fix-initialization-with-c-constructors.patch47
-rw-r--r--extra/glib/deprecated-no-warn.patch23
-rw-r--r--extra/glib/musl-libintl.patch22
3 files changed, 92 insertions, 0 deletions
diff --git a/extra/glib/0001-gquark-fix-initialization-with-c-constructors.patch b/extra/glib/0001-gquark-fix-initialization-with-c-constructors.patch
new file mode 100644
index 0000000..50a9a8c
--- /dev/null
+++ b/extra/glib/0001-gquark-fix-initialization-with-c-constructors.patch
@@ -0,0 +1,47 @@
+From e4216dee57f5156e192b2910f13eb855a104cb18 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 6 Jul 2016 12:38:40 +0200
+Subject: [PATCH] gquark: fix initialization with c++ constructors
+
+C++ constructors may want create new quarks, but we can not guarantee
+that the glib library ctor is executed first. Therefore we make sure
+that quarks are always initialized from g_quark_from_string and
+g_quark_from_static_string
+
+This fixes crashes in glibmm with musl which likely happens on AIX too.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=768215
+https://bugzilla.gnome.org/show_bug.cgi?id=756139#c14
+---
+ glib/gquark.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/glib/gquark.c b/glib/gquark.c
+index 9e51a92..17ecd7f 100644
+--- a/glib/gquark.c
++++ b/glib/gquark.c
+@@ -57,6 +57,11 @@ static gint quark_block_offset = 0;
+ void
+ g_quark_init (void)
+ {
++ /* we may be initialized from c++ constructor or the glib ctor, but we
++ cannot guarantee in what order. So we check if we have been initialized */
++ if (quark_ht != NULL)
++ return;
++
+ g_assert (quark_seq_id == 0);
+ quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
+ quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
+@@ -179,6 +184,9 @@ quark_from_string (const gchar *string,
+ {
+ GQuark quark = 0;
+
++ if (G_UNLIKELY (quark_ht == NULL))
++ g_quark_init();
++
+ quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
+
+ if (!quark)
+--
+2.9.0
+
diff --git a/extra/glib/deprecated-no-warn.patch b/extra/glib/deprecated-no-warn.patch
new file mode 100644
index 0000000..e247eca
--- /dev/null
+++ b/extra/glib/deprecated-no-warn.patch
@@ -0,0 +1,23 @@
+diff -Naur a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+--- a/gio/glib-compile-schemas.c 2018-09-21 15:23:52.000000000 +0100
++++ b/gio/glib-compile-schemas.c 2019-02-10 14:37:30.034879344 +0000
+@@ -1233,19 +1233,6 @@
+ return;
+ }
+
+- if (path && (g_str_has_prefix (path, "/apps/") ||
+- g_str_has_prefix (path, "/desktop/") ||
+- g_str_has_prefix (path, "/system/")))
+- {
+- gchar *message = NULL;
+- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
+- "Paths starting with "
+- "“/apps/”, “/desktop/” or “/system/” are deprecated."),
+- id, path);
+- g_printerr ("%s\n", message);
+- g_free (message);
+- }
+-
+ state->schema_state = schema_state_new (path, gettext_domain,
+ extends, extends_name, list_of);
+
diff --git a/extra/glib/musl-libintl.patch b/extra/glib/musl-libintl.patch
new file mode 100644
index 0000000..a673800
--- /dev/null
+++ b/extra/glib/musl-libintl.patch
@@ -0,0 +1,22 @@
+diff --git a/meson.build b/meson.build
+index 319f183..3a5fdfc 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2047,9 +2047,6 @@ endif
+ # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
+ # implementations. This could be extended if issues are found in some platforms.
+ libintl_deps = []
+-if cc.has_function('ngettext')
+- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
+-else
+ # First just find the bare library.
+ libintl = cc.find_library('intl', required : false)
+ # The bare library probably won't link without help if it's static.
+@@ -2081,7 +2078,6 @@ else
+ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', args : osx_ldflags,
+ dependencies : libintl_deps)
+ endif
+-endif
+
+ glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)
+