From 5d99beb14e01f490b38fc568806a6ad972ed5dda Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 4 Nov 2014 14:48:20 -0800
Subject: [PATCH] Place the Qt plugin metadata in a PE-COFF section with MinGW
 too

Commit ec360d7ad90945273c7d96c9a159131dcbcd67c3 made it work for ELF
platforms, Apple platforms and for MSVC, but we apparently forgot it for
MinGW. This patch corrects that mistake.

We won't have the PE-COFF section parser until 5.5, but this will at
least making Qt 5.4-built plugins work on the faster case.

Change-Id: I51b06837dc321eaa4724c9598293cf85570f67fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
---
 src/corelib/plugin/qplugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index 4e9a60504a5..c424344c3a2 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -71,7 +71,7 @@ Q_DECLARE_TYPEINFO(QStaticPlugin, Q_PRIMITIVE_TYPE);
 
 void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
 
-#if defined (Q_OF_ELF) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))
+#if (defined(Q_OF_ELF) || defined(Q_OS_WIN)) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))
 #  define QT_PLUGIN_METADATA_SECTION \
     __attribute__ ((section (".qtmetadata"))) __attribute__((used))
 #elif defined(Q_OS_MAC)
-- 
GitLab