Commit d6f1ea64 authored by sanketh's avatar sanketh
Browse files

Bug 1655482 - Bump MinGW to fix the STATUS_HEAP_CORRUPTION define. r=tjr, a=RyanVM

- Bump MinGW version
- Add patch to workaround MinGW's dwrite_3.h
- Remove MinGW workaround for STATUS_HEAP_CORRUPTION define
- Remove MinGW workaround in MMPolicies.h.

Differential Revision: https://phabricator.services.mozilla.com/D91157
parent 895c329f
Loading
Loading
Loading
Loading
+0 −38
Original line number Diff line number Diff line
@@ -19,44 +19,6 @@

#include <windows.h>

// MinGW does not have these definitions yet
#if defined(__MINGW32__)
typedef struct _MEM_ADDRESS_REQUIREMENTS {
  PVOID LowestStartingAddress;
  PVOID HighestEndingAddress;
  SIZE_T Alignment;
} MEM_ADDRESS_REQUIREMENTS, *PMEM_ADDRESS_REQUIREMENTS;

typedef enum MEM_EXTENDED_PARAMETER_TYPE {
  MemExtendedParameterInvalidType = 0,
  MemExtendedParameterAddressRequirements,
  MemExtendedParameterNumaNode,
  MemExtendedParameterPartitionHandle,
  MemExtendedParameterUserPhysicalHandle,
  MemExtendedParameterAttributeFlags,
  MemExtendedParameterMax
} MEM_EXTENDED_PARAMETER_TYPE,
    *PMEM_EXTENDED_PARAMETER_TYPE;

#  define MEM_EXTENDED_PARAMETER_TYPE_BITS 8

typedef struct DECLSPEC_ALIGN(8) MEM_EXTENDED_PARAMETER {
  struct {
    DWORD64 Type : MEM_EXTENDED_PARAMETER_TYPE_BITS;
    DWORD64 Reserved : 64 - MEM_EXTENDED_PARAMETER_TYPE_BITS;
  } DUMMYSTRUCTNAME;

  union {
    DWORD64 ULong64;
    PVOID Pointer;
    SIZE_T Size;
    HANDLE Handle;
    DWORD ULong;
  } DUMMYUNIONNAME;

} MEM_EXTENDED_PARAMETER, *PMEM_EXTENDED_PARAMETER;
#endif  // defined(__MINGW32__)

#if (NTDDI_VERSION < NTDDI_WIN10_RS4) || defined(__MINGW32__)
PVOID WINAPI VirtualAlloc2(HANDLE Process, PVOID BaseAddress, SIZE_T Size,
                           ULONG AllocationType, ULONG PageProtection,
+2 −2
Original line number Diff line number Diff line
@@ -364,8 +364,8 @@ mingw-w64:
    description: mingw-w64 source code
    fetch:
        type: git
        repo: git://git.code.sf.net/p/mingw-w64/mingw-w64
        revision: 1b373beec6d07478ffba33726bb3bb21f32e4411
        repo: https://git.code.sf.net/p/mingw-w64/mingw-w64
        revision: bd8ca6c303658659496d0c440cf9f2baa8f7a5f0

libunwind:
    description: libunwind source code
+4 −2
Original line number Diff line number Diff line
@@ -37,11 +37,13 @@ default_win32_winnt=0x601

cd $GECKO_PATH

patch_file="$(pwd)/taskcluster/scripts/misc/mingw-winrt.patch"
patch_file1="$(pwd)/taskcluster/scripts/misc/mingw-winrt.patch"
patch_file2="$(pwd)/taskcluster/scripts/misc/mingw-dwrite_3.patch"

prepare() {
  pushd $MOZ_FETCHES_DIR/mingw-w64
  patch -p1 <$patch_file
  patch -p1 <$patch_file1
  patch -p1 <$patch_file2
  popd
}

+84 −0
Original line number Diff line number Diff line
From 86f4e9cbb5d3099179dc51332970d61d394116f6 Mon Sep 17 00:00:00 2001
From: Sanketh Menda <me@snkth.com>
Date: Sat, 17 Oct 2020 15:39:42 -0400
Subject: [PATCH] dwrite_3.h: rename GetGlyphImageFormats_ to
 GetGlyphImageFormats

Wine's WIDL currently doesn't support overloading functions, so till
that is fixed patch dwrite_3.h to rename GlyphImageFormats_ to
GetGlyphImageFormats.
---
 mingw-w64-headers/include/dwrite_3.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/mingw-w64-headers/include/dwrite_3.h b/mingw-w64-headers/include/dwrite_3.h
index 427c39e3b..dd894a8b1 100644
--- a/mingw-w64-headers/include/dwrite_3.h
+++ b/mingw-w64-headers/include/dwrite_3.h
@@ -8168,7 +8168,7 @@ DEFINE_GUID(IID_IDWriteFontFace4, 0x27f2a904, 0x4eb8, 0x441d, 0x96,0x78, 0x05,0x
 MIDL_INTERFACE("27f2a904-4eb8-441d-9678-0563f53e3e2f")
 IDWriteFontFace4 : public IDWriteFontFace3
 {
-    virtual HRESULT STDMETHODCALLTYPE GetGlyphImageFormats_(
+    virtual HRESULT STDMETHODCALLTYPE GetGlyphImageFormats(
         UINT16 glyph,
         UINT32 ppem_first,
         UINT32 ppem_last,
@@ -8468,7 +8468,7 @@ typedef struct IDWriteFontFace4Vtbl {
         WINBOOL *are_local);
 
     /*** IDWriteFontFace4 methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats_)(
+    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats)(
         IDWriteFontFace4 *This,
         UINT16 glyph,
         UINT32 ppem_first,
@@ -8549,7 +8549,7 @@ interface IDWriteFontFace4 {
 #define IDWriteFontFace4_AreCharactersLocal(This,characters,count,enqueue_if_not,are_local) (This)->lpVtbl->AreCharactersLocal(This,characters,count,enqueue_if_not,are_local)
 #define IDWriteFontFace4_AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local) (This)->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local)
 /*** IDWriteFontFace4 methods ***/
-#define IDWriteFontFace4_GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats)
+#define IDWriteFontFace4_GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats)
 #define IDWriteFontFace4_GetGlyphImageFormats(This) (This)->lpVtbl->GetGlyphImageFormats(This)
 #define IDWriteFontFace4_GetGlyphImageData(This,glyph,ppem,format,data,context) (This)->lpVtbl->GetGlyphImageData(This,glyph,ppem,format,data,context)
 #define IDWriteFontFace4_ReleaseGlyphImageData(This,context) (This)->lpVtbl->ReleaseGlyphImageData(This,context)
@@ -8692,8 +8692,8 @@ static FORCEINLINE HRESULT IDWriteFontFace4_AreGlyphsLocal(IDWriteFontFace4* Thi
     return This->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local);
 }
 /*** IDWriteFontFace4 methods ***/
-static FORCEINLINE HRESULT IDWriteFontFace4_GetGlyphImageFormats_(IDWriteFontFace4* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
-    return This->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats);
+static FORCEINLINE HRESULT IDWriteFontFace4_GetGlyphImageFormats(IDWriteFontFace4* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
+    return This->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats);
 }
 static FORCEINLINE DWRITE_GLYPH_IMAGE_FORMATS IDWriteFontFace4_GetGlyphImageFormats(IDWriteFontFace4* This) {
     return This->lpVtbl->GetGlyphImageFormats(This);
@@ -9020,7 +9020,7 @@ typedef struct IDWriteFontFace5Vtbl {
         WINBOOL *are_local);
 
     /*** IDWriteFontFace4 methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats_)(
+    HRESULT (STDMETHODCALLTYPE *GetGlyphImageFormats)(
         IDWriteFontFace5 *This,
         UINT16 glyph,
         UINT32 ppem_first,
@@ -9121,7 +9121,7 @@ interface IDWriteFontFace5 {
 #define IDWriteFontFace5_AreCharactersLocal(This,characters,count,enqueue_if_not,are_local) (This)->lpVtbl->AreCharactersLocal(This,characters,count,enqueue_if_not,are_local)
 #define IDWriteFontFace5_AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local) (This)->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local)
 /*** IDWriteFontFace4 methods ***/
-#define IDWriteFontFace5_GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats)
+#define IDWriteFontFace5_GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats) (This)->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats)
 #define IDWriteFontFace5_GetGlyphImageFormats(This) (This)->lpVtbl->GetGlyphImageFormats(This)
 #define IDWriteFontFace5_GetGlyphImageData(This,glyph,ppem,format,data,context) (This)->lpVtbl->GetGlyphImageData(This,glyph,ppem,format,data,context)
 #define IDWriteFontFace5_ReleaseGlyphImageData(This,context) (This)->lpVtbl->ReleaseGlyphImageData(This,context)
@@ -9270,8 +9270,8 @@ static FORCEINLINE HRESULT IDWriteFontFace5_AreGlyphsLocal(IDWriteFontFace5* Thi
     return This->lpVtbl->AreGlyphsLocal(This,glyphs,count,enqueue_if_not,are_local);
 }
 /*** IDWriteFontFace4 methods ***/
-static FORCEINLINE HRESULT IDWriteFontFace5_GetGlyphImageFormats_(IDWriteFontFace5* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
-    return This->lpVtbl->GetGlyphImageFormats_(This,glyph,ppem_first,ppem_last,formats);
+static FORCEINLINE HRESULT IDWriteFontFace5_GetGlyphImageFormats(IDWriteFontFace5* This,UINT16 glyph,UINT32 ppem_first,UINT32 ppem_last,DWRITE_GLYPH_IMAGE_FORMATS *formats) {
+    return This->lpVtbl->GetGlyphImageFormats(This,glyph,ppem_first,ppem_last,formats);
 }
 static FORCEINLINE DWRITE_GLYPH_IMAGE_FORMATS IDWriteFontFace5_GetGlyphImageFormats(IDWriteFontFace5* This) {
     return This->lpVtbl->GetGlyphImageFormats(This);