Merge #6301: backport: prereq cmake 4

2f751ed127 fixup! Merge bitcoin/bitcoin#30567: qt, build: Drop `QT_STATICPLUGIN` macro (pasta)
142245d29a Merge bitcoin/bitcoin#29733: build, macos: Drop unused `osx_volname` target (fanquake)
02f81e5e35 Merge bitcoin#23511: require glibc 2.18+ (pasta)
9f0e4ae82a Merge bitcoin/bitcoin#29706: depends: set two CMake options globally (fanquake)
be07bbe87e Merge bitcoin/bitcoin#28846: depends: fix libmultiprocess build on aarch64 (fanquake)
0dea194026 Merge bitcoin/bitcoin#28856: depends: Build the `native_capnp` and `capnp` packages with CMake (fanquake)
a23eee1938 partial Merge bitcoin/bitcoin#23619: build: Propagate user-defined flags to host packages (fanquake)
7cdacdc1ad Merge bitcoin/bitcoin#30513: depends: Bump `libmultiprocess` for CMake fixes (merge-script)
4f44750f9a Merge bitcoin/bitcoin#30491: Fix MSVC warning C4273 "inconsistent dll linkage" (merge-script)
5ba1309b71 Merge bitcoin/bitcoin#30567: qt, build: Drop `QT_STATICPLUGIN` macro (merge-script)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of more PRs that I found during make work

  ## What was done?

  ## How Has This Been Tested?
  hasn't yet

  ## Breaking Changes

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK 2f751ed127
  UdjinM6:
    utACK 2f751ed127

Tree-SHA512: 1d8433daaf8dc8c8f04beca1cf0281f0dc29a623e5e8ed941bcb556568d72d8ce0ac5b5c001b10645fdffaa4e7083b76d61075049b2418bb8dd9b5ba0f53a8a9
This commit is contained in:
pasta 2024-10-04 14:24:15 -05:00
commit e5daf4a322
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38
14 changed files with 40 additions and 31 deletions

1
.gitignore vendored
View File

@ -161,7 +161,6 @@ cmake-build-debug
# clang-check # clang-check
*.plist *.plist
osx_volname
dist/ dist/
/guix-build-* /guix-build-*

View File

@ -119,9 +119,6 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp
$(OSX_APP)/Contents/Resources/dash.icns $(OSX_APP)/Contents/Info.plist \ $(OSX_APP)/Contents/Resources/dash.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/Dash-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings $(OSX_APP)/Contents/MacOS/Dash-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
osx_volname:
echo $(OSX_VOLNAME) >$@
if BUILD_DARWIN if BUILD_DARWIN
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg
@ -323,7 +320,7 @@ clean-docs:
clean-local: clean-docs clean-local: clean-docs
rm -rf coverage_percent.txt test_dash.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP) rm -rf coverage_percent.txt test_dash.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__ rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
rm -rf osx_volname dist/ rm -rf dist/
test-security-check: test-security-check:
if TARGET_DARWIN if TARGET_DARWIN

View File

@ -137,7 +137,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
fi fi
fi fi
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
if test "x$TARGET_OS" != xandroid; then if test "x$TARGET_OS" != xandroid; then
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal]) _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists]) AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])

View File

@ -236,7 +236,6 @@ mkdir -p "$OUTDIR"
# CONFIGFLAGS # CONFIGFLAGS
CONFIGFLAGS+=" --enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary" CONFIGFLAGS+=" --enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary"
case "$HOST" in case "$HOST" in
*linux*) CONFIGFLAGS+=" --disable-threadlocal" ;;
*mingw*) CONFIGFLAGS+=" --disable-miner" ;; *mingw*) CONFIGFLAGS+=" --disable-miner" ;;
esac esac
@ -324,11 +323,9 @@ mkdir -p "$DISTSRC"
case "$HOST" in case "$HOST" in
*darwin*) *darwin*)
make osx_volname ${V:+V=1}
make deploydir ${V:+V=1} make deploydir ${V:+V=1}
mkdir -p "unsigned-app-${HOST}" mkdir -p "unsigned-app-${HOST}"
cp --target-directory="unsigned-app-${HOST}" \ cp --target-directory="unsigned-app-${HOST}" \
osx_volname \
contrib/macdeploy/detached-sig-create.sh \ contrib/macdeploy/detached-sig-create.sh \
"${BASEPREFIX}/${HOST}"/native/bin/dmg "${BASEPREFIX}/${HOST}"/native/bin/dmg
mv --target-directory="unsigned-app-${HOST}" dist mv --target-directory="unsigned-app-${HOST}" dist

View File

@ -170,12 +170,19 @@ ifneq ($($(1)_ldflags),)
$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
endif endif
# We hardcode the library install path to "lib" to match the PKG_CONFIG_PATH
# setting in depends/config.site.in, which also hardcodes "lib".
# Without this setting, CMake by default would use the OS library
# directory, which might be "lib64" or something else, not "lib", on multiarch systems.
$(1)_cmake=env CC="$$($(1)_cc)" \ $(1)_cmake=env CC="$$($(1)_cc)" \
CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \ CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \
CXX="$$($(1)_cxx)" \ CXX="$$($(1)_cxx)" \
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
LDFLAGS="$$($(1)_ldflags)" \ LDFLAGS="$$($(1)_ldflags)" \
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" $$($(1)_config_opts) cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \
-DCMAKE_INSTALL_LIBDIR=lib/ \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
$$($(1)_config_opts)
ifeq ($($(1)_type),build) ifeq ($($(1)_type),build)
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib" $(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"
else else

View File

@ -29,8 +29,13 @@ host_$1=$$($(host_arch)_$(host_os)_$1)
endef endef
define add_host_flags_func define add_host_flags_func
ifeq ($(filter $(origin $1),undefined default),)
$(host_arch)_$(host_os)_$1 =
$(host_arch)_$(host_os)_$(release_type)_$1 = $($1)
else
$(host_arch)_$(host_os)_$1 += $($(host_os)_$1) $(host_arch)_$(host_os)_$1 += $($(host_os)_$1)
$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1)
endif
host_$1 = $$($(host_arch)_$(host_os)_$1) host_$1 = $$($(host_arch)_$(host_os)_$1)
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
endef endef

View File

@ -164,7 +164,7 @@ From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assura
> ecosystem, as it leads to a massive number of unnecessary rebuilds. > ecosystem, as it leads to a massive number of unnecessary rebuilds.
Where possible, packages are built with Position Independant Code. Either using Where possible, packages are built with Position Independant Code. Either using
the autotools `--with-pic` flag, or `DCMAKE_POSITION_INDEPENDENT_CODE` with CMake. the Autotools `--with-pic` flag, or `CMAKE_POSITION_INDEPENDENT_CODE` with CMake.
## Secondary dependencies: ## Secondary dependencies:

View File

@ -4,18 +4,15 @@ $(package)_download_path=$(native_$(package)_download_path)
$(package)_download_file=$(native_$(package)_download_file) $(package)_download_file=$(native_$(package)_download_file)
$(package)_file_name=$(native_$(package)_file_name) $(package)_file_name=$(native_$(package)_file_name)
$(package)_sha256_hash=$(native_$(package)_sha256_hash) $(package)_sha256_hash=$(native_$(package)_sha256_hash)
$(package)_dependencies=native_$(package)
define $(package)_set_vars := define $(package)_set_vars :=
$(package)_config_opts := --with-external-capnp $(package)_config_opts := -DBUILD_TESTING=OFF
$(package)_config_opts += --without-openssl $(package)_config_opts += -DWITH_OPENSSL=OFF
$(package)_config_opts += CAPNP="$$(native_capnp_prefixbin)/capnp" $(package)_config_opts += -DWITH_ZLIB=OFF
$(package)_config_opts += CAPNP_CXX="$$(native_capnp_prefixbin)/capnp-c++"
$(package)_config_opts_android := --disable-shared
endef endef
define $(package)_config_cmds define $(package)_config_cmds
$($(package)_autoconf) $($(package)_cmake) .
endef endef
define $(package)_build_cmds define $(package)_build_cmds
@ -25,3 +22,7 @@ endef
define $(package)_stage_cmds define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install $(MAKE) DESTDIR=$($(package)_staging_dir) install
endef endef
define $(package)_postprocess_cmds
rm -rf lib/pkgconfig
endef

View File

@ -6,11 +6,13 @@ $(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz
$(package)_sha256_hash=0f7f4b8a76a2cdb284fddef20de8306450df6dd031a47a15ac95bc43c3358e09 $(package)_sha256_hash=0f7f4b8a76a2cdb284fddef20de8306450df6dd031a47a15ac95bc43c3358e09
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts = --without-openssl $(package)_config_opts := -DBUILD_TESTING=OFF
$(package)_config_opts += -DWITH_OPENSSL=OFF
$(package)_config_opts += -DWITH_ZLIB=OFF
endef endef
define $(package)_config_cmds define $(package)_config_cmds
$($(package)_autoconf) $($(package)_cmake) .
endef endef
define $(package)_build_cmds define $(package)_build_cmds
@ -20,3 +22,7 @@ endef
define $(package)_stage_cmds define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install $(MAKE) DESTDIR=$($(package)_staging_dir) install
endef endef
define $(package)_postprocess_cmds
rm -rf lib/pkgconfig
endef

View File

@ -1,8 +1,8 @@
package=native_libmultiprocess package=native_libmultiprocess
$(package)_version=8b8a4766ce0a1892b9e8a5eb73dc39821005e520 $(package)_version=6aca5f389bacf2942394b8738bbe15d6c9edfb9b
$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive $(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive
$(package)_file_name=$($(package)_version).tar.gz $(package)_file_name=$($(package)_version).tar.gz
$(package)_sha256_hash=475c0dc2357a2ff30e9a164e4c16dc8a6597a57c9193d646fa9cbf0a55c45d78 $(package)_sha256_hash=2efeed53542bc1d8af3291f2b6f0e5d430d86a5e04e415ce33c136f2c226a51d
$(package)_dependencies=native_capnp $(package)_dependencies=native_capnp
define $(package)_config_cmds define $(package)_config_cmds

View File

@ -58,7 +58,7 @@
#include <QTimer> #include <QTimer>
#include <QTranslator> #include <QTranslator>
#if defined(QT_STATICPLUGIN) #if defined(QT_STATIC)
#include <QtPlugin> #include <QtPlugin>
#if defined(QT_QPA_PLATFORM_XCB) #if defined(QT_QPA_PLATFORM_XCB)
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);

View File

@ -1862,12 +1862,8 @@ void LogQtInfo()
#else #else
const std::string qt_link{"dynamic"}; const std::string qt_link{"dynamic"};
#endif #endif
#ifdef QT_STATICPLUGIN // TODO replace instances of LogPrintf with LogInfo once 28318 is merged
const std::string plugin_link{"static"}; LogPrintf("Qt %s (%s), plugin=%s\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString());
#else
const std::string plugin_link{"dynamic"};
#endif
LogPrintf("Qt %s (%s), plugin=%s (%s)\n", qVersion(), qt_link, QGuiApplication::platformName().toStdString(), plugin_link);
const auto static_plugins = QPluginLoader::staticPlugins(); const auto static_plugins = QPluginLoader::staticPlugins();
if (static_plugins.empty()) { if (static_plugins.empty()) {
LogPrintf("No static plugins.\n"); LogPrintf("No static plugins.\n");

View File

@ -25,7 +25,7 @@
#include <QTest> #include <QTest>
#include <functional> #include <functional>
#if defined(QT_STATICPLUGIN) #if defined(QT_STATIC)
#include <QtPlugin> #include <QtPlugin>
#if defined(QT_QPA_PLATFORM_MINIMAL) #if defined(QT_QPA_PLATFORM_MINIMAL)
Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin); Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin);

View File

@ -57,8 +57,10 @@
#include <sys/auxv.h> #include <sys/auxv.h>
#endif #endif
#ifndef _MSC_VER
//! Necessary on some platforms //! Necessary on some platforms
extern char** environ; extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
#endif
namespace { namespace {