depends: openssl 1.1.1w - #557
Merged
Merged
Conversation
OpenSSL 1.1.0 removed the thread-locking callback API (CRYPTO_num_locks, CRYPTO_set_locking_callback, CRYPTO_LOCK) and RAND_screen(); util.cpp's CInit still used them, breaking the build against modern OpenSSL. Compile that block only for OpenSSL < 1.1.0 / LibreSSL (1.1 is internally thread-safe). Also disable the vendored secp256k1 / secp256k1-mw test suites in configure.ac (--enable-tests=no): their configure's SECP_OPENSSL_CHECK compiles an OpenSSL EC cross-check using the pre-1.1 EC_KEY/ECDSA_SIG API, which does not build against OpenSSL >= 1.1.0. The libraries themselves use no OpenSSL, so this is compile-only with no runtime/consensus effect. Re-run autogen.sh after applying.
The depends builder pinned OpenSSL 1.0.2u; many of its no-* config flags (no-ssl2, no-krb5, no-jpake, no-rsax, no-heartbeats, no-store, ...) do not exist in OpenSSL 1.1, so Configure rejects them. Update depends/packages/ openssl.mk to 1.1.1w: new version/sha256/download path, a 1.1-valid config_opts set (platform targets unchanged), the 1.1 preprocess steps (no Makefile.org), and DESTDIR= staging (1.1 renamed it from INSTALL_PREFIX=). Only affects depends/gitian/cross builds; no runtime or consensus effect.
qt.mk set one unconditional OPENSSL_LIBS that hardcoded the Windows-only
libraries -lws2_32 -lgdi32. Qt consumes OPENSSL_LIBS in its "openssl" config
test and the network-module link, so on Linux/macOS the test failed to link
("cannot find -lws2_32"), Qt set libs.openssl=no, and configure aborted with
"Feature 'openssl-linked' was enabled, but the pre-condition
'!features.securetransport && libs.openssl' failed". Split OPENSSL_LIBS per
host: mingw keeps its exact (working) value, Linux uses -lssl -lcrypto
-lpthread -ldl, and macOS uses -lssl -lcrypto. depends/gitian/cross builds
only; no runtime or consensus effect.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the build from OpenSSL 1.0.2u to 1.1.1w. Three commits, one per area
— they are a set: each alone leaves the build broken, together CI is green on
all seven build-factory targets.
Motivation
final 1.1.1 release and the smallest step that compiles this codebase with
minimal source changes (3.x is a larger source migration that can follow
separately).
make -C depends downloadfails on stock master — depends cannot build atall until openssl.mk changes one way or another.
Changes
build: compile against OpenSSL 1.1.x (guard removed 1.0-only APIs)
OpenSSL 1.1 removed the thread-locking callback API (
CRYPTO_num_locks,CRYPTO_set_locking_callback) andRAND_screen(); the init code inutil.cppstill used them. That block is now guarded to compile only forOpenSSL < 1.1 / LibreSSL (1.1 is internally thread-safe), so the tree
builds against both. Also disables the vendored secp256k1/secp256k1-mw
test suites in configure.ac (
--enable-tests=no): their configure probesOpenSSL with the pre-1.1 EC API and won't run against 1.1+. The libraries
themselves use no OpenSSL — compile-only change.
depends: bump vendored OpenSSL 1.0.2u -> 1.1.1w
New version/sha256, download from the OpenSSL GitHub release. Config
flags rewritten for 1.1's build system (many old
no-*flags no longerexist);
no-engineis required for the mingw build — with engines on,1.1's Windows CAPI engine pulls in
-lcrypt32, which breaks curl'sOpenSSL detection probe. Staging uses
DESTDIR=(1.1 renamed it fromINSTALL_PREFIX=).depends: make Qt's OPENSSL_LIBS host-specific (fix Linux/macOS build)
qt.mk set one
OPENSSL_LIBSfor every host, hardcoding the Windows-only-lws2_32 -lgdi32. Under 1.0.2u Qt's default probe (-lssl -lcrypto)still detected OpenSSL on Linux, but 1.1's static libcrypto additionally
needs
-lpthread/-ldlthere, so every probe failed and configureaborted with "Feature 'openssl-linked' was enabled, but the pre-condition
'!features.securetransport && libs.openssl' failed". Now per host: mingw
keeps its existing (working) value, Linux uses
-lssl -lcrypto -lpthread -ldl, macOS uses-lssl -lcrypto.Compatibility
curl TLS — no consensus code path depends on 1.0-specific behavior. No
protocol or network impact.
version-conditional), so non-depends/system-lib builds are unaffected.
./autogen.shafter checkout (configure.ac changed).Testing
Linux, Win64, macOS (DMG deploy included), ARM64, ARM32, RISC-V.
the three glibc Linux targets fail at Qt configure exactly as described;
macOS/Win64 passing through the full wallet compile exercises (1).
Note: this supersedes any interim fix that only repointed the 1.0.2u
download URL — both edit openssl.mk's download path and must not be merged
together.