build: Use Link Time Optimization in Qt code for Darwin hosts #25744

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:220729-qt-darwin-lto changing 2 files +4 −0
  1. hebasto commented at 9:46 PM on July 29, 2022: member

    While building the qt package in depends succeeds, the following configure script fails with:

    ...
    LLVM ERROR: Unexistent dir: '/tmp/cc-dea72a.o'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ...
    

    when checking for QMinimalIntegrationPlugin.

  2. build: Use Link Time Optimization in Qt code for Darwin hosts e00910f41b
  3. DrahtBot added the label Build system on Jul 29, 2022
  4. fanquake commented at 8:23 AM on July 30, 2022: member

    the following configure

    what configure?

  5. hebasto commented at 10:17 AM on July 30, 2022: member

    the following configure

    what configure?

    ./configure CONFIG_SITE=$PWD/depends/x86_64-apple-darwin/share/config.site
    
  6. fanquake commented at 10:24 AM on July 30, 2022: member

    I'm confused, because that works for master. I assume it's only started failing after you've introduced the additional changes in this PR?

  7. hebasto commented at 10:45 AM on July 30, 2022: member

    I'm confused

    So do I :)

    because that works for master.

    LTO does not work in Qt code for Darwin hosts on the master branch:

    $ make -C depends qt_configured HOST=x86_64-apple-darwin LTO=1
    ...
    Build options:
    ...
      Using LTCG ............................. no
    ...
    

    Just adding (package)_config_opts_darwin += -ltcg makes building of the qt package fail.

    I assume it's only started failing after you've introduced the additional changes in this PR?

    After current changes building of the qt package with LTO=1 succeeds.

  8. fanquake commented at 10:52 AM on July 30, 2022: member

    LTO does not work in Qt code for Darwin hosts on the master branch:

    It does. It just doesn't use Qts special ltcg mode. That isn't actually required to build binaries with LTO.

  9. in depends/patches/qt/mac-qmake.conf:21 in e00910f41b
      17 | @@ -18,5 +18,6 @@ QMAKE_MAC_SDK.macosx.PlatformPath = /phony
      18 |  !host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET}
      19 |  !host_build: QMAKE_LFLAGS += -target $${MAC_TARGET}
      20 |  QMAKE_AR = $${CROSS_COMPILE}ar cq
      21 | +QMAKE_AR_LTCG = llvm-ar cqs
    


    fanquake commented at 10:56 AM on July 30, 2022:

    Shouldn't this be an ar from our binutils? Otherwise isn't this requiring llvm to be installed?


    fanquake commented at 2:53 PM on August 4, 2022:

    Tested this branch, without llvm (which shouldn't become a dependency), this will fail with:

    make[4]: llvm-ar: No such file or directory
    

    Any reason we can't do?

    QMAKE_AR_LTCG = $${CROSS_COMPILE}ar cqs
    

    hebasto commented at 11:15 AM on August 6, 2022:

    It does not work.

  10. hebasto closed this on Aug 6, 2022

  11. bitcoin locked this on Aug 6, 2023
Contributors

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-24 21:13 UTC

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