Update glib to 2.64.1

pull/2470/head
Jonas Kvinge 4 years ago
parent 59ceb70a95
commit 1fdd4a5c1d

@ -3,43 +3,46 @@ This file is part of MXE. See LICENSE.md for licensing information.
Contains ad hoc patches for cross building. Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl> From: Jonas Kvinge <jonas@jkvinge.net>
Date: Thu, 23 Sep 2010 21:42:46 +0200 Date: Thu, 12 Mar 2020 20:07:20 +0100
Subject: [PATCH 01/10] fix tool paths Subject: [PATCH 1/1] Fixes to glib
diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in diff --git a/fuzzing/meson.build b/fuzzing/meson.build
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/glib-2.0.pc.in --- a/fuzzing/meson.build
+++ b/glib-2.0.pc.in +++ b/fuzzing/meson.build
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ @@ -20,9 +20,19 @@ else
libdir=@libdir@ extra_sources += 'driver.c'
includedir=@includedir@ endif
-glib_genmarshal=glib-genmarshal -foreach target_name : fuzz_targets
-gobject_query=gobject-query - exe = executable(target_name, [extra_sources, target_name + '.c'],
-glib_mkenums=glib-mkenums - c_args : extra_c_args,
+glib_genmarshal=@bindir@/glib-genmarshal - dependencies : deps,
+gobject_query=@bindir@/gobject-query - )
+glib_mkenums=@bindir@/glib-mkenums -endforeach
+if host_system == 'windows'
Name: GLib + foreach target_name : fuzz_targets
Description: C Utility Library + exe = executable(target_name, [extra_sources, target_name + '.c'],
+ c_args : extra_c_args,
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 + dependencies : deps,
From: Hans Petter Jansson <hpj@cl.no> + link_args : [ '-liconv' ],
Date: Fri, 15 Jun 2012 15:25:01 +0200 + )
Subject: [PATCH 02/10] Avoid DllMain symbol conflict when linking statically + endforeach
+else
Adjusted by Boris Nagaev on 29-Jan-2017 to fix + foreach target_name : fuzz_targets
https://gist.github.com/starius/f4fc85939352cb50122ba29e0f5b140d + exe = executable(target_name, [extra_sources, target_name + '.c'],
when updating to glib-2.50.2. + c_args : extra_c_args,
+ dependencies : deps,
+ )
+ endforeach
+endif
diff --git a/gio/giomodule.c b/gio/giomodule.c diff --git a/gio/giomodule.c b/gio/giomodule.c
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/gio/giomodule.c --- a/gio/giomodule.c
+++ b/gio/giomodule.c +++ b/gio/giomodule.c
@@ -928,14 +928,12 @@ extern GType g_cocoa_notification_backend_get_type (void); @@ -1051,14 +1051,12 @@ extern GType _g_win32_network_monitor_get_type (void);
static HMODULE gio_dll = NULL; static HMODULE gio_dll = NULL;
@ -56,7 +59,7 @@ index 1111111..2222222 100644
DWORD fdwReason, DWORD fdwReason,
LPVOID lpvReserved) LPVOID lpvReserved)
{ {
@@ -945,8 +943,6 @@ DllMain (HINSTANCE hinstDLL, @@ -1068,8 +1066,6 @@ DllMain (HINSTANCE hinstDLL,
return TRUE; return TRUE;
} }
@ -65,11 +68,26 @@ index 1111111..2222222 100644
void * void *
_g_io_win32_get_module (void) _g_io_win32_get_module (void)
{ {
diff --git a/gio/meson.build b/gio/meson.build
index 1111111..2222222 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -6,6 +6,10 @@ gio_c_args = [
gio_c_args += glib_hidden_visibility_args
+if host_system == 'windows'
+ noseh_link_args += '-liconv'
+endif
+
# FIXME: Install empty glib_giomodulesdir
gnetworking_h_conf = configuration_data()
diff --git a/glib/glib-init.c b/glib/glib-init.c diff --git a/glib/glib-init.c b/glib/glib-init.c
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/glib/glib-init.c --- a/glib/glib-init.c
+++ b/glib/glib-init.c +++ b/glib/glib-init.c
@@ -245,14 +245,14 @@ glib_init (void) @@ -271,14 +271,14 @@ glib_init (void)
#if defined (G_OS_WIN32) #if defined (G_OS_WIN32)
@ -86,147 +104,59 @@ index 1111111..2222222 100644
DWORD fdwReason, DWORD fdwReason,
LPVOID lpvReserved) LPVOID lpvReserved)
{ {
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 1111111..2222222 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -4450,7 +4450,7 @@ gobject_init (void)
_g_signal_init ();
}
-#if defined (G_OS_WIN32)
+#if 0
BOOL WINAPI DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:27:22 +0200
Subject: [PATCH 03/10] Allow building without inotify support
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1599,10 +1599,16 @@ dnl *****************************
dnl ** Check for inotify (GIO) **
dnl *****************************
inotify_support=no
+ AC_ARG_ENABLE(inotify,
+ AC_HELP_STRING([--disable-inotify],
+ [build without inotify support]))
+
+ if test "x$enable_inotify" != "xno"; then
AC_CHECK_HEADERS([sys/inotify.h],
[
AC_CHECK_FUNCS(inotify_init1, [inotify_support=yes], [inotify_support=no])
])
+fi
AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:28:14 +0200
Subject: [PATCH 04/10] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
Backported from upstream
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,6 +511,8 @@ LT_INIT([disable-static win32-dll])
dnl when using libtool 2.x create libtool early, because it's used in configure
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
+# Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF
+AS_IF([false], [AC_CHECK_HEADER([stdint.h])])
AS_IF([test "$glib_native_win32" = "yes"], [
if test x$enable_static = xyes -a x$enable_shared = xyes; then
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:29:06 +0200
Subject: [PATCH 05/10] Link with dnsapi
diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
index 1111111..2222222 100644
--- a/gio-2.0.pc.in
+++ b/gio-2.0.pc.in
@@ -13,6 +13,6 @@ Description: glib I/O library
Version: @VERSION@
Requires: glib-2.0 gobject-2.0
Requires.private: gmodule-no-export-2.0
-Libs: -L${libdir} -lgio-2.0
+Libs: -L${libdir} -lgio-2.0 -ldnsapi -liphlpapi
Libs.private: @ZLIB_LIBS@ @NETWORK_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@
Cflags:
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:29:38 +0200
Subject: [PATCH 06/10] Ensure globals are initialized even when DllMain is not
being run
diff --git a/glib/gmain.c b/glib/gmain.c diff --git a/glib/gmain.c b/glib/gmain.c
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/glib/gmain.c --- a/glib/gmain.c
+++ b/glib/gmain.c +++ b/glib/gmain.c
@@ -2657,12 +2657,15 @@ g_get_real_time (void) @@ -2850,12 +2850,15 @@ g_get_real_time (void)
#if defined (G_OS_WIN32) * So for now we calculate (usec_per_sec / ticks_per_sec) and use floating point
static ULONGLONG (*g_GetTickCount64) (void) = NULL; */
static guint32 g_win32_tick_epoch = 0; static gdouble g_monotonic_usec_per_tick = 0;
+static gboolean g_win32_clock_is_initialized; +static gboolean g_win32_clock_is_initialized = FALSE;
void void
g_clock_win32_init (void) g_clock_win32_init (void)
{ {
HMODULE kernel32; LARGE_INTEGER freq;
+ g_win32_clock_is_initialized = TRUE; + g_win32_clock_is_initialized = TRUE;
+ +
g_GetTickCount64 = NULL; if (!QueryPerformanceFrequency (&freq) || freq.QuadPart == 0)
kernel32 = GetModuleHandle ("KERNEL32.DLL"); {
if (kernel32 != NULL) /* The documentation says that this should never happen */
@@ -2721,6 +2724,9 @@ g_get_monotonic_time (void) @@ -2869,6 +2872,10 @@ g_clock_win32_init (void)
* timeBeginPeriod() to increase it as much as they want gint64
*/ g_get_monotonic_time (void)
{
+
+ if (!g_win32_clock_is_initialized) + if (!g_win32_clock_is_initialized)
+ g_clock_win32_init (); + g_clock_win32_init ();
+ +
if (g_GetTickCount64 != NULL) if (G_LIKELY (g_monotonic_usec_per_tick != 0))
{ {
guint32 ticks_as_32bit; LARGE_INTEGER ticks;
diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c diff --git a/glib/gthread-win32.c b/glib/gthread-win32.c
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/glib/gthread-win32.c --- a/glib/gthread-win32.c
+++ b/glib/gthread-win32.c +++ b/glib/gthread-win32.c
@@ -116,18 +116,28 @@ typedef struct @@ -61,6 +61,10 @@ g_thread_abort (gint status,
void (__stdcall * WakeConditionVariable) (gpointer cond); g_abort ();
} GThreadImplVtable; }
+/* Needed for static builds where DllMain initializer doesn't get called */ +/* Needed for static builds where DllMain initializer doesn't get called */
+static gboolean g_threads_is_initialized; +static gboolean g_threads_is_initialized = FALSE;
+G_GNUC_INTERNAL void g_thread_win32_init (void); +G_GNUC_INTERNAL void g_thread_win32_init (void);
+ +
static GThreadImplVtable g_thread_impl_vtable; /* Starting with Vista and Windows 2008, we have access to the
* CONDITION_VARIABLE and SRWLock primatives on Windows, which are
/* {{{1 GMutex */ * pretty reasonable approximations of the primatives specified in
@@ -79,29 +83,39 @@ g_thread_abort (gint status,
void void
g_mutex_init (GMutex *mutex) g_mutex_init (GMutex *mutex)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ InitializeSRWLock ((gpointer) mutex);
g_thread_impl_vtable.InitializeSRWLock (mutex);
} }
void void
@ -234,18 +164,14 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+
if (g_thread_impl_vtable.DeleteSRWLock != NULL)
g_thread_impl_vtable.DeleteSRWLock (mutex);
} }
@@ -135,18 +145,27 @@ g_mutex_clear (GMutex *mutex)
void void
g_mutex_lock (GMutex *mutex) g_mutex_lock (GMutex *mutex)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ AcquireSRWLockExclusive ((gpointer) mutex);
g_thread_impl_vtable.AcquireSRWLockExclusive (mutex);
} }
gboolean gboolean
@ -253,8 +179,7 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ return TryAcquireSRWLockExclusive ((gpointer) mutex);
return g_thread_impl_vtable.TryAcquireSRWLockExclusive (mutex);
} }
void void
@ -262,11 +187,10 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ ReleaseSRWLockExclusive ((gpointer) mutex);
g_thread_impl_vtable.ReleaseSRWLockExclusive (mutex);
} }
@@ -157,6 +176,9 @@ g_rec_mutex_impl_new (void) @@ -112,6 +126,9 @@ g_rec_mutex_impl_new (void)
{ {
CRITICAL_SECTION *cs; CRITICAL_SECTION *cs;
@ -276,7 +200,7 @@ index 1111111..2222222 100644
cs = g_slice_new (CRITICAL_SECTION); cs = g_slice_new (CRITICAL_SECTION);
InitializeCriticalSection (cs); InitializeCriticalSection (cs);
@@ -167,6 +189,10 @@ static void @@ -122,6 +139,10 @@ static void
g_rec_mutex_impl_free (CRITICAL_SECTION *cs) g_rec_mutex_impl_free (CRITICAL_SECTION *cs)
{ {
DeleteCriticalSection (cs); DeleteCriticalSection (cs);
@ -287,7 +211,7 @@ index 1111111..2222222 100644
g_slice_free (CRITICAL_SECTION, cs); g_slice_free (CRITICAL_SECTION, cs);
} }
@@ -175,6 +201,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex) @@ -130,6 +151,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
{ {
CRITICAL_SECTION *impl = mutex->p; CRITICAL_SECTION *impl = mutex->p;
@ -297,7 +221,7 @@ index 1111111..2222222 100644
if G_UNLIKELY (mutex->p == NULL) if G_UNLIKELY (mutex->p == NULL)
{ {
impl = g_rec_mutex_impl_new (); impl = g_rec_mutex_impl_new ();
@@ -189,30 +218,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex) @@ -144,30 +168,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
void void
g_rec_mutex_init (GRecMutex *mutex) g_rec_mutex_init (GRecMutex *mutex)
{ {
@ -343,14 +267,13 @@ index 1111111..2222222 100644
return TryEnterCriticalSection (g_rec_mutex_get_impl (mutex)); return TryEnterCriticalSection (g_rec_mutex_get_impl (mutex));
} }
@@ -221,12 +265,18 @@ g_rec_mutex_trylock (GRecMutex *mutex) @@ -176,47 +215,64 @@ g_rec_mutex_trylock (GRecMutex *mutex)
void void
g_rw_lock_init (GRWLock *lock) g_rw_lock_init (GRWLock *lock)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ InitializeSRWLock ((gpointer) lock);
g_thread_impl_vtable.InitializeSRWLock (lock);
} }
void void
@ -358,18 +281,15 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+
if (g_thread_impl_vtable.DeleteSRWLock != NULL)
g_thread_impl_vtable.DeleteSRWLock (lock);
} }
@@ -234,36 +284,54 @@ g_rw_lock_clear (GRWLock *lock)
void void
g_rw_lock_writer_lock (GRWLock *lock) g_rw_lock_writer_lock (GRWLock *lock)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ +
g_thread_impl_vtable.AcquireSRWLockExclusive (lock); AcquireSRWLockExclusive ((gpointer) lock);
} }
gboolean gboolean
@ -377,8 +297,7 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ return TryAcquireSRWLockExclusive ((gpointer) lock);
return g_thread_impl_vtable.TryAcquireSRWLockExclusive (lock);
} }
void void
@ -386,8 +305,7 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ ReleaseSRWLockExclusive ((gpointer) lock);
g_thread_impl_vtable.ReleaseSRWLockExclusive (lock);
} }
void void
@ -395,8 +313,7 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ AcquireSRWLockShared ((gpointer) lock);
g_thread_impl_vtable.AcquireSRWLockShared (lock);
} }
gboolean gboolean
@ -404,8 +321,7 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ return TryAcquireSRWLockShared ((gpointer) lock);
return g_thread_impl_vtable.TryAcquireSRWLockShared (lock);
} }
void void
@ -413,18 +329,16 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ ReleaseSRWLockShared ((gpointer) lock);
g_thread_impl_vtable.ReleaseSRWLockShared (lock);
} }
@@ -271,12 +339,18 @@ g_rw_lock_reader_unlock (GRWLock *lock) @@ -224,23 +280,31 @@ g_rw_lock_reader_unlock (GRWLock *lock)
void void
g_cond_init (GCond *cond) g_cond_init (GCond *cond)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ InitializeConditionVariable ((gpointer) cond);
g_thread_impl_vtable.InitializeConditionVariable (cond);
} }
void void
@ -432,18 +346,14 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+
if (g_thread_impl_vtable.DeleteConditionVariable)
g_thread_impl_vtable.DeleteConditionVariable (cond);
} }
@@ -284,12 +358,18 @@ g_cond_clear (GCond *cond)
void void
g_cond_signal (GCond *cond) g_cond_signal (GCond *cond)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ WakeConditionVariable ((gpointer) cond);
g_thread_impl_vtable.WakeConditionVariable (cond);
} }
void void
@ -451,41 +361,40 @@ index 1111111..2222222 100644
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ WakeAllConditionVariable ((gpointer) cond);
g_thread_impl_vtable.WakeAllConditionVariable (cond);
} }
@@ -297,6 +377,9 @@ void @@ -248,6 +312,8 @@ void
g_cond_wait (GCond *cond, g_cond_wait (GCond *cond,
GMutex *entered_mutex) GMutex *entered_mutex)
{ {
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ SleepConditionVariableSRW ((gpointer) cond, (gpointer) entered_mutex, INFINITE, 0);
g_thread_impl_vtable.SleepConditionVariableSRW (cond, entered_mutex, INFINITE, 0);
} }
@@ -307,6 +390,9 @@ g_cond_wait_until (GCond *cond, @@ -260,6 +326,9 @@ g_cond_wait_until (GCond *cond,
{ DWORD span_millis;
gint64 span; gboolean signalled;
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ +
span = end_time - g_get_monotonic_time (); start_time = g_get_monotonic_time ();
do
if G_UNLIKELY (span < 0) {
@@ -339,6 +425,9 @@ g_private_get_impl (GPrivate *key) @@ -311,6 +380,10 @@ g_private_get_impl (GPrivate *key)
if G_UNLIKELY (impl == 0) if G_UNLIKELY (impl == 0)
{ {
+
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ +
EnterCriticalSection (&g_private_lock); EnterCriticalSection (&g_private_lock);
impl = (DWORD) key->p; impl = (DWORD) key->p;
if (impl == 0) if (impl == 0)
@@ -432,6 +521,9 @@ g_system_thread_free (GRealThread *thread) @@ -404,6 +477,9 @@ g_system_thread_free (GRealThread *thread)
{ {
GThreadWin32 *wt = (GThreadWin32 *) thread; GThreadWin32 *wt = (GThreadWin32 *) thread;
@ -495,7 +404,7 @@ index 1111111..2222222 100644
win32_check_for_error (CloseHandle (wt->handle)); win32_check_for_error (CloseHandle (wt->handle));
g_slice_free (GThreadWin32, wt); g_slice_free (GThreadWin32, wt);
} }
@@ -439,6 +531,9 @@ g_system_thread_free (GRealThread *thread) @@ -411,6 +487,9 @@ g_system_thread_free (GRealThread *thread)
void void
g_system_thread_exit (void) g_system_thread_exit (void)
{ {
@ -505,7 +414,7 @@ index 1111111..2222222 100644
_endthreadex (0); _endthreadex (0);
} }
@@ -447,6 +542,9 @@ g_thread_win32_proxy (gpointer data) @@ -419,6 +498,9 @@ g_thread_win32_proxy (gpointer data)
{ {
GThreadWin32 *self = data; GThreadWin32 *self = data;
@ -515,17 +424,17 @@ index 1111111..2222222 100644
self->proxy (self); self->proxy (self);
g_system_thread_exit (); g_system_thread_exit ();
@@ -464,6 +562,9 @@ g_system_thread_new (GThreadFunc func, @@ -452,6 +534,9 @@ g_system_thread_new (GThreadFunc proxy,
GThreadWin32 *thread; const gchar *message = NULL;
guint ignore; int thread_prio;
+ if (!g_threads_is_initialized) + if (!g_threads_is_initialized)
+ g_thread_win32_init (); + g_thread_win32_init ();
+ +
thread = g_slice_new0 (GThreadWin32); thread = g_slice_new0 (GThreadWin32);
thread->proxy = func; thread->proxy = proxy;
thread->handle = (HANDLE) NULL;
@@ -493,6 +594,9 @@ g_system_thread_wait (GRealThread *thread) @@ -535,6 +620,9 @@ g_system_thread_wait (GRealThread *thread)
{ {
GThreadWin32 *wt = (GThreadWin32 *) thread; GThreadWin32 *wt = (GThreadWin32 *) thread;
@ -535,56 +444,72 @@ index 1111111..2222222 100644
win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE)); win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
} }
@@ -1041,6 +1145,8 @@ g_thread_lookup_native_funcs (void) @@ -608,6 +696,8 @@ g_thread_win32_init (void)
void
g_thread_win32_init (void)
{ {
InitializeCriticalSection (&g_private_lock);
+ g_threads_is_initialized = TRUE; + g_threads_is_initialized = TRUE;
+ +
if (!g_thread_lookup_native_funcs ()) #ifndef _MSC_VER
g_thread_xp_init (); SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, &SetThreadName_VEH);
if (SetThreadName_VEH_handle == NULL)
diff --git a/glib/meson.build b/glib/meson.build
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 index 1111111..2222222 100644
From: Gerardo Ballabio <gerardo.ballabio@gmail.com> --- a/glib/meson.build
Date: Sun, 16 Aug 2015 13:18:24 +0200 +++ b/glib/meson.build
Subject: [PATCH 07/10] Remove an annoying runtime warning @@ -402,11 +402,13 @@ if host_system == 'windows'
executable('gspawn-win64-helper', 'gspawn-win32-helper.c',
that pops up when using GtkApplication in Gtk+ 3 programs. install : true,
gui_app : true,
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c + link_args : [ '-liconv' ],
include_directories : configinc,
dependencies : [libglib_dep])
executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c',
install : true,
c_args : ['-DHELPER_CONSOLE'],
+ link_args : [ '-liconv' ],
include_directories : configinc,
dependencies : [libglib_dep])
endif
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/gio/gdbusaddress.c --- a/gobject/gtype.c
+++ b/gio/gdbusaddress.c +++ b/gobject/gtype.c
@@ -1387,6 +1387,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC @@ -4456,7 +4456,7 @@ gobject_init (void)
__declspec(dllexport) void CALLBACK _g_signal_init ();
g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow)
{
+ /*
GDBusDaemon *daemon;
GMainLoop *loop;
const char *address;
@@ -1418,6 +1419,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
g_main_loop_unref (loop);
g_object_unref (daemon);
+ */
} }
static gchar * -#if defined (G_OS_WIN32)
+#if 0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: aquiles2k <aj@elane2k.com> BOOL WINAPI DllMain (HINSTANCE hinstDLL,
Date: Wed, 6 Apr 2016 22:39:53 +0300 DWORD fdwReason,
Subject: [PATCH 08/10] fix error "won't overwrite defined macro" on OSX diff --git a/gobject/meson.build b/gobject/meson.build
index 1111111..2222222 100644
See https://github.com/mxe/mxe/issues/1281 --- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -143,9 +143,16 @@ libgobject_dep = declare_dependency(link_with : libgobject,
include_directories : [gobjectinc],
dependencies : [libglib_dep, glib_enumtypes_dep])
+if host_system == 'windows'
+executable('gobject-query', 'gobject-query.c',
+ install : true,
+ link_args : [ '-liconv' ],
+ dependencies : [libglib_dep, libgobject_dep])
+else
executable('gobject-query', 'gobject-query.c',
install : true,
dependencies : [libglib_dep, libgobject_dep])
+endif
install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
gdb_conf = configuration_data()
diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4
index 1111111..2222222 100644 index 1111111..2222222 100644
--- a/m4macros/glib-gettext.m4 --- a/m4macros/glib-gettext.m4
+++ b/m4macros/glib-gettext.m4 +++ b/m4macros/glib-gettext.m4
@@ -36,8 +36,8 @@ dnl We go to great lengths to make sure that aclocal won't @@ -39,8 +39,8 @@ dnl We go to great lengths to make sure that aclocal won't
dnl try to pull in the installed version of these macros dnl try to pull in the installed version of these macros
dnl when running aclocal in the glib directory. dnl when running aclocal in the glib directory.
dnl dnl
@ -595,111 +520,3 @@ index 1111111..2222222 100644
dnl dnl
dnl At the end, if we're not within glib, we'll define the public dnl At the end, if we're not within glib, we'll define the public
dnl definitions in terms of our private definitions. dnl definitions in terms of our private definitions.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Mon, 26 Feb 2018 16:09:53 +1100
Subject: [PATCH 09/10] darwin: disable g_cocoa_notification_backend
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 1111111..2222222 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -279,10 +279,6 @@ unix_sources = \
appinfo_sources += $(unix_appinfo_sources)
-if OS_COCOA
-unix_sources += gcocoanotificationbackend.c
-endif
-
giounixincludedir=$(includedir)/gio-unix-2.0/gio
giounixinclude_HEADERS = \
gdesktopappinfo.h \
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 1111111..2222222 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -918,9 +918,6 @@ extern GType g_proxy_resolver_portal_get_type (void);
extern GType g_network_monitor_portal_get_type (void);
#endif
-#ifdef HAVE_COCOA
-extern GType g_cocoa_notification_backend_get_type (void);
-#endif
#ifdef G_PLATFORM_WIN32
@@ -1117,9 +1114,6 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_network_monitor_portal_get_type ());
g_type_ensure (g_proxy_resolver_portal_get_type ());
#endif
-#ifdef HAVE_COCOA
- g_type_ensure (g_cocoa_notification_backend_get_type ());
-#endif
#ifdef G_OS_WIN32
g_type_ensure (_g_winhttp_vfs_get_type ());
#endif
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ernestas Kulik <ekulik@redhat.com>
Date: Tue, 29 Jan 2019 09:50:46 +0100
Subject: [PATCH 10/10] gdbus: Avoid printing null strings
This mostly affects the 2.56 branch, but, given that GCC 9 is being
stricter about passing null string pointers to printf-like functions, it
might make sense to proactively fix such calls.
gdbusauth.c: In function '_g_dbus_auth_run_server':
gdbusauth.c:1302:11: error: '%s' directive argument is null
[-Werror=format-overflow=]
1302 | debug_print ("SERVER: WaitingForBegin, read '%s'",
line);
|
gdbusmessage.c: In function g_dbus_message_to_blob:
gdbusmessage.c:2730:30: error: %s directive argument is null [-Werror=format-overflow=]
2730 | tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
|
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index 1111111..2222222 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -1295,9 +1295,9 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
&line_length,
cancellable,
error);
- debug_print ("SERVER: WaitingForBegin, read '%s'", line);
if (line == NULL)
goto out;
+ debug_print ("SERVER: WaitingForBegin, read '%s'", line);
if (g_strcmp0 (line, "BEGIN") == 0)
{
/* YAY, done! */
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 1111111..2222222 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -2695,7 +2695,6 @@ g_dbus_message_to_blob (GDBusMessage *message,
if (message->body != NULL)
{
gchar *tupled_signature_str;
- tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
if (signature == NULL)
{
g_set_error (error,
@@ -2703,10 +2702,10 @@ g_dbus_message_to_blob (GDBusMessage *message,
G_IO_ERROR_INVALID_ARGUMENT,
_("Message body has signature '%s' but there is no signature header"),
signature_str);
- g_free (tupled_signature_str);
goto out;
}
- else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
+ tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+ if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
{
g_set_error (error,
G_IO_ERROR,

@ -4,86 +4,30 @@ PKG := glib
$(PKG)_WEBSITE := https://gtk.org/ $(PKG)_WEBSITE := https://gtk.org/
$(PKG)_DESCR := GLib $(PKG)_DESCR := GLib
$(PKG)_IGNORE := $(PKG)_IGNORE :=
$(PKG)_VERSION := 2.50.2 $(PKG)_VERSION := 2.64.1
$(PKG)_CHECKSUM := be68737c1f268c05493e503b3b654d2b7f43d7d0b8c5556f7e4651b870acfbf5 $(PKG)_CHECKSUM := 17967603bcb44b6dbaac47988d80c29a3d28519210b28157c2bd10997595bbc7
$(PKG)_SUBDIR := glib-$($(PKG)_VERSION) $(PKG)_SUBDIR := glib-$($(PKG)_VERSION)
$(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz $(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://download.gnome.org/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) $(PKG)_URL := https://download.gnome.org/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
$(PKG)_DEPS := cc dbus gettext libffi libiconv pcre zlib $(BUILD)~$(PKG) $(PKG)_DEPS := cc meson-conf dbus gettext libffi libiconv pcre zlib $(BUILD)~$(PKG)
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS) $(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
$(PKG)_DEPS_$(BUILD) := autotools gettext libffi libiconv zlib $(PKG)_DEPS_$(BUILD) := meson ninja gettext libffi libiconv zlib
define $(PKG)_UPDATE define $(PKG)_UPDATE
$(WGET) -q -O- 'https://gitlab.gnome.org/GNOME/glib/tags' | \ $(call MXE_GET_GH_TAGS,GNOME/glib) | \
$(SED) -n "s,.*<a [^>]\+>v\?\([0-9]\+\.[0-9.]\+\)<.*,\1,p" | \ grep -v '\([0-9]\+\.\)\{2\}9[0-9]' | \
$(SORT) -Vr | \ $(SORT) -Vr | \
head -1 head -1
endef endef
define $(PKG)_BUILD_DARWIN
# native build for glib-tools
cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--enable-regex \
--disable-threads \
--disable-selinux \
--disable-inotify \
--disable-fam \
--disable-xattr \
--disable-dtrace \
--disable-libmount \
--with-pcre=internal \
PKG_CONFIG='$(PREFIX)/$(TARGET)/bin/pkgconf' \
CPPFLAGS='-I$(PREFIX)/$(TARGET).gnu/include' \
LDFLAGS='-L$(PREFIX)/$(TARGET).gnu/lib'
$(MAKE) -C '$(BUILD_DIR)/glib' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gthread' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gmodule' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec
$(MAKE) -C '$(BUILD_DIR)/gio/xdgmime' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gio/kqueue' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-schemas
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-resources
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/'
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/'
endef
define $(PKG)_BUILD_NATIVE
# native build for glib-tools
cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--enable-regex \
--disable-threads \
--disable-selinux \
--disable-inotify \
--disable-fam \
--disable-xattr \
--disable-dtrace \
--disable-libmount \
--with-libiconv=gnu \
--with-pcre=internal \
PKG_CONFIG='$(PREFIX)/$(TARGET)/bin/pkgconf' \
CPPFLAGS='-I$(PREFIX)/$(TARGET)/include' \
LDFLAGS='-L$(PREFIX)/$(TARGET)/lib'
$(SED) -i 's,#define G_ATOMIC.*,,' '$(BUILD_DIR)/config.h'
$(MAKE) -C '$(BUILD_DIR)/glib' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gthread' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gmodule' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec
$(MAKE) -C '$(BUILD_DIR)/gio/xdgmime' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-schemas
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-resources
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/'
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/'
endef
define $(PKG)_BUILD_$(BUILD) define $(PKG)_BUILD_$(BUILD)
$(if $(findstring darwin, $(BUILD)), \ cd '$(SOURCE_DIR)' && meson --prefix='$(PREFIX)/$(TARGET)' \
$($(PKG)_BUILD_DARWIN), \ --buildtype=release \
$($(PKG)_BUILD_NATIVE)) --pkg-config-path='$(PREFIX)/$(TARGET)/bin/pkgconf' \
'$(BUILD_DIR)'
cd '$(BUILD_DIR)' && ninja
cd '$(BUILD_DIR)' && ninja install
endef endef
define $(PKG)_BUILD define $(PKG)_BUILD
@ -92,25 +36,7 @@ define $(PKG)_BUILD
ln -sf '$(PREFIX)/$(BUILD)/bin/glib-genmarshal' '$(PREFIX)/$(TARGET)/bin/' ln -sf '$(PREFIX)/$(BUILD)/bin/glib-genmarshal' '$(PREFIX)/$(TARGET)/bin/'
ln -sf '$(PREFIX)/$(BUILD)/bin/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/' ln -sf '$(PREFIX)/$(BUILD)/bin/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/'
ln -sf '$(PREFIX)/$(BUILD)/bin/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/' ln -sf '$(PREFIX)/$(BUILD)/bin/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/'
cd '$(SOURCE_DIR)' && $(TARGET)-meson '$(BUILD_DIR)'
# cross build cd '$(BUILD_DIR)' && ninja
cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh cd '$(BUILD_DIR)' && ninja install
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--with-threads=win32 \
--with-pcre=system \
--with-libiconv=gnu \
--disable-inotify \
CXX='$(TARGET)-g++' \
PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \
GLIB_GENMARSHAL='$(PREFIX)/$(TARGET)/bin/glib-genmarshal' \
GLIB_COMPILE_SCHEMAS='$(PREFIX)/$(TARGET)/bin/glib-compile-schemas' \
GLIB_COMPILE_RESOURCES='$(PREFIX)/$(TARGET)/bin/glib-compile-resources'
$(MAKE) -C '$(BUILD_DIR)/glib' -j '$(JOBS)' install sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)/gmodule' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)/gthread' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)/gobject' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= MISC_STUFF=
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' install-pkgconfigDATA
$(MAKE) -C '$(BUILD_DIR)/m4macros' install
endef endef

Loading…
Cancel
Save