qtbase_avoid_qmain.patch raw

   1  Avoid defining QT_NEEDS_QMAIN macro
   2  
   3  Qt's QT_NEEDS_QMAIN macro renames our main() function to qMain(),
   4  which breaks our assumptions regarding exported symbols. In particular,
   5  the CONTROL_FLOW security check fails for Windows builds in Guix.
   6  
   7  The QT_NEEDS_QMAIN macro is required for linking to the Qt DLLs only,
   8  so we can safely disable it.
   9  
  10  
  11  --- a/qtbase/src/entrypoint/CMakeLists.txt
  12  +++ b/qtbase/src/entrypoint/CMakeLists.txt
  13  @@ -105,8 +105,6 @@ if(WIN32)
  14               APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-lmingw32"
  15           )
  16   
  17  -        target_compile_definitions(EntryPointPrivate INTERFACE QT_NEEDS_QMAIN)
  18  -        qt_internal_extend_target(EntryPointImplementation DEFINES QT_NEEDS_QMAIN)
  19       endif()
  20   
  21       qt_internal_add_sync_header_dependencies(EntryPointImplementation Core)
  22