Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Feb 11, 2020

Fix #16391

With this PR for macOS target, building depends with DEBUG=1 does not cause a linker error for Qt static plugins on the following configure script run.

Qt docs refs:

The obvious downside is the increased compilation time for macOS targets with DEBUG=1.

@DrahtBot
Copy link
Contributor

Gitian builds

File commit 98264e2
(master)
commit edc6265
(master and this pull)
bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz d23e69b2f698aced... 146e16d598cf9ef5...
bitcoin-0.19.99-aarch64-linux-gnu.tar.gz e837295a96c27d09... 489326f21eb1acc5...
bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz 8c7f60315568f1ac... 97df0285353b774a...
bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz 016bdc6abea558fc... 2b5c3e6333367456...
bitcoin-0.19.99-osx-unsigned.dmg d7a01b0abcfed7d7... b96460e8ce500b33...
bitcoin-0.19.99-osx64.tar.gz b7364a11f2d2205d... 986eaa3e7cb413d2...
bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz 7dbe057003731da1... 8b2ab0eaff647cc1...
bitcoin-0.19.99-riscv64-linux-gnu.tar.gz e82dac1f44f8992a... 7f74879e1375b491...
bitcoin-0.19.99-win64-debug.zip 68a16d902e1b374a... 66b3ef7f5f819f9e...
bitcoin-0.19.99-win64-setup-unsigned.exe 9e334ca3cbaa6401... 235fe66498ab08c8...
bitcoin-0.19.99-win64.zip 102307164336285c... 0beb1438b78a840e...
bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz 45e9703d1a54d9fc... e3b8684eb7d8cdd7...
bitcoin-0.19.99-x86_64-linux-gnu.tar.gz fe19b9e55e3764b5... 5bffb04fbac78bfc...
bitcoin-0.19.99.tar.gz ff2633d71780094b... 725986e69adad2c6...
bitcoin-core-linux-0.20-res.yml 8414d0032adae892... bf1b943c1208ddb1...
bitcoin-core-osx-0.20-res.yml 425e4d6afd46d6ed... 2d2686cfaf0d9c25...
bitcoin-core-win-0.20-res.yml 052e223dce02a5c8... be4a0d7abf76f7fe...
linux-build.log 5b46b3f211f100da... 9f94419a1e724fbe...
osx-build.log be05bc3a65338eb3... 3d84f2bc4e062438...
win-build.log 6f9323a7794d7918... 713a0e67b11ee45b...
bitcoin-core-linux-0.20-res.yml.diff e65b12a0cbe73240...
bitcoin-core-osx-0.20-res.yml.diff 763ff351a1d70cfa...
bitcoin-core-win-0.20-res.yml.diff dd0e9b74e017e2f1...
linux-build.log.diff e9f60c7b3aae2e27...
osx-build.log.diff ad0052e5e9885844...
win-build.log.diff e975a83b9f7feb1a...

@laanwj
Copy link
Member

laanwj commented Feb 28, 2020

Can you explain why this is needed? Why is only building the debug libraries in debug mode not good enough for MacOS?

The obvious downside is the increased compilation time for macOS targets with DEBUG=1.

I mean, this is not really a downside if it doesn't work otherwise!

@hebasto
Copy link
Member Author

hebasto commented Mar 3, 2020

@laanwj

Can you explain why this is needed? Why is only building the debug libraries in debug mode not good enough for MacOS?

For macOS targets with DEBUG=1 Qt adds the _debug suffix to its libs, for example:

.../plugins/platforms/libqminimal_debug.a

This causes that the following checks

AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
AC_MSG_CHECKING(for static Qt plugins: $2)
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
LIBS="$2 $QT_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define QT_STATICPLUGIN
#include <QtPlugin>
$1]],
[[return 0;]])],
[AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"],
[AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
])

to fail due to the linker error:

ld: library not found for -lqminimal

With this PR both lib versions, _debug and non-_debug, become available.

@hebasto
Copy link
Member Author

hebasto commented Mar 9, 2020

Closed in favor of #18298

@hebasto hebasto closed this Mar 9, 2020
@hebasto hebasto deleted the 20200211-macos-debug branch June 13, 2020 12:29
fanquake added a commit that referenced this pull request Mar 3, 2021
…s with DEBUG=1

76f52e3 build: Fix Qt processing of configure script for depends with DEBUG=1 (Hennadii Stepanov)

Pull request description:

  This PR:
  - makes the `configure` script correctly pickup Qt if depends is built with `DEBUG=1`:
      - for Windows -- fix #19266
      - for macOS -- fix #16391
  - is an alternative to #18117 (without downsides)

ACKs for top commit:
  fanquake:
    ACK 76f52e3. Tested native darwin, and darwin/win cross compile with `DEBUG=1`.

Tree-SHA512: 8fde99302b4b06faf109315bddba9e3063b156c50f8f9863c2bd51718538c719429a63fdced071730c18022f2e559d3b25c1dcec3efa81fe79f657253680956a
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build: configure doesn't pickup Qt if depends is built with DEBUG=1
5 participants