bitcoin/depends/packages
fanquake 2e1336dbfe
Merge #20471: build: use C++17 in depends
2f5dfe4a7f depends: build qt in c++17 mode (fanquake)
104e859c97 builds: don't pass -silent to qt when building in debug mode (fanquake)
e2c500636c depends: build zeromq with -std=c++17 (fanquake)
2374f2fbef depends: build Boost with -std=c++17 (fanquake)
2dde55702d depends: build bdb with -std=c++17 (fanquake)

Pull request description:

  In packages where we are passing `-std=c++11` switch to `-std=c++17`, or, `-std=c++1z` in the case of Qt.

  This PR also contains a [commit](104e859c97) that improves debug output when building Qt for debugging (`DEBUG=1`).

  Now we'll get output like this:
  ```bash
  g++ -c -pipe -ffunction-sections -O2 -fPIC -std=c++11 -fno-exceptions <lots more> ../../corelib/kernel/qcoreapplication.cpp
  ```
  rather than just:
  ```bash
  compiling ../../corelib/kernel/qcoreapplication.cpp
  ```

  Note that when you look at the DEBUG output for these changes when building Qt, you'll see objects being compiled with a mix of C++11 and C++17. The breakdown is roughly:

  1. `qmake` built with `-std=c++11`:
  ```bash
  Creating qmake...
  make[1]: Entering directory '<trim>/qt/5.9.8-4110fa99945/qtbase/qmake'
  g++ -c -o project.o   -std=c++11 -ffunction-sections -O2 -g <trim> <trim>/qt/5.9.8-4110fa99945/qtbase/qmake/project.cpp

  # when qmake, Qt also builds some of it's corelib, such as corelib/global/qmalloc.cpp
  g++ -c -o qmalloc.o   -std=c++11 -ffunction-sections -O2 -g <trim> <trim>/qt/5.9.8-4110fa99945/qtbase/src/corelib/global/qmalloc.cpp
  ```

  2. `qmake` is run, and passed our build options, including `-c++std`:
  ```bash
  make[1]: Entering directory '<trim>/qt/5.9.8-4110fa99945/qtbase'
  <trim>qt/5.9.8-4110fa99945/qtbase/bin/qmake -o Makefile qtbase.pro -- -bindir <trim>/native/bin -c++std c++1z -confirm-license <trim>
  ```

  3. After some cleaning and configuring, we actually start to build Qt, as well as it's tools and internal libs:
  ```bash
  Building qt...
  make[1]: Entering directory '<trim>/qt/5.9.8-4110fa99945/qtbase/src'

  # build libpng, zlib etc
  gcc -c -m64 -pipe -pipe -O1 <trim> -o .obj/png.o png.c

  # build libQt5Bootstrap, using C++11, which again compiles qmalloc.cpp
  make[2]: Entering directory '<trim>/qt/5.9.8-4110fa99945/qtbase/src/tools/bootstrap'
  g++ -c -pipe -ffunction-sections -O2 -fPIC -std=c++11 <trim> -o .obj/qmalloc.o ../../corelib/global/qmalloc.cpp

  # build a bunch of tools like moc, rcc, uic, qfloat16-tables, qdbuscpp2xml, using C++11
  g++ -c -pipe -O2 -std=c++11 -fno-exceptions -Wall -W <trim> -o .obj/rcc.o rcc.cpp

  # from here, Qt is compiled with -std=c++1z, including qmalloc.cpp, for the third and final time:
  g++ -c -include .pch/Qt5Core <trim> -g -Og -fPIC -std=c++1z -fvisibility=hidden <trim> -o .obj/qmalloc.o global/qmalloc.cpp
  ```

  4.  Finally, build tools like `lrelease`, `lupdate`, etc, but back to using -std=c++11
  ```bash
  make[1]: Entering directory '<trim>/qt/5.9.8-4110fa99945/qttools/src/linguist/lrelease'
  g++ -c -pipe -O2 -std=c++11 -fno-exceptions -Wall -W <trim> -o .obj/translator.o ../shared/translator.cpp
  ```

  If you dump the debug info from the built Qt libs, they should also tell you that they were compiled with `C++17`:
  ```bash
  objdump -g bitcoin/depends/x86_64-pc-linux-gnu/lib/libQt5Core.a
  GNU C++17 9.3.0 -m64 -mtune=generic -march=x86-64 -g -O1 -Og -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection
  ```

ACKs for top commit:
  laanwj:
    Code review ACK 2f5dfe4a7f
  practicalswift:
    cr ACK 2f5dfe4a7f: patch looks correct
  fjahr:
    Code review ACK 2f5dfe4a7f
  hebasto:
    ACK 2f5dfe4a7f, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: fc5e9d7c7518c68349c8228fb1aead829850373efc960c9b8c079096a83d1dad19c62a9730fce5802322bf07e320960fd47851420d429eda0a87c307f4e8b03a
2020-11-30 12:23:23 +08:00
..
bdb.mk depends: build bdb with -std=c++17 2020-11-24 07:29:28 +08:00
boost.mk Merge #20471: build: use C++17 in depends 2020-11-30 12:23:23 +08:00
capnp.mk depends: add MULTIPROCESS depends option 2020-05-12 09:47:06 -04:00
expat.mk build: pass --enable-option-checking to applicable packages 2019-10-11 13:31:50 -04:00
fontconfig.mk build: use patch rather than sed in fontconfig package 2020-08-25 14:37:35 +08:00
freetype.mk build: pass --enable-option-checking to applicable packages 2019-10-11 13:31:50 -04:00
libevent.mk build: pass _WIN32_WINNT=0x0601 when building libevent for Windows 2020-06-30 13:25:09 +08:00
libmultiprocess.mk depends: add MULTIPROCESS depends option 2020-05-12 09:47:06 -04:00
libXau.mk build: pass --enable-option-checking to applicable packages 2019-10-11 13:31:50 -04:00
libxcb.mk build: pass --enable-option-checking to applicable packages 2019-10-11 13:31:50 -04:00
miniupnpc.mk build: replace wingenminiupnpcstrings sed with a patch in miniupnpc package 2020-08-26 11:27:31 +08:00
native_b2.mk depends: boost: Split into non-/native packages 2020-11-23 15:50:54 -05:00
native_capnp.mk depends: add MULTIPROCESS depends option 2020-05-12 09:47:06 -04:00
native_cctools.mk build: use patch rather than sed in native_cctools package 2020-08-25 14:37:44 +08:00
native_cdrkit.mk depends: Use $($(package)_cmake) instead of cmake 2020-08-07 20:52:22 -04:00
native_ds_store.mk depends: native_ds_store 1.3.0 2020-11-11 08:01:02 +08:00
native_libdmg-hfsplus.mk depends: Use $($(package)_cmake) instead of cmake 2020-08-07 20:52:22 -04:00
native_libmultiprocess.mk depends: add MULTIPROCESS depends option 2020-05-12 09:47:06 -04:00
native_mac_alias.mk build: depends: Switch to python3 2019-03-14 15:47:00 -04:00
packages.mk depends: boost: Split into non-/native packages 2020-11-23 15:50:54 -05:00
qrencode.mk Merge #16110: depends: Add Android NDK support 2019-11-04 13:32:19 +01:00
qt.mk Merge #20471: build: use C++17 in depends 2020-11-30 12:23:23 +08:00
sqlite.mk Add sqlite to travis and depends 2020-10-14 11:18:13 -04:00
xcb_proto.mk depends: don't configure xcb_proto 2019-12-08 17:55:11 -05:00
xproto.mk build: pass --enable-option-checking to applicable packages 2019-10-11 13:31:50 -04:00
zeromq.mk depends: build zeromq with -std=c++17 2020-11-24 10:18:06 +08:00
zlib.mk Android: add all arch support 2019-10-18 22:24:21 +02:00