Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. qt-5.15.0: cross-compile with gcc-4.9
Forum Updated to NodeBB v4.3 + New Features

qt-5.15.0: cross-compile with gcc-4.9

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
14 Posts 3 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    debian
    wrote on last edited by
    #5

    @jsulm , why we are can't use GCC-4.9 if src/corelib/global/qcompilerdetection.h check many versions of GCC from GCC-4.3?

    jsulmJ 1 Reply Last reply
    0
    • D debian

      @jsulm , why we are can't use GCC-4.9 if src/corelib/global/qcompilerdetection.h check many versions of GCC from GCC-4.3?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @debian Which Qt version?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        debian
        wrote on last edited by
        #7

        @jsulm , now I use Qt-5.12.6 and I try upgrade it to Qt-5.15.0 because it have some important fixes.

        S 1 Reply Last reply
        0
        • jsulmJ jsulm

          @sonicss "Using C++ standard ..................... C++11" - C++11 is already activated. But it looks like you can't build Qt 5.15 with GCC 4.9.
          See https://doc.qt.io/qt-5/supported-platforms.html
          "Generic Linux x86 and x86_64 GCC (5 or later), ICC 18.x" - looks like you need at least GCC 5.

          S Offline
          S Offline
          sonicss
          wrote on last edited by
          #8

          @jsulm Thanks a lot

          1 Reply Last reply
          0
          • D debian

            Hello, @sonicss !
            I pass C++ standart at configure step via -c++std parameters.
            I was have same error #error "Qt requires C++11 support", I patch source for fix it

            $ git diff src/
            diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
            index ebffe74188..0f5e71b4de 100644
            --- a/src/corelib/global/qcompilerdetection.h
            +++ b/src/corelib/global/qcompilerdetection.h
            @@ -912,7 +912,7 @@
             #         define Q_COMPILER_REF_QUALIFIERS
             #      endif
             #    endif
            -#    if Q_CC_GNU >= 500
            +#    if Q_CC_GNU >= 409
                    /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole
                     * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */
             #      define Q_COMPILER_CONSTEXPR
            
            S Offline
            S Offline
            sonicss
            wrote on last edited by
            #9

            @debian Thanks, I will make a try.

            1 Reply Last reply
            0
            • D debian

              @jsulm , now I use Qt-5.12.6 and I try upgrade it to Qt-5.15.0 because it have some important fixes.

              S Offline
              S Offline
              sonicss
              wrote on last edited by
              #10

              @debian I read the file:
              qcompilerdetection.h

              #    if Q_CC_GNU >= 500
                     /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole
                      * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */
              #      define Q_COMPILER_CONSTEXPR
              #    endif
              

              I think the new version of qt use constexpr, and the 4.x version of gcc has a bug in it. so can't use the version below 5 of gcc.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                debian
                wrote on last edited by
                #11

                @sonicss , I think more correct check this at configure stage and why Qt enable different features for different versions of the GCC?
                https://github.com/qt/qtbase/blob/5.15.0/src/corelib/global/qcompilerdetection.h#L839
                Why minimal version is the GCC-4.3 if I can build Qt only with GCC-5 and above?

                S 1 Reply Last reply
                0
                • D debian

                  @sonicss , I think more correct check this at configure stage and why Qt enable different features for different versions of the GCC?
                  https://github.com/qt/qtbase/blob/5.15.0/src/corelib/global/qcompilerdetection.h#L839
                  Why minimal version is the GCC-4.3 if I can build Qt only with GCC-5 and above?

                  S Offline
                  S Offline
                  sonicss
                  wrote on last edited by
                  #12

                  @debian I compared the file (qcompilerdetection.h) in Qt 5.12.8 and Qt5.15.0, the positon of Macro Q_COMPILER_CONSTEXPR is different, so I put this Macro to Q_CC_GNU >= 406, and make the Qt 5.15.0, It still have some errors. But the errors are different.
                  something like belows:

                  In file included from ../../include/QtCore/qmetatype.h:1:0,
                                   from ../../include/QtCore/../../src/corelib/kernel/qobject.h:54,
                                   from ../../include/QtCore/qobject.h:1,
                                   from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:46,
                                   from ../../include/QtCore/qcoreapplication.h:1,
                                   from global/qt_pch.h:66:
                  ../../include/QtCore/../../src/corelib/kernel/qmetatype.h: In instantiation of 'QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIterableImpl(const T*) [with T = QList<QVariant>]':
                  ../../include/QtCore/../../src/corelib/kernel/qvariant.h:772:139:   required from here
                  ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: error: ambiguous class template instantiation for 'struct QtMetaTypePrivate::ContainerCapabilitiesImpl<QList<QVariant>, void>'
                         , _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl<T>::ContainerCapabilities << (4+3)))
                                                                                                                                                         ^
                  In file included from ../../include/QtCore/qmetatype.h:1:0,
                                   from ../../include/QtCore/../../src/corelib/kernel/qobject.h:54,
                                   from ../../include/QtCore/qobject.h:1,
                                   from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:46,
                                   from ../../include/QtCore/qcoreapplication.h:1,
                                   from global/qt_pch.h:66:
                  ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1007:8: error: candidates are: struct QtMetaTypePrivate::ContainerCapabilitiesImpl<Container, decltype (declval<Container>().push_back(declval<typename Container::value_type>()))>
                   struct ContainerCapabilitiesImpl<Container, decltype(std::declval<Container>().push_back(std::declval<typename Container::value_type>()))>
                  
                  
                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    debian
                    wrote on last edited by
                    #13

                    @sonicss , error is same, error position is not important, possible reason - different number of the build threads.

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      debian
                      wrote on last edited by
                      #14

                      ok, I success build with GCC-5.1 http://releases.linaro.org/components/toolchain/binaries/5.1-2015.08/arm-linux-gnueabihf/

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved