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

Cast error when building OpenGL extension on MIPS64

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.2
    • 5.12.0
    • Core: Other
    • None
    • MIPS64
    • Linux/X11
    • 2ab139596d058cf9cc93e723c340467c70d93b10 (qt/qtbase/5.12)

    Description

      We are trying to let Qt has better support on MIPS64 platform. When building qtbase on MIPS64 platform. We got cast error like error:

      cast from 'QAbstractOpenGLExtensionPrivate*' to 'const QOpenGLExtension_SUN_triangle_listPrivate*' increases required alignment of target type [-Werror=cast-align]
      

      Delete the `-Wcast-align` manually from the generated Makefile in `qtbase/blob/5.12/src/openglextensions` can suppress this issue. But I wonder if there has a more elegant way to solve this?

      Here is the complete error message:

      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h:17577:5: note: in expansion of macro ‘Q_DECLARE_PRIVATE’
           Q_DECLARE_PRIVATE(QOpenGLExtension_SUN_triangle_list)
           ^~~~~~~~~~~~~~~~~
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h: In member function ‘const QOpenGLExtension_SUN_triangle_listPrivate* QOpenGLExtension_SUN_triangle_list::d_func() const’:
      ../../include/QtCore/../../../../qt5/qtbase/src/corelib/global/qglobal.h:1042:119: error: cast from ‘QAbstractOpenGLExtensionPrivate*’ to ‘const QOpenGLExtension_SUN_triangle_listPrivate*’ increases required alignment of target type [-Werror=cast-align]
           inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
                                                                                                                             ^
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h:17577:5: note: in expansion of macro ‘Q_DECLARE_PRIVATE’
           Q_DECLARE_PRIVATE(QOpenGLExtension_SUN_triangle_list)
           ^~~~~~~~~~~~~~~~~
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h: In member function ‘QOpenGLExtension_SUN_vertexPrivate* QOpenGLExtension_SUN_vertex::d_func()’:
      ../../include/QtCore/../../../../qt5/qtbase/src/corelib/global/qglobal.h:1041:101: error: cast from ‘QAbstractOpenGLExtensionPrivate*’ to ‘QOpenGLExtension_SUN_vertexPrivate*’ increases required alignment of target type [-Werror=cast-align]
           inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
                                                                                                           ^
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h:17716:5: note: in expansion of macro ‘Q_DECLARE_PRIVATE’
           Q_DECLARE_PRIVATE(QOpenGLExtension_SUN_vertex)
           ^~~~~~~~~~~~~~~~~
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h: In member function ‘const QOpenGLExtension_SUN_vertexPrivate* QOpenGLExtension_SUN_vertex::d_func() const’:
      ../../include/QtCore/../../../../qt5/qtbase/src/corelib/global/qglobal.h:1042:119: error: cast from ‘QAbstractOpenGLExtensionPrivate*’ to ‘const QOpenGLExtension_SUN_vertexPrivate*’ increases required alignment of target type [-Werror=cast-align]
           inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
                                                                                                                             ^
      /home/sun/qt/qt5/qtbase/src/openglextensions/qopenglextensions.h:17716:5: note: in expansion of macro ‘Q_DECLARE_PRIVATE’
           Q_DECLARE_PRIVATE(QOpenGLExtension_SUN_vertex)
           ^~~~~~~~~~~~~~~~~
      cc1plus: all warnings being treated as errors
      make: *** [Makefile:411: .obj/header_qopenglextensions.o] Error 1
      
      [sun@localhost openglextensions]$ g++ -v
      Using built-in specs.
      COLLECT_GCC=g++
      COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips64el-redhat-linux/8/lto-wrapper
      Target: mips64el-redhat-linux
      Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=both --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-gnu-indirect-function --with-long-double-128 --with-arch=mips64r2 --with-abi=64 --build=mips64el-redhat-linux
      Thread model: posix
      gcc version 8.1.0 20180502 (Red Hat 8.1.0-0.21) (GCC)

       

      Attachments

        1. cast-align.cpp
          0.7 kB
        2. output.tgz
          11 kB
        3. output2.tgz
          11 kB
        For Gerrit Dashboard: QTBUG-72885
        # Subject Branch Project Status CR V

        Activity

          People

            Eddy Edward Welbourne
            sunny2038 Boxiang Sun
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes