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
QtWS25 Last Chance

qt-5.15.0: cross-compile with gcc-4.9

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
14 Posts 3 Posters 4.1k 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
    #1

    Hello!
    I try cross-compile Qt-5.15.0 with gcc-4.9

    $ toolchain/arm-histbv310-linux/bin/arm-histbv310-linux-g++ -dumpversion
    4.9.2
    

    At configuration stage I pass use C++11 standart, configuration is success

    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-arm-hisilicon-hi3798mv100-g++ (arm, CPU features: neon)
    Target compiler: gcc 4.9.2
    Configuration: cross_compile compile_examples enable_new_dtags force_debug_info largefile neon silent shared shared rpath release c++11 concurrent reduce_exports separate_debug_info stl
    Build options:
      Mode ................................... release (with debug info)
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using new DTAGS ........................ yes
      Generating GDB index ................... no
      Relocatable ............................ yes
      Using precompiled headers .............. no
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. yes
      Build parts ............................ libs
    ..........
    

    But buid is fail

    .................
    compiling /tmp/firmware/_dependencies/qtbase/src/corelib/global/qhooks.cpp
    In file included from ../../include/QtCore/qmetatype.h:1:0,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/kernel/qobject.h:54,
                     from ../../include/QtCore/qobject.h:1,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/io/qiodevice.h:45,
                     from ../../include/QtCore/qiodevice.h:1,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/io/qfiledevice.h:43,
                     from ../../include/QtCore/qfiledevice.h:1,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/io/qfile.h:44,
                     from ../../include/QtCore/qfile.h:1,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/io/qfileinfo.h:43,
                     from ../../include/QtCore/qfileinfo.h:1,
                     from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
    elib/io/qdir.h:44,
                     from ../../include/QtCore/qdir.h:1,
                     from /tmp/firmware/_dependencies/qtbase/src/corelib/global/qlibrar
    yinfo.cpp:41:
    ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qmetatype.
    h: In instantiation of 'QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIter
    ableImpl(const T*) [with T = QList<QVariant>]':
    ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qvariant.h:772:139:   required from here
    ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qmetatype.h:1160:153: error: ambiguous class template instantiation for 'struct QtMetaTypePrivate::ContainerCapabilitiesImpl<QList<QVariant>, void>'
           , _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl<T>::ContainerCapabilities << (4+3)))
                                                                                                                                                             ^
    ...........
    

    How can I fix this?
    Thank you.

    P.S. Unfortunately I can't upgrade toolchain now.

    S 1 Reply Last reply
    0
    • D debian

      Hello!
      I try cross-compile Qt-5.15.0 with gcc-4.9

      $ toolchain/arm-histbv310-linux/bin/arm-histbv310-linux-g++ -dumpversion
      4.9.2
      

      At configuration stage I pass use C++11 standart, configuration is success

      Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
      Building for: devices/linux-arm-hisilicon-hi3798mv100-g++ (arm, CPU features: neon)
      Target compiler: gcc 4.9.2
      Configuration: cross_compile compile_examples enable_new_dtags force_debug_info largefile neon silent shared shared rpath release c++11 concurrent reduce_exports separate_debug_info stl
      Build options:
        Mode ................................... release (with debug info)
        Optimize release build for size ........ no
        Building shared libraries .............. yes
        Using C standard ....................... C11
        Using C++ standard ..................... C++11
        Using ccache ........................... no
        Using new DTAGS ........................ yes
        Generating GDB index ................... no
        Relocatable ............................ yes
        Using precompiled headers .............. no
        Using LTCG ............................. no
        Target compiler supports:
          NEON ................................. yes
        Build parts ............................ libs
      ..........
      

      But buid is fail

      .................
      compiling /tmp/firmware/_dependencies/qtbase/src/corelib/global/qhooks.cpp
      In file included from ../../include/QtCore/qmetatype.h:1:0,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/kernel/qobject.h:54,
                       from ../../include/QtCore/qobject.h:1,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/io/qiodevice.h:45,
                       from ../../include/QtCore/qiodevice.h:1,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/io/qfiledevice.h:43,
                       from ../../include/QtCore/qfiledevice.h:1,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/io/qfile.h:44,
                       from ../../include/QtCore/qfile.h:1,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/io/qfileinfo.h:43,
                       from ../../include/QtCore/qfileinfo.h:1,
                       from ../../include/QtCore/../../../../_dependencies/qtbase/src/cor
      elib/io/qdir.h:44,
                       from ../../include/QtCore/qdir.h:1,
                       from /tmp/firmware/_dependencies/qtbase/src/corelib/global/qlibrar
      yinfo.cpp:41:
      ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qmetatype.
      h: In instantiation of 'QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIter
      ableImpl(const T*) [with T = QList<QVariant>]':
      ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qvariant.h:772:139:   required from here
      ../../include/QtCore/../../../../_dependencies/qtbase/src/corelib/kernel/qmetatype.h:1160:153: error: ambiguous class template instantiation for 'struct QtMetaTypePrivate::ContainerCapabilitiesImpl<QList<QVariant>, void>'
             , _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl<T>::ContainerCapabilities << (4+3)))
                                                                                                                                                               ^
      ...........
      

      How can I fix this?
      Thank you.

      P.S. Unfortunately I can't upgrade toolchain now.

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

      @debian How to pass C++ 11 compiler?
      I met the simlar problem, I can't change the crosscompiler(my version is also 4.9.2), I crosscompiled the sourcecode of Qt5.14.0,Qt5.14.1,Qt5.14.2 and Qt5.15.0. The configure is ok, but can't pass making. the error message is :

      In file included from ../../include/QtCore/qbasicatomic.h:1:0,
      from ../../include/QtCore/../../src/corelib/thread/qatomic.h:46,
      from ../../include/QtCore/qatomic.h:1,
      from global/qglobal.h:1304,
      from global/qt_pch.h:56:
      ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"

      error "Qt requires C++11 support

      If I use the 7.5 version of crosscompile, It's ok.

      jsulmJ 1 Reply Last reply
      0
      • S sonicss

        @debian How to pass C++ 11 compiler?
        I met the simlar problem, I can't change the crosscompiler(my version is also 4.9.2), I crosscompiled the sourcecode of Qt5.14.0,Qt5.14.1,Qt5.14.2 and Qt5.15.0. The configure is ok, but can't pass making. the error message is :

        In file included from ../../include/QtCore/qbasicatomic.h:1:0,
        from ../../include/QtCore/../../src/corelib/thread/qatomic.h:46,
        from ../../include/QtCore/qatomic.h:1,
        from global/qglobal.h:1304,
        from global/qt_pch.h:56:
        ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"

        error "Qt requires C++11 support

        If I use the 7.5 version of crosscompile, It's ok.

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

        @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.

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

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

          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 1 Reply Last reply
          0
          • 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