fix a static qt5 crash when using certain versions of libxcb #5915

pull theuni wants to merge 1 commits into bitcoin:master from theuni:fix-static-qt changing 2 files +35 −20
  1. theuni commented at 3:59 am on March 17, 2015: member

    This one’s really subtle. Fixes #5910. Confirmed fixed in gitian.

    See here for background: https://bugreports.qt.io/browse/QTBUG-34748

    libxcb temporarily had an abi breakage which caused crashes when qt was compiled against a non-compatible version. Building qt with -qt-xcb should have shielded us from this issue, except that incompatible headers were used when building qt’s wrapper.

    Make sure those headers aren’t picked up by qt’s build.

    Details:

    qt’s build adds a wrapper around the xcb libs when -qt-xcb is used. This is done to avoid having to link to a handful of different libs, which may not be api/abi stable. This build depends on include-order, so that its files are found before the real libxcb headers.

    Our build (for other reasons related to qt’s complicated build-system) injects our prefix into CXXFLAGS. Because libxcb is found in this path, that reverses the include-order, negating the purpose of the wrapper.

    To fix, libxcb’s includes are simply moved to a subdir. pkg-config ensures that they’re still found properly when needed.

    To make things even more interesting, this behavior in qt’s .pro files is broken: INCLUDEPATH += $$QMAKE_CFLAGS_XCB

    The INCLUDEPATH variable is processed by qmake which automatically prefixes each entry with “-I”. The QMAKE_CFLAGS_XCB variable comes from pkg-config and already contains -I, making the path look like “-I-I/path/to/xcb/headers”.

    To work around that, CFLAGS/CXXFLAGS are used here rather than INCLUDEPATH.

  2. depends: fix a static qt5 crash when using certain versions of libxcb
    See here for background: https://bugreports.qt.io/browse/QTBUG-34748
    
    libxcb temporarily had an abi breakage which caused crashes when qt was
    compiled against a non-compatible version. Building qt with -qt-xcb should have
    shielded us from this issue, except that incompatible headers were used when
    building qt's wrapper.
    
    Make sure those headers aren't picked up by qt's build.
    
    Details:
    
    qt's build adds a wrapper around the xcb libs when -qt-xcb is used. This is
    done to avoid having to link to a handful of different libs, which may not be
    api/abi stable. This build depends on include-order, so that its files are
    found before the real libxcb headers.
    
    Our build (for other reasons related to qt's complicated build-system) injects
    our prefix into CXXFLAGS. Because libxcb is found in this path, that reverses
    the include-order, negating the purpose of the wrapper.
    
    To fix, libxcb's includes are simply moved to a subdir. pkg-config ensures that
    they're still found properly when needed.
    
    To make things even more interesting, this behavior in qt's .pro files is broken:
    INCLUDEPATH += $$QMAKE_CFLAGS_XCB
    
    The INCLUDEPATH variable is processed by qmake which automatically prefixes each
    entry with "-I". The QMAKE_CFLAGS_XCB variable comes from pkg-config and
    already contains -I, making the path look like "-I-I/path/to/xcb/headers".
    
    To work around that, CFLAGS/CXXFLAGS are used here rather than INCLUDEPATH.
    bb44d9e754
  3. laanwj added the label Build system on Mar 17, 2015
  4. laanwj commented at 6:59 am on March 17, 2015: member

    Thanks for analyzing this. Qt’s complex hand-rolled build system can really be a drag sometimes.

    Tested ACK.

  5. laanwj merged this on Mar 17, 2015
  6. laanwj closed this on Mar 17, 2015

  7. laanwj referenced this in commit 5bd3a92da2 on Mar 17, 2015
  8. jonasschnelli commented at 12:09 pm on March 17, 2015: contributor
    Post merge tested ACK (gitian build linux 64bit on ubuntu 14.04).
  9. hebasto referenced this in commit 5129b36573 on Mar 7, 2021
  10. fanquake referenced this in commit 461f0c781e on Mar 9, 2021
  11. sidhujag referenced this in commit dac2f3078e on Mar 9, 2021
  12. 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: 2024-11-18 03:12 UTC

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