Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87248

Qt5_POSITION_INDEPENDENT_CODE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.0.0 Alpha
    • Build System: CMake
    • None

    Description

      We tried our cmake based application against Qt6. It seems Qt5_POSITION_INDEPENDENT_CODE is not defined anymore. It is always false this is never defined in Qt5CoreMacros.cmake
       

              if (Qt5_POSITION_INDEPENDENT_CODE
                  AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
                      OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
                  set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
              endif()
       

      Also it looks like there is no interface compile option anymore.

      set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS -fPIC)
      

      So we get a lot of this errors. Qt5 works fine.

      /.../qt6/include/QtCore/qglobal.h:1228:4: Fehler: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (and not with -fPIE)."
        error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes