Guys, ladies, questioning and/or transitioning folk and those who transcend 
gender categories,

please find attached two patches, one against the cmake findkde4internl module 
in kdelibs, one against kdesupport's top level CMakeLists.txt, which add the 
use of -mms-bitfields to the C and CXX flags when building with/for mingw. The 
need for them was brought to our attention by a nasty bug caused by 
incompatible memory layouts between gpgme and gpgme++/qgpgme due to their 
(gnupg's) use of this flag. They use it, because all of their depedencies have 
it (notably gtk) and a somewhat in-depth google confirms that that seems to be 
pretty standard practise, among those shipping for mingw. It basically tell 
gcc to be msvc compatible, for C libs, if I understand correctly, and should 
cause no harm, provided everything is built with it consistently. I guess it 
makes sense for KDE to go with the majority opinion here. Ultimately I lack 
insight and overview in this matter, though, so I'd like to hear your (kde-
buildsystem's) opinions. I've asked on kde-windows before, and there seemed to 
be no real opinion one way or the other there. CC-ing that list for maximum 
coverage and transparency. :)

Let me know how I should proceed with this. This then leaves the question of 
Qt. Nokians, any opinion on that? Is it maybe even already in there, the flag?

Cheers,

Till

-- 
Till Adam <a...@kde.org>
diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake
index a99ddd1..cf852cb 100644
--- a/cmake/modules/FindKDE4Internal.cmake
+++ b/cmake/modules/FindKDE4Internal.cmake
@@ -1032,6 +1032,12 @@ if (CMAKE_COMPILER_IS_GNUCXX)
       # or else QPluginLoader rejects plugins because it thinks
       # they're built against the wrong QT.
       add_definitions(-DQT_NO_DEBUG)
+
+      # to make our mingw builds runtime compatible with the way most third
+      # party libs (including gtk, gpgme, etc.) are built, add msvc-style
+      # memory layout flags
+      set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -mms-bitfields")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mms-bitfields")
    endif (MINGW)
 
    check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT)
diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake
index a99ddd1..cf852cb 100644
--- a/cmake/modules/FindKDE4Internal.cmake
+++ b/cmake/modules/FindKDE4Internal.cmake
@@ -1032,6 +1032,12 @@ if (CMAKE_COMPILER_IS_GNUCXX)
       # or else QPluginLoader rejects plugins because it thinks
       # they're built against the wrong QT.
       add_definitions(-DQT_NO_DEBUG)
+
+      # to make our mingw builds runtime compatible with the way most third
+      # party libs (including gtk, gpgme, etc.) are built, add msvc-style
+      # memory layout flags
+      set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -mms-bitfields")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mms-bitfields")
    endif (MINGW)
 
    check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT)
_______________________________________________
Kde-windows mailing list
Kde-windows@kde.org
https://mail.kde.org/mailman/listinfo/kde-windows

Reply via email to