diff --git a/dev-qt/qtbase/Manifest b/dev-qt/qtbase/Manifest index 3c3d370e3d15b..5750a8318f09d 100644 --- a/dev-qt/qtbase/Manifest +++ b/dev-qt/qtbase/Manifest @@ -1 +1,2 @@ DIST qtbase-everywhere-src-6.11.2.tar.xz 50582668 BLAKE2B 44d90e6a9c67a21e0c7473371cba535ff504202d96e96fd4f4d157ccfd99cd41ed28b506adb6adcdc191d0a87470fae53cd3a75cbbd17c3b0e38788a87433868 SHA512 8dc4dbb4b3aac9e478361193ed8f8540dc70f1c22f25c91bdc5b6e6e574ea7f8c228800bc54e9a527baaa3334d106b4ecd882d05dc61ab7dcc4cdbe7b4fdb715 +DIST qtbase-everywhere-src-6.12.0.tar.xz 51220268 BLAKE2B 037949443e7fe82b82ddae92f782270e0574b4e4bb87e9f16c78a47034d352cdf10095a2a56977ef122725db9f9c8117112e0e26b2fffdc69e450bb48c2a1743 SHA512 87b3bd96244e03ea6145e00d088cb1e0cfaa64a575bfe32c4ec5f0227bc7872a3777ccf29c8e54e567a6ea809a8ee894e88e659d14d96655b0730455d9869d7a diff --git a/dev-qt/qtbase/files/qtbase-6.12.0-QTBUG-148575.patch b/dev-qt/qtbase/files/qtbase-6.12.0-QTBUG-148575.patch new file mode 100644 index 0000000000000..02ee2cea1a9de --- /dev/null +++ b/dev-qt/qtbase/files/qtbase-6.12.0-QTBUG-148575.patch @@ -0,0 +1,166 @@ +https://qt-project.atlassian.net/browse/QTBUG-148575 +https://codereview.qt-project.org/c/qt/qtbase/+/771398 +--- a/src/corelib/tools/qcryptographichash.cpp ++++ b/src/corelib/tools/qcryptographichash.cpp +@@ -116,4 +116,5 @@ + #if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(openssl_hash) + #define USING_OPENSSL30 ++#include + #include + #include +@@ -213,4 +214,54 @@ + return nullptr; + } ++ ++/* ++ Never unloaded: it is the unload that trips OpenSSL up, freeing a stale ++ provider-store entry a second time at exit (QTBUG-148575; ++ openssl/openssl#32079 has the exact sequence, and is where to look before ++ removing any of this). retain_fallbacks=1 leaves OpenSSL's own fallback in ++ place for everyone else in the process, e.g. the TLS backend (QTBUG-136223). ++ ++ Whether the load succeeded is of no interest to the callers: the ++ EVP_MD_fetch() that follows is the actual availability test, and it can ++ still succeed from the fallback or from another provider (e.g. FIPS). ++*/ ++static void ensureDefaultProviderLoaded() ++{ ++ static const bool loaded = OSSL_PROVIDER_try_load(nullptr, "default", /*retain_fallbacks=*/1); ++ Q_UNUSED(loaded); ++} ++ ++namespace { ++struct OSSL_LIB_CTX_deleter { ++ void operator()(OSSL_LIB_CTX *ctx) const noexcept { ++ OSSL_LIB_CTX_free(ctx); ++ } ++}; ++using OSSL_LIB_CTX_ptr = std::unique_ptr; ++} // unnamed namespace ++ ++/* ++ MD4 only exists in OpenSSL's "legacy" provider, which we don't want loaded ++ process-wide - other OpenSSL users in the process could then fetch other, ++ deliberately-weak algorithms from it too. Give it its own context instead: ++ load it (and its config, since OSSL_LIB_CTX_new() doesn't do that on its ++ own) once and keep it alive like ensureDefaultProviderLoaded() above. ++*/ ++static OSSL_LIB_CTX *legacyProviderContext() ++{ ++ static const OSSL_LIB_CTX_ptr ctx = [] { ++ OSSL_LIB_CTX_ptr ctx(OSSL_LIB_CTX_new()); ++ if (ctx) { ++ // Unlike the global context's automatic init, this fails when ++ // there is no readable openssl.cnf. ++ const bool configLoaded = OSSL_LIB_CTX_load_config(ctx.get(), nullptr); ++ Q_UNUSED(configLoaded); ++ if (!OSSL_PROVIDER_load(ctx.get(), "legacy")) ++ ctx.reset(); ++ } ++ return ctx; ++ }(); ++ return ctx.get(); ++} + #endif // USING_OPENSSL30 + +@@ -251,18 +302,9 @@ + } + }; +- struct OSSL_PROVIDER_deleter { +- void operator()(OSSL_PROVIDER *provider) const noexcept { +- OSSL_PROVIDER_unload(provider); +- } +- }; +- + using EVP_MD_CTX_ptr = std::unique_ptr; + using EVP_MD_ptr = std::unique_ptr; +- using OSSL_PROVIDER_ptr = std::unique_ptr; + struct EVP { + EVP_MD_ptr algorithm; + EVP_MD_CTX_ptr context; +- OSSL_PROVIDER_ptr defaultProvider; +- OSSL_PROVIDER_ptr legacyProvider; + bool initializationFailed; + +@@ -546,27 +588,13 @@ + : initializationFailed{true} + { ++ OSSL_LIB_CTX *fetchCtx = nullptr; + if (method == QCryptographicHash::Md4) { +- /* +- * We need to load the legacy provider in order to have the MD4 +- * algorithm available. +- */ +- legacyProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_try_load(nullptr, "legacy", /*retain_fallbacks=*/1)); +- +- if (!legacyProvider) ++ fetchCtx = legacyProviderContext(); ++ if (!fetchCtx) + return; ++ } else { ++ ensureDefaultProviderLoaded(); + } + +- /* +- * Load with retain_fallbacks=1 so that loading these providers - and the +- * unload performed by OSSL_PROVIDER_deleter - does not disable OpenSSL's +- * fallback auto-loading of the default provider in the global library +- * context. Plain OSSL_PROVIDER_load() disables that fallback, which then +- * leaves later OpenSSL users (e.g. the TLS backend) without a default +- * provider once we unload, breaking RAND seeding. See QTBUG-136223. +- */ +- defaultProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_try_load(nullptr, "default", /*retain_fallbacks=*/1)); +- if (!defaultProvider) +- return; +- + context = EVP_MD_CTX_ptr(EVP_MD_CTX_new()); + +@@ -578,7 +606,8 @@ + * Using the "-fips" option will disable the global "fips=yes" for + * this one lookup and the algorithm can be fetched from any provider +- * that implements the algorithm (including the FIPS provider). ++ * that implements the algorithm (including the FIPS provider). For Md4 ++ * that is moot: fetchCtx only ever holds the legacy provider. + */ +- algorithm = EVP_MD_ptr(EVP_MD_fetch(nullptr, methodToName(method), "-fips")); ++ algorithm = EVP_MD_ptr{EVP_MD_fetch(fetchCtx, methodToName(method), "-fips")}; + if (!algorithm) { + return; +@@ -1241,6 +1270,11 @@ + case QCryptographicHash::Blake2s_224: + return true; +- case QCryptographicHash::Sha1: + case QCryptographicHash::Md4: ++ if (OSSL_LIB_CTX *legacyLibCtx = legacyProviderContext()) { ++ return EVP_MD_ptr{EVP_MD_fetch(legacyLibCtx, methodToName(method), "-fips")} ++ != nullptr; ++ } ++ return false; ++ case QCryptographicHash::Sha1: + case QCryptographicHash::Md5: + case QCryptographicHash::Sha224: +@@ -1254,8 +1288,5 @@ + case QCryptographicHash::Blake2b_512: + case QCryptographicHash::Blake2s_256: { +- // retain_fallbacks=1: don't disable the global default-provider fallback +- // auto-load (see QTBUG-136223 and the EVP constructor above). +- auto legacyProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_try_load(nullptr, "legacy", /*retain_fallbacks=*/1)); +- auto defaultProvider = OSSL_PROVIDER_ptr(OSSL_PROVIDER_try_load(nullptr, "default", /*retain_fallbacks=*/1)); ++ ensureDefaultProviderLoaded(); + + const char *restriction = "-fips"; +--- a/tests/auto/network/ssl/qsslsocket/stresstest_hash_before_ssl/opensslhash_before_ssl.cpp ++++ b/tests/auto/network/ssl/qsslsocket/stresstest_hash_before_ssl/opensslhash_before_ssl.cpp +@@ -20,7 +20,9 @@ + + // Use QCryptographicHash before any SSL API is touched. When +- // openssl_hash is enabled, the destructor calls OSSL_PROVIDER_unload() +- // on the default provider, draining its activation count to zero. +- // ensureLibraryLoaded() (called below via supportsSsl()) must recover. ++ // openssl_hash is enabled, this loads the default provider into the ++ // global library context and, as of QTBUG-148575, leaves it loaded; ++ // ensureLibraryLoaded() (called below via supportsSsl()) must come up ++ // regardless. It used to unload the provider again, draining its ++ // activation count to zero and leaving SSL without one (QTBUG-136223). + { + QCryptographicHash hash(QCryptographicHash::Sha256); diff --git a/dev-qt/qtbase/qtbase-6.12.0.ebuild b/dev-qt/qtbase/qtbase-6.12.0.ebuild new file mode 100644 index 0000000000000..15dabc625500d --- /dev/null +++ b/dev-qt/qtbase/qtbase-6.12.0.ebuild @@ -0,0 +1,448 @@ +# Copyright 2021-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +QT6_HAS_STATIC_LIBS=1 +inherit flag-o-matic qt6-build toolchain-funcs + +DESCRIPTION="Cross-platform application development framework" + +if [[ ${QT6_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~x86" +fi + +declare -gA QT6_IUSE=( + [global]="+ssl +udev zstd" + [core]="icu io-uring journald syslog" + [modules]="+concurrent +dbus +gui +network +sql +xml" + + [gui]=" + +X accessibility eglfs evdev gles2-only +libinput + opengl renderdoc tslib vulkan wayland +widgets + " + [network]="brotli gssapi libproxy sctp" + [sql]="mysql oci8 odbc postgres +sqlite" + [widgets]="cups gtk" + + [optfeature]="nls" #810802 +) +IUSE="${QT6_IUSE[*]}" +REQUIRED_USE=" + ?? ( journald syslog ) + $( + printf '%s? ( gui ) ' ${QT6_IUSE[gui]//+/} + printf '%s? ( network ) ' ${QT6_IUSE[network]//+/} + printf '%s? ( sql ) ' ${QT6_IUSE[sql]//+/} + printf '%s? ( gui widgets ) ' ${QT6_IUSE[widgets]//+/} + ) + accessibility? ( dbus ) + eglfs? ( opengl ) + gles2-only? ( opengl ) + gui? ( || ( X eglfs wayland ) ) + libinput? ( udev ) + sql? ( || ( ${QT6_IUSE[sql]//+/} ) ) + test? ( icu sql? ( sqlite ) ) + wayland? ( opengl ) +" + +# groups: +# - global (configure.cmake) +# - qtcore (src/corelib/configure.cmake) +# - qtgui (src/gui/configure.cmake) +# - qtnetwork (src/network/configure.cmake) +# - qtprintsupport (src/printsupport/configure.cmake) [gui+widgets] +# - qtsql (src/plugins/sqldrivers/configure.cmake) +# nolink: renderdoc, systemd +COMMON_DEPEND=" + virtual/zlib:= + ssl? ( dev-libs/openssl:= ) + udev? ( virtual/libudev:= ) + zstd? ( app-arch/zstd:= ) + + app-crypt/libb2 + dev-libs/double-conversion:= + dev-libs/glib:2 + dev-libs/libpcre2:=[pcre16,unicode(+)] + icu? ( dev-libs/icu:= ) + io-uring? ( sys-libs/liburing:= ) + journald? ( sys-apps/systemd ) + + dbus? ( sys-apps/dbus ) + gui? ( + dev-libs/md4c + media-libs/fontconfig + >=media-libs/freetype-2.13.1:2 + media-libs/harfbuzz:= + media-libs/libjpeg-turbo:= + media-libs/libpng:= + x11-libs/libdrm + x11-libs/libxkbcommon[X?] + X? ( + x11-libs/libICE + x11-libs/libSM + x11-libs/libX11 + x11-libs/libxcb:= + x11-libs/xcb-util-cursor + x11-libs/xcb-util-image + x11-libs/xcb-util-keysyms + x11-libs/xcb-util-renderutil + x11-libs/xcb-util-wm + ) + accessibility? ( app-accessibility/at-spi2-core:2 ) + eglfs? ( media-libs/mesa[gbm(+)] ) + evdev? ( sys-libs/mtdev ) + libinput? ( dev-libs/libinput:= ) + opengl? ( + gles2-only? ( media-libs/libglvnd ) + !gles2-only? ( media-libs/libglvnd[X?] ) + ) + renderdoc? ( media-gfx/renderdoc ) + tslib? ( x11-libs/tslib ) + wayland? ( dev-libs/wayland ) + widgets? ( + cups? ( net-print/cups ) + gtk? ( + x11-libs/gdk-pixbuf:2 + >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?] + x11-libs/pango + ) + ) + ) + network? ( + brotli? ( app-arch/brotli:= ) + gssapi? ( virtual/krb5 ) + libproxy? ( net-libs/libproxy ) + ) + sql? ( + mysql? ( dev-db/mysql-connector-c:= ) + oci8? ( dev-db/oracle-instantclient:=[sdk] ) + odbc? ( dev-db/unixODBC ) + postgres? ( dev-db/postgresql:* ) + sqlite? ( dev-db/sqlite:3 ) + ) +" +# wrt blockers: users do not always depclean regularly and outdated +# dev-qt packages sometime cause runtime issues (update this when new +# Qt libraries/plugins are added, and keep old for 2y+ if removed) +RDEPEND=" + ${COMMON_DEPEND} + !=6.6.2 had related fixes, needs retesting + # this test has often caused trouble depending on arch, endianness, + # musl, and others with some image/pixel formats and similar and, + # while there is likely real bugs, it's above what I'm willing to + # handle for now + tst_qimage + # partially broken on llvm-musl, needs looking into but skip to have + # a baseline for regressions (rest of dev-qt still passes with musl) + $(usev elibc_musl ' + tst_qicoimageformat + tst_qimagereader + ') + # fails due to hppa's NaN handling, needs looking into (bug #914371) + $(usev hppa ' + tst_qcborvalue + tst_qnumeric + ') + # note: for linux, upstream only really runs+maintains tests for amd64 + # https://doc.qt.io/qt-6/supported-platforms.html + ) + + qt6-build_src_test +} + +src_install() { + qt6-build_src_install + + if use test; then + local delete_bins=( # need a better way to handle this + apphelper clientserver copier crashingServer desktopsettingsaware_helper + echo fileWriterProcess modal_helper nospace 'one space' + paster qcommandlineparser_test_helper qfileopeneventexternal + socketprocess syslocaleapp tst_qhashseed_helper 'two space s' + write-read-write + ) + local delete=( # sigh + "${D}${QT6_BINDIR}"/test* + "${D}${QT6_LIBDIR}/objects-${CMAKE_BUILD_TYPE}"/*test* + "${delete_bins[@]/#/${D}${QT6_BINDIR}/}" + ) + # using -f given not tracking which tests may be skipped or not + rm -rf -- "${delete[@]}" || die + fi +} diff --git a/dev-qt/qtbase/qtbase-6.12.9999.ebuild b/dev-qt/qtbase/qtbase-6.12.9999.ebuild index 72bc7e8dd1889..15dabc625500d 100644 --- a/dev-qt/qtbase/qtbase-6.12.9999.ebuild +++ b/dev-qt/qtbase/qtbase-6.12.9999.ebuild @@ -187,6 +187,7 @@ PATCHES=( "${FILESDIR}"/${PN}-6.6.3-gcc14-avx512fp16.patch "${FILESDIR}"/${PN}-6.8.2-cross.patch "${FILESDIR}"/${PN}-6.9.0-no-direct-extern-access.patch + "${FILESDIR}"/${PN}-6.12.0-QTBUG-148575.patch ) src_prepare() {