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