depends: Fix cross build for qt5.7 #9646

pull theuni wants to merge 3 commits into bitcoin:master from theuni:fix-qt57 changing 5 files +43 −15
  1. theuni commented at 7:01 AM on January 28, 2017: member

    Fixes #9585.

    The qt build is a mess, but this gets it building for 5.7. Going forward, we need to split it up into smaller parts, where the native tools (qmake/rcc/uic/etc.) are separate from the target libs. That will let us eliminate all of the cross-build hacks.

    Includes a temp commit to have Travis build for Windows.

  2. build: find qt's renamed helper libs from 5.7 342eb9618a
  3. depends: add a zlib build
    qt5.7 changed the location of some of its symbols, creating a circular
    dependency in Qt5Core. Rather than trying to fix that up, build our own zlib
    rather than having it built for us.
    8efa34fb77
  4. qt: fix build with zlib for target
    This contains a few hacks very specific to Qt's buildsystem. These can be
    reverted once we split the build between native and target builds.
    
    Qt's build contains a circular dependency when not using a system zlib.
    By far the easiest fix is to switch to a system zlib, rather than Qt's own.
    However, that confuses Qt's cross build which assumes that when using a system
    zlib, it should also find a system (native) zlib for native tools. The build
    breaks if that zlib is not present.
    
    To solve this:
    1. Always use a system zlib rather than the one provided by qt
    2. Set force_bootstrap, which instructs the build tools to be built as though
       we're cross-compiling (build != target)
    3. For build tools, use qt's internal zlib so that a native zlib is not
    required.
    
    Step 3 means that if any zlib headers are found by the native build, it will
    confuse Qt's internal zlib build. So we also need to make sure that the target
    headers/libs aren't found. To do so, specify that our
    cflags/cxxflags/cppflags/ldflags only apply for non-host builds.
    b5f374fef7
  5. fanquake added the label Build system on Jan 28, 2017
  6. fanquake added this to the milestone 0.14.0 on Jan 28, 2017
  7. MarcoFalke commented at 3:19 PM on January 28, 2017: member

    Concept ACK.

    The travis log mentions, that qt was detected:

    Options used to compile and link:
      with wallet   = yes
      with gui / qt = yes
        qt version  = 5
        with qr     = yes
      with zmq      = yes
      with test     = yes
      with bench    = yes
      with upnp     = yes
      debug enabled = no
    
      target os     = windows
      build os      = 
    
      CC            = /home/travis/build/bitcoin/bitcoin/depends/x86_64-w64-mingw32/share/../native/bin/ccache x86_64-w64-mingw32-gcc
      CFLAGS        = -pipe -O2 
      CPPFLAGS      = -I/home/travis/build/bitcoin/bitcoin/depends/x86_64-w64-mingw32/share/../include/  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_FILE_OFFSET_BITS=64
      CXX           = /home/travis/build/bitcoin/bitcoin/depends/x86_64-w64-mingw32/share/../native/bin/ccache x86_64-w64-mingw32-g++ -std=c++11
      CXXFLAGS      = -pipe -O2  -fvisibility=hidden
      LDFLAGS       = -L/home/travis/build/bitcoin/bitcoin/depends/x86_64-w64-mingw32/share/../lib 
    
    

    So I guess you are fine to drop the last commit?

  8. theuni force-pushed on Jan 28, 2017
  9. theuni commented at 7:52 PM on January 28, 2017: member

    Done

  10. in build-aux/m4/bitcoin_qt.m4:None in b5f374fef7
     472 | @@ -473,8 +473,8 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
     473 |    ])
     474 |  
     475 |    BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in])))
     476 | -  BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))
     477 | -  BITCOIN_QT_CHECK(AC_CHECK_LIB([jpeg] ,[main],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in])))
     478 | +  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))
     479 | +  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([jpeg_create_decompress] ,[qtjpeg jpeg],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in])))
    


    MarcoFalke commented at 4:10 PM on January 29, 2017:

    We are not using jpeg, so this seems unused.

  11. laanwj commented at 7:43 AM on January 30, 2017: member

    Tested ACK b5f374f. I built with gitian and can see that the -qt executables are in the resulting .zip. I have however not tried to test them on windows, but the build works.

  12. fanquake commented at 7:53 AM on January 30, 2017: member

    I can't test this at the moment, but the changes look ok. Splitting up the Qt build has been on the cards for a while now.

    utACK.

    On Mon, 30 Jan 2017 at 07:43, Wladimir J. van der Laan < notifications@github.com> wrote:

    Tested ACK b5f374f https://github.com/bitcoin/bitcoin/commit/b5f374fef71ba2ba99e3d9629b66fd1491fd7c90 . I built with gitian and can see that the -qt executables are in the resulting .zip. I have however not tried to test them on windows, but the build works.

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/9646#issuecomment-275997309, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0t8lgJX2QHLf9YsGJOBq6dzXRafbCYks5rXZScgaJpZM4LwcKK .

  13. laanwj merged this on Jan 30, 2017
  14. laanwj closed this on Jan 30, 2017

  15. laanwj referenced this in commit 720b579480 on Jan 30, 2017
  16. achow101 commented at 7:34 PM on January 30, 2017: member

    Post-merge ACK

    Built with gitian and tested on Windows 10

  17. codablock referenced this in commit cdb62e78b1 on Jan 19, 2018
  18. codablock referenced this in commit f10576639d on Jan 20, 2018
  19. codablock referenced this in commit a757261e89 on Jan 21, 2018
  20. DrahtBot 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-18 15:15 UTC

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