From dd7052503e01b57650be3dc7063aa43f75a59f67 Mon Sep 17 00:00:00 2001 From: wuggy Date: Sat, 18 Apr 2026 13:06:15 -0700 Subject: [PATCH] Most linking errors dealt with on compiling on MinGW --- dom/canvas/WebGLContext.cpp | 7 +++++++ dom/canvas/WebGLContext.h | 5 +---- gfx/gl/moz.build | 2 ++ gfx/skia/moz.build | 9 ++++++++- memory/mozalloc/mozalloc_abort.h | 8 +++++++- toolkit/library/nsDllMain.cpp | 3 ++- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 19de675203..afb280b737 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -842,6 +842,13 @@ WebGLContext::ThrowEvent_WebGLContextCreationError(const nsACString& text) GenerateWarning("Failed to create WebGL context: %s", text.BeginReading()); } +NS_IMETHODIMP +WebGLContext::InitializeWithDrawTarget(nsIDocShell*, + NotNull) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + NS_IMETHODIMP WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) { diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 6073da1754..8446d13638 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -347,10 +347,7 @@ public: NS_IMETHOD SetDimensions(int32_t width, int32_t height) override; NS_IMETHOD InitializeWithDrawTarget(nsIDocShell*, - NotNull) override - { - return NS_ERROR_NOT_IMPLEMENTED; - } + NotNull) override; NS_IMETHOD Reset() override { /* (InitializeWithSurface) */ diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build index f114559d76..395bf94c46 100644 --- a/gfx/gl/moz.build +++ b/gfx/gl/moz.build @@ -20,6 +20,8 @@ elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: if CONFIG['MOZ_GL_PROVIDER']: gl_provider = CONFIG['MOZ_GL_PROVIDER'] +DISABLE_STL_WRAPPING = True + EXPORTS += [ 'DecomposeIntoNoRepeatTriangles.h', 'EGLUtils.h', diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build index ad31c8d484..9cc1175fed 100644 --- a/gfx/skia/moz.build +++ b/gfx/skia/moz.build @@ -646,7 +646,10 @@ else: # We allow warnings for third-party code that can be updated from upstream. ALLOW_COMPILER_WARNINGS = True -FINAL_LIBRARY = 'gkmedias' +if CONFIG['GNU_CC']: + FINAL_LIBRARY = 'xul' +else: + FINAL_LIBRARY = 'gkmedias' LOCAL_INCLUDES += [ 'skia/include/c', 'skia/include/config', @@ -697,6 +700,10 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']: DEFINES['SKIA_DLL'] = 1 DEFINES['GR_DLL'] = 1 DEFINES['SK_FONT_HOST_USE_SYSTEM_SETTINGS'] = 1 +if CONFIG['GKMEDIAS_SHARED_LIBRARY'] and not CONFIG['GNU_CC']: + DEFINES['SKIA_DLL'] = 1 + DEFINES['GR_DLL'] = 1 + DEFINES['SK_FONT_HOST_USE_SYSTEM_SETTINGS'] = 1 # We should autogenerate these SSE related flags. diff --git a/memory/mozalloc/mozalloc_abort.h b/memory/mozalloc/mozalloc_abort.h index 27dded9c4a..b7224c5424 100644 --- a/memory/mozalloc/mozalloc_abort.h +++ b/memory/mozalloc/mozalloc_abort.h @@ -16,7 +16,13 @@ * Note: MOZ_NORETURN seems to break crash stacks on ARM, so we don't * use that annotation there. */ -MFBT_API +#if defined(__MINGW32__) +# define MOZALLOC_ABORT_API +#else +# define MOZALLOC_ABORT_API MFBT_API +#endif + +MOZALLOC_ABORT_API #if !defined(__arm__) MOZ_NORETURN #endif diff --git a/toolkit/library/nsDllMain.cpp b/toolkit/library/nsDllMain.cpp index 36f1630bf0..d0310dc534 100644 --- a/toolkit/library/nsDllMain.cpp +++ b/toolkit/library/nsDllMain.cpp @@ -2,7 +2,8 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - + +#include #include #include "nsToolkit.h" #include "mozilla/Assertions.h"