depends: Do not force Precompiled Headers (PCH) for building Qt on Linux #20520

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:201127-pch changing 2 files +4 −3
  1. hebasto commented at 6:00 PM on November 27, 2020: member

    On CentOS 8 (Cirrus CI job) the forced -pch option breaks Qt build.

    Removing -pch option does not affect build time for other systems:

    • master (e2ff5e7b35d71195278d2a2ed9485f141de33d7a):
    $ time make -j 9 -C depends/ qt
    ...
    Caching qt...
    make: Leaving directory '/home/hebasto/guix/GitHub/bitcoin/depends'
    
    real	4m22,359s
    user	18m3,719s
    sys     1m24,769s
    
    • this PR:
    $ time make -j 9 -C depends/ qt
    ...
    Caching qt...
    make: Leaving directory '/home/hebasto/guix/GitHub/bitcoin/depends'
    
    real	4m14,862s
    user	18m3,355s
    sys 	1m24,506s
    

    Qt docs: https://doc.qt.io/qt-5/qmake-precompiledheaders.html

    Fixes #20423

  2. DrahtBot added the label Build system on Nov 27, 2020
  3. DrahtBot commented at 1:51 AM on November 28, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  4. MarcoFalke commented at 8:46 AM on November 28, 2020: member

    This effectively reverts commit 9267a47d86d0673eae9e504ee566aa4e0410d923 by @theuni

    review ACK b1f35876e91b3422a8f8c4ac4d1f389b72132c62 because this enables the GUI build again for i686, haven't checked the performance

  5. fanquake commented at 8:35 AM on November 30, 2020: member

    @hebasto can you post the log of the qt build failure when using -pch? Do you know what has changed between CentOS 7 & 8 that is causing the issue?

    Is using -pch still a problem when building newer Qt? i.e 5.15.x If the problem is just with CentOS, can we disable pch for Linux Qt builds, rather than wholesale?

  6. hebasto commented at 5:39 PM on November 30, 2020: member

    can you post the log of the qt build failure when using -pch?

    $ make -C depends qt
    ...
    Running configuration tests...
    ...
    Checking for precompiled header support... 
    + cd /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/config.tests/common/pch && PKG_CONFIG_SYSROOT_DIR=/ PKG_CONFIG_LIBDIR=/home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/lib/pkgconfig /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" -early "CONFIG += cross_compile" /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/config.tests/common/pch
    + cd /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/config.tests/common/pch && MAKEFLAGS= /usr/bin/gmake
    > gmake[1]: Entering directory '/home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/config.tests/common/pch'
    > g++ -m64 -pipe -pipe -O2 -I/home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include -O2 -w -fPIC  -I. -I/home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/mkspecs/linux-g++-64 -x c++-header -c header.h -o .pch/pch.gch/c++
    > g++ -c -include .pch/pch -m64 -pipe -pipe -O2 -I/home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include -O2 -w -fPIC  -I. -I/home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/mkspecs/linux-g++-64 -o source.o source.cpp
    > cc1plus: error: one or more PCH files were found, but they were invalid
    > cc1plus: error: use -Winvalid-pch for more information
    > cc1plus: fatal error: .pch/pch: No such file or directory
    > compilation terminated.
    > gmake[1]: *** [Makefile:183: source.o] Error 1
    > gmake[1]: Leaving directory '/home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/config.tests/common/pch'
    test config.qtbase.tests.precompile_header FAILED
    ...
    ERROR: Feature 'precompile_header' was enabled, but the pre-condition 'config.msvc || tests.precompile_header' failed.
    make: *** [funcs.mk:268: /home/hebasto/bitcoin/depends/work/build/x86_64-pc-linux-gnu/qt/5.9.8-991caec5731/qtbase/.stamp_configured] Error 3
    make: Leaving directory '/home/hebasto/bitcoin/depends'
    

    Do you know what has changed between CentOS 7 & 8 that is causing the issue?

    Compiler? CentOS 8 has gcc 8.3.1.

  7. MarcoFalke commented at 10:48 AM on December 2, 2020: member

    Anything left do do here? Disabling the gui cross compilation was only a temporary hack and it should be enabled again at the earliest convenience

  8. depends: Do not force Precompiled Headers (PCH) for building Qt on Linux
    On CentOS 8 the forced '-pch' option breaks Qt build.
    Removing '-pch' option does not affect build time for other Linux
    systems.
    c82d15b6d1
  9. hebasto force-pushed on Dec 2, 2020
  10. hebasto renamed this:
    ci, depends: Do not force Precompiled Headers (PCH) when building Qt
    depends: Do not force Precompiled Headers (PCH) when building Qt
    on Dec 2, 2020
  11. hebasto renamed this:
    depends: Do not force Precompiled Headers (PCH) when building Qt
    depends: Do not force Precompiled Headers (PCH) for building Qt on Linux
    on Dec 2, 2020
  12. hebasto commented at 11:53 AM on December 2, 2020: member

    Updated b1f35876e91b3422a8f8c4ac4d1f389b72132c62 -> c82d15b6d189983ebf82f35ade33d830870f25c6 (pr20520.01 -> pr20520.02, diff):

    If the problem is just with CentOS, can we disable pch for Linux Qt builds, rather than wholesale?

  13. MarcoFalke commented at 4:27 PM on December 2, 2020: member

    review ACK c82d15b6d189983ebf82f35ade33d830870f25c6

    I liked the simplicity of the first patch, but this looks fine, too

  14. laanwj commented at 12:22 PM on December 3, 2020: member

    This effectively reverts commit 9267a47 by @theuni

    I'm confused as to why this is suddenly broken. This patch is from 2016 !

    That said, merging this even as a temporary workaround makes sense.

  15. laanwj merged this on Dec 3, 2020
  16. laanwj closed this on Dec 3, 2020

  17. hebasto deleted the branch on Dec 3, 2020
  18. DrahtBot locked this on Feb 15, 2022

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 09:14 UTC

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