diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-06-30 11:42:49 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-06-30 12:41:34 +0200 |
commit | 95566f972455cbdd8af72554eef97e20da8a9536 (patch) | |
tree | 1c8904fcfa8de0674d921fddafdf044cfa564466 | |
parent | dfe54f4d08f334087b87ef6d16c5bc6bd1335bd5 (diff) | |
download | aports-95566f972455cbdd8af72554eef97e20da8a9536.tar.bz2 aports-95566f972455cbdd8af72554eef97e20da8a9536.tar.xz |
main/glib: fix gquark
https://bugzilla.gnome.org/show_bug.cgi?id=768215
-rw-r--r-- | main/glib/0001-gquark-make-sure-quark-is-initialized-before-create-.patch | 52 | ||||
-rw-r--r-- | main/glib/APKBUILD | 12 |
2 files changed, 60 insertions, 4 deletions
diff --git a/main/glib/0001-gquark-make-sure-quark-is-initialized-before-create-.patch b/main/glib/0001-gquark-make-sure-quark-is-initialized-before-create-.patch new file mode 100644 index 0000000000..565581038f --- /dev/null +++ b/main/glib/0001-gquark-make-sure-quark-is-initialized-before-create-.patch @@ -0,0 +1,52 @@ +From bc7c6ec8184750289d9d9103a6bdd40adbf4627a Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 30 Jun 2016 09:48:20 +0200 +Subject: [PATCH] gquark: make sure quark is initialized before create new + quark + +When g_quark_from_string/g_quark_from_static_string is used to +initialize a global variable it may be called before glib_init's ctor. +Make sure that quark is initialized in those cases. + +https://bugzilla.gnome.org/show_bug.cgi?id=768215 +--- + glib/gquark.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/glib/gquark.c b/glib/gquark.c +index 9e51a92..2f145ae 100644 +--- a/glib/gquark.c ++++ b/glib/gquark.c +@@ -57,6 +57,13 @@ static gint quark_block_offset = 0; + void + g_quark_init (void) + { ++ static gboolean quark_inited; ++ ++ if (quark_inited) ++ return; ++ ++ quark_inited = TRUE; ++ + 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); +@@ -209,6 +216,7 @@ g_quark_from_string (const gchar *string) + return 0; + + G_LOCK (quark_global); ++ g_quark_init(); + quark = quark_from_string (string, TRUE); + G_UNLOCK (quark_global); + +@@ -243,6 +251,7 @@ g_quark_from_static_string (const gchar *string) + return 0; + + G_LOCK (quark_global); ++ g_quark_init(); + quark = quark_from_string (string, FALSE); + G_UNLOCK (quark_global); + +-- +2.9.0 + diff --git a/main/glib/APKBUILD b/main/glib/APKBUILD index 25fb0037dc..cd15bb39d4 100644 --- a/main/glib/APKBUILD +++ b/main/glib/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=glib pkgver=2.48.0 -pkgrel=0 +pkgrel=1 pkgdesc="Common C routines used by Gtk+ and other libs" url="http://www.gtk.org" arch="all" @@ -12,6 +12,7 @@ triggers="$pkgname.trigger=/usr/share/glib-2.0/schemas:/usr/lib/gio/modules" depends_dev="perl python gettext-dev zlib-dev bzip2-dev libffi-dev" makedepends="$depends_dev pcre-dev" source="http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz + 0001-gquark-make-sure-quark-is-initialized-before-create-.patch " subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-lang $pkgname-bash-completion:bashcomp" @@ -73,6 +74,9 @@ bashcomp() { [ "$(ls -A "$pkgdir"/usr/share)" ] || rmdir "$pkgdir"/usr/share } -md5sums="093a586f37d2853bdb129231e1b350e0 glib-2.48.0.tar.xz" -sha256sums="744be6931ca914c68af98dc38ff6b0cf8381d65e335060faddfbf04c17147c34 glib-2.48.0.tar.xz" -sha512sums="684544bc594d9f6c905495d895daed40b074bcf5fa835aefb9a1034afc9564b2bd464e68d4c378c210e96918ef5d5202350da53a7104794420e990049ddbebf5 glib-2.48.0.tar.xz" +md5sums="093a586f37d2853bdb129231e1b350e0 glib-2.48.0.tar.xz +6eb959b045db81dc552edd2695911671 0001-gquark-make-sure-quark-is-initialized-before-create-.patch" +sha256sums="744be6931ca914c68af98dc38ff6b0cf8381d65e335060faddfbf04c17147c34 glib-2.48.0.tar.xz +bdddb06d2a3aaccb5846e4a3f9ae1b052d6606384d6159c2d6bf3796e28759dc 0001-gquark-make-sure-quark-is-initialized-before-create-.patch" +sha512sums="684544bc594d9f6c905495d895daed40b074bcf5fa835aefb9a1034afc9564b2bd464e68d4c378c210e96918ef5d5202350da53a7104794420e990049ddbebf5 glib-2.48.0.tar.xz +8a9cd51ee9f557772e35614d42071e1197c0164d40503871e3e79e116bed6f6a5c8f82fd3f377b5e334f342d2d1df60d404ea0ed885989d7e3412b6795fb5469 0001-gquark-make-sure-quark-is-initialized-before-create-.patch" |