[GUI] QT 5.7 #8237

issue fanquake opened this issue on June 22, 2016
  1. fanquake commented at 7:38 AM on June 22, 2016: member

    Opening an issue to track potential QT5.7 improvements, so that comments don't get lost on closed PRs.

    QT 5.7 has been released.

    Starting with Qt 5.7, we will require a C++11 compliant compiler to build and use Qt. 
    This allows us to use many of the new features in Qt itself, and renew our codebase 
    using features such as constexpr, move semantics, range-for and auto. These efforts 
    are well under way and will continue throughout the next versions.
    
    #### Qt Core
    - Qt uses poll() instead of select() in it’s event loop allowing for more than 1024 file 
    descriptors
    - Qt now uses std::atomic for it’s atomic classes
    

    #8053 (comment)

    Though it's worth noting for a future pr: 5.7 improves a few build-related
    things for us:
    - allows for split native tools build.
    - passes flags (like -D and -B only to the host toolchain)
    
    (I'm on mobile so those are from memory, may not be 100% accurate. I also
    haven't tested that those work as intended.)
    
    The first should allow us to split up the build into more reasonable chunks
    (native_qttools and qtlibs).
    
    The second should allow us to drop the xcb patch in favor of using more
    detailed flags. It should also allow us to drop the hackish env vars we use.
    
  2. MarcoFalke added this to the milestone 0.14 on Jun 22, 2016
  3. MarcoFalke added the label GUI on Jun 22, 2016
  4. laanwj added the label Upstream on Aug 4, 2016
  5. fanquake commented at 2:50 AM on September 27, 2016: member

    Qt 5.6.1 no longer builds on OS X with Xcode 8. A fix could mean a bump to 5.6.2, or it could be worth patching if we'd rather move straight to 5.7.

  6. luke-jr commented at 4:43 AM on September 27, 2016: member

    @fanquake We only manage dependencies for gitian, which doesn't seem to have a problem. What dependencies people use when building themselves is outside of the project's scope, except for minimum dependencies, which is currently Qt 4.8. While it will hopefully make sense to bump the minimum Qt dep "soon"*, I doubt 5.7 will be practical for a while: Debian stable is at 5.3.

    * Uhh, unless I'm mistaken, does RHEL really not have any Qt5 yet? :(

  7. jonasschnelli commented at 6:23 AM on September 27, 2016: contributor

    I think the depends system should work outside of gitian as well.

    Maybe not on every exotic distro, but accepting patches that make the depends build system more portable is desirable imo.

  8. laanwj commented at 6:29 AM on September 27, 2016: member

    I think the depends system should work outside of gitian as well.

    It's also the recommended way to do non-gitian cross-compiles, so it's nice if it works with other (versions of) toolchains as well. Of course there is a limit to this, as there are tons of broken and old toolchains around that we can't support. But if someone submits a compatibility patch "we only support gitian" is no reason to reject it.

  9. luke-jr commented at 9:36 AM on September 27, 2016: member

    Ah, didn't think of that scenario.

  10. fanquake commented at 2:18 AM on November 7, 2016: member

    QT 5.7.0 is now the default qt5 install via brew on OS X, it's currently failing compilation with "Qt requires C++11 support".

    In file included from qt/macdockiconhandler.mm:5:
    In file included from ./qt/macdockiconhandler.h:8:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/QMainWindow:1:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qmainwindow.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qwidget.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtGui/qwindowdefs.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:1145:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qatomic.h:46:
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:61:4: error: "Qt requires C++11 support"
    #  error "Qt requires C++11 support"
       ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:90:13: error: unknown type name 'QAtomicOps'
        typedef QAtomicOps<T> Ops;
                ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:90:23: error: expected member name or ';' after
          declaration specifiers
        typedef QAtomicOps<T> Ops;
        ~~~~~~~~~~~~~~~~~~^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:93:23: error: use of undeclared identifier
          'QAtomicOpsSupport'
        Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of ...
                          ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:93:53: error: no member named 'IsSupported' in the
          global namespace
        Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of ...
                                                      ~~^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:761:63: note: expanded from macro 'Q_STATIC_ASSERT_X'
    #define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
                                                                  ^~~~~~~~~
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:756:110: note: expanded from macro 'Q_STATIC_ASSERT'
      ...__COUNTER__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
                                                       ^~~~~~~~~
    In file included from qt/macdockiconhandler.mm:5:
    In file included from ./qt/macdockiconhandler.h:8:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/QMainWindow:1:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qmainwindow.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qwidget.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtGui/qwindowdefs.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:1145:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qatomic.h:46:
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:93:5: error: type name requires a specifier or
          qualifier
        Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of ...
        ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:761:47: note: expanded from macro 'Q_STATIC_ASSERT_X'
    #define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
                                                  ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:756:121: note: expanded from macro 'Q_STATIC_ASSERT'
      ...__COUNTER__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
                                                                  ^
    In file included from qt/macdockiconhandler.mm:5:
    In file included from ./qt/macdockiconhandler.h:8:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/QMainWindow:1:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qmainwindow.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtWidgets/qwidget.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtGui/qwindowdefs.h:43:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qglobal.h:1145:
    In file included from /usr/local/Cellar/qt5/5.7.0/include/QtCore/qatomic.h:46:
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:95:14: error: use of undeclared identifier 'Ops'
        typename Ops::Type _q_value;
                 ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:95:19: error: expected a qualified name after
          'typename'
        typename Ops::Type _q_value;
                      ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:95:23: error: expected ';' at end of declaration list
        typename Ops::Type _q_value;
                          ^
                          ;
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:99:44: error: use of undeclared identifier 'Ops'
        T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
                                               ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:99:54: error: use of undeclared identifier '_q_value'
        T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
                                                         ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:100:45: error: use of undeclared identifier 'Ops'
        void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
                                                ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:100:56: error: use of undeclared identifier '_q_value'
        void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
                                                           ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:102:51: error: use of undeclared identifier 'Ops'
        T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
                                                      ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:102:68: error: use of undeclared identifier '_q_value'
        T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
                                                                       ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:103:52: error: use of undeclared identifier 'Ops'
        void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
                                                       ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:103:70: error: use of undeclared identifier '_q_value'
        void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
                                                                         ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:107:86: error: use of undeclared identifier 'Ops'
        static Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return Ops::isReferenceCou...
                                                                                         ^
    /usr/local/Cellar/qt5/5.7.0/include/QtCore/qbasicatomic.h:108:88: error: use of undeclared identifier 'Ops'
        static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return Ops::isReferenceC...
                                                                                           ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    1 warning and 20 errors generated.
    make[2]: *** [qt/qt_bitcoin_qt-macdockiconhandler.o] Error 1
    
  11. droark commented at 5:04 PM on November 7, 2016: contributor

    @fanquake - How do you keep beating me to the punch? :) Was about to report this. My workaround for now is to use brew switch qt5 5.5.1_2 to go back to 5.5, which seems to compile without issues. I don't know offhand if this is because I did a brew tap homebrew/versions earlier, which led to homebrew/versions/qt55 showing up when running brew search qt5.

  12. theuni commented at 10:27 PM on November 8, 2016: member

    @fanquake hmm, looks like the issue there is OBJCXX not using the c++11 flag. I'm not sure about the cleanest fix for this. Does this quick patch solve the problem?

    diff --git a/configure.ac b/configure.ac
    index 705327e..196b687 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -359,7 +359,7 @@ case $host in
    
          AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"])
          CPPFLAGS="$CPPFLAGS -DMAC_OSX"
    -     OBJCXXFLAGS="$CXXFLAGS"
    +     OBJCXXFLAGS="-std=c++11 $CXXFLAGS"
          ;;
        *linux*)
          TARGET_OS=linux
    
  13. theuni assigned theuni on Nov 8, 2016
  14. fanquake commented at 5:33 AM on November 9, 2016: member

    @theuni That seems to do the trick, compiling works now. Can this be PR'd as a quick fix, or would you prefer something different?

  15. theuni commented at 5:44 AM on November 9, 2016: member

    @fanquake Hmm, let's think on it for a day or two. The issue is this:

    If the osx compiler in the future defaults to a higher std version (c++14/c++17), everything else will be compiled that way, while the .mm's are hard-coded to c++11. g++ 6.1+ already does that, so if someone has installed a recent g++ from brew, this will cause issues.

    Ideally, ax_cxx_compile_stdcxx.m4 would export OBJCXX as well. We might be better off patching/upstreaming that change.

  16. morcos commented at 3:18 PM on November 15, 2016: member

    @theuni i struggled with this problem today. your patch fixed it, but we should PR some kind of fix so people don't keep running into this.

  17. theuni commented at 9:17 PM on November 15, 2016: member

    See #9169. Afaik, that should be future-proof against current/future compilers that have started switching to different std versions.

  18. laanwj closed this on Nov 16, 2016

  19. fanquake reopened this on Nov 16, 2016

  20. laanwj closed this on Jan 15, 2017

  21. switzer referenced this in commit d64cbbda02 on Mar 2, 2018
  22. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me