]> sigrok.org Git - sigrok-util.git/blob - cross-compile/mingw/mxe_fixes.patch
sigrok-fwextract-kingst-la2016: concentrate RCC flags in one spot
[sigrok-util.git] / cross-compile / mingw / mxe_fixes.patch
1 Implementor's note: These patches currently (2022-11) don't apply to
2 recent MXE, their context has changed. The patches' motivation might
3 have become obsolete, too. This needs reconsideration. When in doubt,
4 attempt to build with an MXE toolchain which omits these "MXE fixes"
5 (which actually are downgrades of tools and libraries, while mainline
6 MXE has upgraded and could have fixed previous issues). Older notes
7 from a previous implementation follow below.
8
9
10 These patches are currently required to get a properly working
11 MXE setup for sigrok usage.
12
13  - We're reverting to glib 2.44.1 for now since more recent
14    versions (e.g. 2.50.2) seem to have a bug. Details:
15    https://sigrok.org/bugzilla/show_bug.cgi?id=1232
16    https://github.com/mxe/mxe/issues/2168
17
18  - We're patching glib to fix various MinGW compiler warnings. Details:
19    https://sigrok.org/bugzilla/show_bug.cgi?id=986
20    https://gitlab.gnome.org/GNOME/glib/commit/3d7cde654c4c6f3bdad32f5521f28f5802a7c377
21
22  - Bump MXE's binutils to version 2.35, which added -mbig-obj support
23    for 32bit Windows (64bit was supported already). Required for PulseView.
24
25 See the other file for a libusb discussion.
26
27
28 Change from binutils 2.28 to 2.35.
29
30 diff --git a/src/binutils-1-fixes.patch b/src/binutils-1-fixes.patch
31 deleted file mode 100644
32 index 357428fe..00000000
33 --- a/src/binutils-1-fixes.patch
34 +++ /dev/null
35 @@ -1,147 +0,0 @@
36 -This file is part of MXE. See LICENSE.md for licensing information.
37 -
38 -Contains ad hoc patches for cross building.
39 -
40 -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
41 -From: Stephen Kitt <skitt@debian.org>
42 -Date: Sat, 15 Jul 2017 00:09:40 +1000
43 -Subject: [PATCH 1/1] Allow the PE timestamp to be specified with
44 - SOURCE_DATE_EPOCH
45 -
46 -Taken from:
47 -https://sources.debian.net/patches/binutils-mingw-w64/7.4/specify-timestamp.patch/
48 -
49 -diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
50 -index 1111111..2222222 100644
51 ---- a/bfd/peXXigen.c
52 -+++ b/bfd/peXXigen.c
53 -@@ -70,6 +70,9 @@
54 - #include <wctype.h>
55 - #endif
56
57 -+#include <errno.h>
58 -+#include <limits.h>
59 -+
60 - /* NOTE: it's strange to be including an architecture specific header
61 -    in what's supposed to be general (to PE/PEI) code.  However, that's
62 -    where the definitions are, and they don't vary per architecture
63 -@@ -878,10 +881,38 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out)
64 -   H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns);
65
66 -   /* Only use a real timestamp if the option was chosen.  */
67 --  if ((pe_data (abfd)->insert_timestamp))
68 --    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
69 --  else
70 -+  if (pe_data (abfd)->insert_timestamp) {
71 -+    time_t now;
72 -+    char *source_date_epoch;
73 -+    unsigned long long epoch;
74 -+    char *endptr;
75 -+
76 -+    now = time(NULL);
77 -+    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
78 -+    if (source_date_epoch) {
79 -+      errno = 0;
80 -+      epoch = strtoull(source_date_epoch, &endptr, 10);
81 -+      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
82 -+          || (errno != 0 && epoch == 0)) {
83 -+        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
84 -+                           strerror(errno));
85 -+      } else if (endptr == source_date_epoch) {
86 -+        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
87 -+                           endptr);
88 -+      } else if (*endptr != '\0') {
89 -+        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
90 -+                           endptr);
91 -+      } else if (epoch > ULONG_MAX) {
92 -+        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
93 -+                           ULONG_MAX, epoch);
94 -+      } else {
95 -+        now = epoch;
96 -+      }
97 -+    }
98 -+    H_PUT_32 (abfd, now, filehdr_out->f_timdat);
99 -+  } else {
100 -     H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
101 -+  }
102
103 -   PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
104 -                     filehdr_out->f_symptr);
105 -diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
106 -index 1111111..2222222 100644
107 ---- a/ld/emultempl/pe.em
108 -+++ b/ld/emultempl/pe.em
109 -@@ -305,7 +305,7 @@ gld${EMULATION_NAME}_add_options
110 -      OPTION_USE_NUL_PREFIXED_IMPORT_TABLES},
111 -     {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE},
112 -     {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE},
113 --    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
114 -+    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
115 -     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
116 - #ifdef DLL_SUPPORT
117 -     /* getopt allows abbreviations, so we do this to stop it
118 -diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
119 -index 1111111..2222222 100644
120 ---- a/ld/emultempl/pep.em
121 -+++ b/ld/emultempl/pep.em
122 -@@ -321,7 +321,7 @@ gld${EMULATION_NAME}_add_options
123 -     {"no-bind", no_argument, NULL, OPTION_NO_BIND},
124 -     {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER},
125 -     {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE},
126 --    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
127 -+    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
128 -     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
129 -     {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
130 -     {NULL, no_argument, NULL, 0}
131 -diff --git a/ld/pe-dll.c b/ld/pe-dll.c
132 -index 1111111..2222222 100644
133 ---- a/ld/pe-dll.c
134 -+++ b/ld/pe-dll.c
135 -@@ -26,6 +26,8 @@
136 - #include "filenames.h"
137 - #include "safe-ctype.h"
138
139 -+#include <errno.h>
140 -+#include <limits.h>
141 - #include <time.h>
142
143 - #include "ld.h"
144 -@@ -1192,8 +1194,36 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
145
146 -   memset (edata_d, 0, edata_sz);
147
148 --  if (pe_data (abfd)->insert_timestamp)
149 --    H_PUT_32 (abfd, time (0), edata_d + 4);
150 -+  if (pe_data (abfd)->insert_timestamp) {
151 -+    time_t now;
152 -+    char *source_date_epoch;
153 -+    unsigned long long epoch;
154 -+    char *endptr;
155 -+
156 -+    now = time(NULL);
157 -+    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
158 -+    if (source_date_epoch) {
159 -+      errno = 0;
160 -+      epoch = strtoull(source_date_epoch, &endptr, 10);
161 -+      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
162 -+        || (errno != 0 && epoch == 0)) {
163 -+      einfo("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
164 -+            strerror(errno));
165 -+      } else if (endptr == source_date_epoch) {
166 -+      einfo("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
167 -+            endptr);
168 -+      } else if (*endptr != '\0') {
169 -+      einfo("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
170 -+            endptr);
171 -+      } else if (epoch > ULONG_MAX) {
172 -+      einfo("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
173 -+            ULONG_MAX, epoch);
174 -+      } else {
175 -+      now = epoch;
176 -+      }
177 -+    }
178 -+    H_PUT_32 (abfd, now, edata_d + 4);
179 -+  }
180
181 -   if (pe_def_file->version_major != -1)
182 -     {
183
184 diff --git a/src/binutils.mk b/src/binutils.mk
185 index 9721b581..8eab8bf3 100644
186 --- a/src/binutils.mk
187 +++ b/src/binutils.mk
188 @@ -3,8 +3,8 @@
189  PKG             := binutils
190  $(PKG)_WEBSITE  := https://www.gnu.org/software/binutils/
191  $(PKG)_DESCR    := GNU Binutils
192 -$(PKG)_VERSION  := 2.28
193 -$(PKG)_CHECKSUM := 6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72
194 +$(PKG)_VERSION  := 2.35
195 +$(PKG)_CHECKSUM := 7d24660f87093670738e58bcc7b7b06f121c0fcb0ca8fc44368d675a5ef9cff7
196  $(PKG)_SUBDIR   := binutils-$($(PKG)_VERSION)
197  $(PKG)_FILE     := binutils-$($(PKG)_VERSION).tar.bz2
198  $(PKG)_URL      := https://ftp.gnu.org/gnu/binutils/$($(PKG)_FILE)
199
200
201 Provide glib fixing patches. As well as downgrade to 2.44.1.
202
203 diff --git a/src/glib-1-fixes.patch b/src/glib-1-fixes.patch
204 index 764ece9e..428cc6a9 100644
205 --- a/src/glib-1-fixes.patch
206 +++ b/src/glib-1-fixes.patch
207 @@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
208  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
209  From: Mark Brand <mabrand@mabrand.nl>
210  Date: Thu, 23 Sep 2010 21:42:46 +0200
211 -Subject: [PATCH 01/10] fix tool paths
212 +Subject: [PATCH] fix tool paths
213  
214  
215  diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
216 @@ -29,17 +29,14 @@ index 1111111..2222222 100644
217  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
218  From: Hans Petter Jansson <hpj@cl.no>
219  Date: Fri, 15 Jun 2012 15:25:01 +0200
220 -Subject: [PATCH 02/10] Avoid DllMain symbol conflict when linking statically
221 +Subject: [PATCH] Avoid DllMain symbol conflict when linking statically
222  
223 -Adjusted by Boris Nagaev on 29-Jan-2017 to fix
224 -https://gist.github.com/starius/f4fc85939352cb50122ba29e0f5b140d
225 -when updating to glib-2.50.2.
226  
227  diff --git a/gio/giomodule.c b/gio/giomodule.c
228  index 1111111..2222222 100644
229  --- a/gio/giomodule.c
230  +++ b/gio/giomodule.c
231 -@@ -928,14 +928,12 @@ extern GType g_cocoa_notification_backend_get_type (void);
232 +@@ -918,14 +918,12 @@ extern GType g_gtk_notification_backend_get_type (void);
233   
234   static HMODULE gio_dll = NULL;
235   
236 @@ -56,7 +53,7 @@ index 1111111..2222222 100644
237          DWORD     fdwReason,
238          LPVOID    lpvReserved)
239   {
240 -@@ -945,8 +943,6 @@ DllMain (HINSTANCE hinstDLL,
241 +@@ -935,8 +933,6 @@ DllMain (HINSTANCE hinstDLL,
242     return TRUE;
243   }
244   
245 @@ -69,7 +66,7 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
246  index 1111111..2222222 100644
247  --- a/glib/glib-init.c
248  +++ b/glib/glib-init.c
249 -@@ -245,14 +245,14 @@ glib_init (void)
250 +@@ -237,14 +237,14 @@ glib_init (void)
251   
252   #if defined (G_OS_WIN32)
253   
254 @@ -86,31 +83,18 @@ index 1111111..2222222 100644
255            DWORD     fdwReason,
256            LPVOID    lpvReserved)
257   {
258 -diff --git a/gobject/gtype.c b/gobject/gtype.c
259 -index 1111111..2222222 100644
260 ---- a/gobject/gtype.c
261 -+++ b/gobject/gtype.c
262 -@@ -4450,7 +4450,7 @@ gobject_init (void)
263 -   _g_signal_init ();
264 - }
265
266 --#if defined (G_OS_WIN32)
267 -+#if 0
268
269 - BOOL WINAPI DllMain (HINSTANCE hinstDLL,
270 -                      DWORD     fdwReason,
271  
272  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
273  From: Hans Petter Jansson <hpj@cl.no>
274  Date: Fri, 15 Jun 2012 15:27:22 +0200
275 -Subject: [PATCH 03/10] Allow building without inotify support
276 +Subject: [PATCH] Allow building without inotify support
277  
278  
279  diff --git a/configure.ac b/configure.ac
280  index 1111111..2222222 100644
281  --- a/configure.ac
282  +++ b/configure.ac
283 -@@ -1599,10 +1599,16 @@ dnl *****************************
284 +@@ -1659,10 +1659,16 @@ dnl *****************************
285   dnl ** Check for inotify (GIO) **
286   dnl *****************************
287   inotify_support=no
288 @@ -131,7 +115,7 @@ index 1111111..2222222 100644
289  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
290  From: Hans Petter Jansson <hpj@cl.no>
291  Date: Fri, 15 Jun 2012 15:28:14 +0200
292 -Subject: [PATCH 04/10] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
293 +Subject: [PATCH] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
294   Backported from upstream
295  
296  
297 @@ -139,7 +123,7 @@ diff --git a/configure.ac b/configure.ac
298  index 1111111..2222222 100644
299  --- a/configure.ac
300  +++ b/configure.ac
301 -@@ -511,6 +511,8 @@ LT_INIT([disable-static win32-dll])
302 +@@ -499,6 +499,8 @@ LT_INIT([disable-static win32-dll])
303   dnl when using libtool 2.x create libtool early, because it's used in configure
304   m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
305   
306 @@ -152,7 +136,7 @@ index 1111111..2222222 100644
307  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
308  From: Hans Petter Jansson <hpj@cl.no>
309  Date: Fri, 15 Jun 2012 15:29:06 +0200
310 -Subject: [PATCH 05/10] Link with dnsapi
311 +Subject: [PATCH] Link with dnsapi
312  
313  
314  diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
315 @@ -171,15 +155,15 @@ index 1111111..2222222 100644
316  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
317  From: Hans Petter Jansson <hpj@cl.no>
318  Date: Fri, 15 Jun 2012 15:29:38 +0200
319 -Subject: [PATCH 06/10] Ensure globals are initialized even when DllMain is not
320 - being run
321 +Subject: [PATCH] Ensure globals are initialized even when DllMain is not being
322 + run
323  
324  
325  diff --git a/glib/gmain.c b/glib/gmain.c
326  index 1111111..2222222 100644
327  --- a/glib/gmain.c
328  +++ b/glib/gmain.c
329 -@@ -2657,12 +2657,15 @@ g_get_real_time (void)
330 +@@ -2577,12 +2577,15 @@ g_get_real_time (void)
331   #if defined (G_OS_WIN32)
332   static ULONGLONG (*g_GetTickCount64) (void) = NULL;
333   static guint32 g_win32_tick_epoch = 0;
334 @@ -195,7 +179,7 @@ index 1111111..2222222 100644
335     g_GetTickCount64 = NULL;
336     kernel32 = GetModuleHandle ("KERNEL32.DLL");
337     if (kernel32 != NULL)
338 -@@ -2721,6 +2724,9 @@ g_get_monotonic_time (void)
339 +@@ -2641,6 +2644,9 @@ g_get_monotonic_time (void)
340      *    timeBeginPeriod() to increase it as much as they want
341      */
342   
343 @@ -535,7 +519,7 @@ index 1111111..2222222 100644
344     win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
345   }
346   
347 -@@ -1041,6 +1145,8 @@ g_thread_lookup_native_funcs (void)
348 +@@ -984,6 +1088,8 @@ g_thread_lookup_native_funcs (void)
349   void
350   g_thread_win32_init (void)
351   {
352 @@ -548,7 +532,7 @@ index 1111111..2222222 100644
353  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
354  From: Gerardo Ballabio <gerardo.ballabio@gmail.com>
355  Date: Sun, 16 Aug 2015 13:18:24 +0200
356 -Subject: [PATCH 07/10] Remove an annoying runtime warning
357 +Subject: [PATCH] Remove an annoying runtime warning
358  
359  that pops up when using GtkApplication in Gtk+ 3 programs.
360  
361 @@ -556,7 +540,7 @@ diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
362  index 1111111..2222222 100644
363  --- a/gio/gdbusaddress.c
364  +++ b/gio/gdbusaddress.c
365 -@@ -1387,6 +1387,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
366 +@@ -1325,6 +1325,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
367   __declspec(dllexport) void CALLBACK
368   g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow)
369   {
370 @@ -564,7 +548,7 @@ index 1111111..2222222 100644
371     GDBusDaemon *daemon;
372     GMainLoop *loop;
373     const char *address;
374 -@@ -1418,6 +1419,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
375 +@@ -1354,6 +1355,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
376   
377     g_main_loop_unref (loop);
378     g_object_unref (daemon);
379 @@ -576,7 +560,7 @@ index 1111111..2222222 100644
380  From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
381  From: aquiles2k <aj@elane2k.com>
382  Date: Wed, 6 Apr 2016 22:39:53 +0300
383 -Subject: [PATCH 08/10] fix error "won't overwrite defined macro" on OSX
384 +Subject: [PATCH] fix error "won't overwrite defined macro" on OSX
385  
386  See https://github.com/mxe/mxe/issues/1281
387  
388 @@ -596,110 +580,22 @@ index 1111111..2222222 100644
389   dnl At the end, if we're not within glib, we'll define the public
390   dnl definitions in terms of our private definitions.
391  
392 -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
393 -From: Tony Theodore <tonyt@logyst.com>
394 -Date: Mon, 26 Feb 2018 16:09:53 +1100
395 -Subject: [PATCH 09/10] darwin: disable g_cocoa_notification_backend
396  
397 +From: Boris Pek <tehnick-8@mail.ru>
398 +Date: Thu, 28 Apr 2016 16:48:12 +0300
399 +Subject: [PATCH] fix build with GCC >= 6.x
400  
401 -diff --git a/gio/Makefile.am b/gio/Makefile.am
402 -index 1111111..2222222 100644
403 ---- a/gio/Makefile.am
404 -+++ b/gio/Makefile.am
405 -@@ -279,10 +279,6 @@ unix_sources = \
406
407 - appinfo_sources += $(unix_appinfo_sources)
408
409 --if OS_COCOA
410 --unix_sources += gcocoanotificationbackend.c
411 --endif
412 --
413 - giounixincludedir=$(includedir)/gio-unix-2.0/gio
414 - giounixinclude_HEADERS = \
415 -       gdesktopappinfo.h       \
416 -diff --git a/gio/giomodule.c b/gio/giomodule.c
417 -index 1111111..2222222 100644
418 ---- a/gio/giomodule.c
419 -+++ b/gio/giomodule.c
420 -@@ -918,9 +918,6 @@ extern GType g_proxy_resolver_portal_get_type (void);
421 - extern GType g_network_monitor_portal_get_type (void);
422 - #endif
423
424 --#ifdef HAVE_COCOA
425 --extern GType g_cocoa_notification_backend_get_type (void);
426 --#endif
427 +See plugins/gcc6/README.md
428 +
429 +diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c
430 +--- a/gio/gregistrysettingsbackend.c
431 ++++ b/gio/gregistrysettingsbackend.c
432 +@@ -228,7 +228,7 @@
433 +   if (result_code == ERROR_KEY_DELETED)
434 +     trace ("(%s)", win32_message);
435 +   else
436 +-    g_message (win32_message);
437 ++    g_message ("%s", win32_message);
438 + };
439   
440 - #ifdef G_PLATFORM_WIN32
441   
442 -@@ -1117,9 +1114,6 @@ _g_io_modules_ensure_loaded (void)
443 -       g_type_ensure (g_network_monitor_portal_get_type ());
444 -       g_type_ensure (g_proxy_resolver_portal_get_type ());
445 - #endif
446 --#ifdef HAVE_COCOA
447 --      g_type_ensure (g_cocoa_notification_backend_get_type ());
448 --#endif
449 - #ifdef G_OS_WIN32
450 -       g_type_ensure (_g_winhttp_vfs_get_type ());
451 - #endif
452 -
453 -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
454 -From: Ernestas Kulik <ekulik@redhat.com>
455 -Date: Tue, 29 Jan 2019 09:50:46 +0100
456 -Subject: [PATCH 10/10] gdbus: Avoid printing null strings
457 -
458 -This mostly affects the 2.56 branch, but, given that GCC 9 is being
459 -stricter about passing null string pointers to printf-like functions, it
460 -might make sense to proactively fix such calls.
461 -
462 -gdbusauth.c: In function '_g_dbus_auth_run_server':
463 -gdbusauth.c:1302:11: error: '%s' directive argument is null
464 -[-Werror=format-overflow=]
465 - 1302 |           debug_print ("SERVER: WaitingForBegin, read '%s'",
466 - line);
467 -       |
468 -
469 -gdbusmessage.c: In function ‘g_dbus_message_to_blob’:
470 -gdbusmessage.c:2730:30: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
471 - 2730 |       tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
472 -      |
473 -
474 -diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
475 -index 1111111..2222222 100644
476 ---- a/gio/gdbusauth.c
477 -+++ b/gio/gdbusauth.c
478 -@@ -1295,9 +1295,9 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
479 -                                                     &line_length,
480 -                                                     cancellable,
481 -                                                     error);
482 --          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
483 -           if (line == NULL)
484 -             goto out;
485 -+          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
486 -           if (g_strcmp0 (line, "BEGIN") == 0)
487 -             {
488 -               /* YAY, done! */
489 -diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
490 -index 1111111..2222222 100644
491 ---- a/gio/gdbusmessage.c
492 -+++ b/gio/gdbusmessage.c
493 -@@ -2695,7 +2695,6 @@ g_dbus_message_to_blob (GDBusMessage          *message,
494 -   if (message->body != NULL)
495 -     {
496 -       gchar *tupled_signature_str;
497 --      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
498 -       if (signature == NULL)
499 -         {
500 -           g_set_error (error,
501 -@@ -2703,10 +2702,10 @@ g_dbus_message_to_blob (GDBusMessage          *message,
502 -                        G_IO_ERROR_INVALID_ARGUMENT,
503 -                        _("Message body has signature '%s' but there is no signature header"),
504 -                        signature_str);
505 --          g_free (tupled_signature_str);
506 -           goto out;
507 -         }
508 --      else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
509 -+      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
510 -+      if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0)
511 -         {
512 -           g_set_error (error,
513 -                        G_IO_ERROR,
514
515 diff --git a/src/glib-2-format.patch b/src/glib-2-format.patch
516 new file mode 100644
517 index 00000000..3d594af0
518 --- /dev/null
519 +++ b/src/glib-2-format.patch
520 @@ -0,0 +1,77 @@
521 +--- a/configure.ac.orig        2018-10-03 16:23:45.065890113 +0200
522 ++++ b/configure.ac     2018-10-03 16:28:04.378188119 +0200
523 +@@ -562,7 +562,7 @@ AS_IF([test x$glib_native_win32 != xyes
524 +       # long long is a 64 bit integer.
525 +       AC_MSG_CHECKING(for format to printf and scanf a guint64)
526 +       AC_CACHE_VAL(glib_cv_long_long_format,[
527 +-              for format in ll q I64; do
528 ++              for format in ll q; do
529 +                 AC_TRY_RUN([#include <stdio.h>  
530 +                       int main()
531 +                       {
532 +@@ -588,7 +588,7 @@ AS_IF([test x$glib_native_win32 != xyes
533 +       # __int64 is a 64 bit integer.
534 +       AC_MSG_CHECKING(for format to printf and scanf a guint64)
535 +       # We know this is MSVCRT.DLL, and what the formats are
536 +-      glib_cv_long_long_format=I64
537 ++      glib_cv_long_long_format=ll
538 +       AC_MSG_RESULT(%${glib_cv_long_long_format}u)
539 +         AC_DEFINE(HAVE_LONG_LONG_FORMAT,1,[define if system printf can print long long])
540 +       AC_DEFINE(HAVE_INT64_AND_I64,1,[define to support printing 64-bit integers with format I64])
541 +@@ -3176,8 +3176,8 @@ $ac_cv_sizeof___int64)
542 +     guint64_format='"'$glib_cv_long_long_format'u"'
543 +   fi
544 +   glib_extension=
545 +-  gint64_constant='(val##i64)'
546 +-  guint64_constant='(val##ui64)'
547 ++  gint64_constant='(val##ll)'
548 ++  guint64_constant='(val##ull)'
549 +   ;;
550 + esac
551 + glib_size_t=$ac_cv_sizeof_size_t
552 +@@ -3204,8 +3204,8 @@ long)
553 +   glib_msize_type='LONG'
554 +   ;;
555 + "long long"|__int64)
556 +-  gsize_modifier='"I64"'
557 +-  gsize_format='"I64u"'
558 ++  gsize_modifier='"ll"'
559 ++  gsize_format='"llu"'
560 +   glib_msize_type='INT64'
561 +   ;;
562 + esac
563 +@@ -3227,8 +3227,8 @@ long)
564 +   glib_mssize_type='LONG'
565 +   ;;
566 + "long long"|__int64)
567 +-  gssize_modifier='"I64"'
568 +-  gssize_format='"I64i"'
569 ++  gssize_modifier='"ll"'
570 ++  gssize_format='"lli"'
571 +   glib_mssize_type='INT64'
572 +   ;;
573 + esac
574 +@@ -3257,17 +3257,17 @@ $ac_cv_sizeof_long)
575 +   ;;
576 + $ac_cv_sizeof_long_long)
577 +   glib_intptr_type_define='long long'
578 +-  gintptr_modifier='"I64"'
579 +-  gintptr_format='"I64i"'
580 +-  guintptr_format='"I64u"'
581 ++  gintptr_modifier='"ll"'
582 ++  gintptr_format='"lli"'
583 ++  guintptr_format='"llu"'
584 +   glib_gpi_cast='(gint64)'
585 +   glib_gpui_cast='(guint64)'
586 +   ;;
587 + $ac_cv_sizeof___int64)
588 +   glib_intptr_type_define=__int64
589 +-  gintptr_modifier='"I64"'
590 +-  gintptr_format='"I64i"'
591 +-  guintptr_format='"I64u"'
592 ++  gintptr_modifier='"ll"'
593 ++  gintptr_format='"lli"'
594 ++  guintptr_format='"llu"'
595 +   glib_gpi_cast='(gint64)'
596 +   glib_gpui_cast='(guint64)'
597 +   ;;
598
599 diff --git a/src/glib.mk b/src/glib.mk
600 index 825b86bb..499a45b8 100644
601 --- a/src/glib.mk
602 +++ b/src/glib.mk
603 @@ -3,9 +3,9 @@
604  PKG             := glib
605  $(PKG)_WEBSITE  := https://gtk.org/
606  $(PKG)_DESCR    := GLib
607 -$(PKG)_IGNORE   :=
608 -$(PKG)_VERSION  := 2.50.2
609 -$(PKG)_CHECKSUM := be68737c1f268c05493e503b3b654d2b7f43d7d0b8c5556f7e4651b870acfbf5
610 +$(PKG)_IGNORE   := 
611 +$(PKG)_VERSION  := 2.44.1
612 +$(PKG)_CHECKSUM := 8811deacaf8a503d0a9b701777ea079ca6a4277be10e3d730d2112735d5eca07
613  $(PKG)_SUBDIR   := glib-$($(PKG)_VERSION)
614  $(PKG)_FILE     := glib-$($(PKG)_VERSION).tar.xz
615  $(PKG)_URL      := https://download.gnome.org/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
616 @@ -27,6 +27,7 @@ define $(PKG)_BUILD_DARWIN
617      cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
618          $(MXE_CONFIGURE_OPTS) \
619          --enable-regex \
620 +        --disable-compile-warnings \
621          --disable-threads \
622          --disable-selinux \
623          --disable-inotify \
624 @@ -55,6 +56,7 @@ define $(PKG)_BUILD_NATIVE
625      cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
626      cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
627          $(MXE_CONFIGURE_OPTS) \
628 +        --disable-compile-warnings \
629          --enable-regex \
630          --disable-threads \
631          --disable-selinux \
632 @@ -97,6 +99,7 @@ define $(PKG)_BUILD
633      cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
634      cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
635          $(MXE_CONFIGURE_OPTS) \
636 +        --disable-compile-warnings \
637          --with-threads=win32 \
638          --with-pcre=system \
639          --with-libiconv=gnu \