OpenSSL configure API checks use the wrong library order for dependencies in LIBS
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 領域
- build-system
調査の方向性
configure.ac の OpenSSL API チェックから始め、それらのライブラリの順序を初期の AX_CHECK_OPENSSL リンクチェックと比較します。zlib を使用する静的 OpenSSL の configure コマンドを再現し、Autoconf 2.72 で configure を再生成して、API チェックと _ssl および _hashlib モジュールのチェックの両方が成功を報告することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Bug description:
The OpenSSL API checks in configure.ac put LIBS before OPENSSL_LIBS and LIBCRYPTO_LIBS. When static OpenSSL depends on a library supplied through LIBS, the linker can encounter the dependency before the archive that references it. The API checks then fail and _ssl / _hashlib are marked as missing.
This is inconsistent with the initial AX_CHECK_OPENSSL link check, which already puts OPENSSL_LIBS before LIBS and succeeds with the same inputs.
Reproduction
Use a static OpenSSL build with zlib enabled (Configure linux-x86_64 no-shared no-tests zlib, with the zlib include/library paths supplied), and a static zlib archive. From an empty CPython build directory:
# Set these to the installed libraries and CPython source tree.
openssl_prefix=/path/to/openssl-zlib
openssl_libdir="$openssl_prefix/lib64"
zlib_archive=/path/to/libz.a
cpython_source=/path/to/cpython
PKG_CONFIG=/bin/false \
LDFLAGS="-L$openssl_libdir" \
LIBS="$zlib_archive" \
"$cpython_source/configure" \
--with-openssl="$openssl_prefix" \
--without-ensurepip
Use lib instead of lib64 if appropriate for the OpenSSL installation. Disabling pkg-config here exercises manually supplied dependency flags rather than having pkg-config supply the transitive libraries.
Actual result:
checking whether compiling and linking against OpenSSL works... yes
checking whether OpenSSL provides required ssl module APIs... no
checking whether OpenSSL provides required hashlib module APIs... no
checking for stdlib extension module _ssl... missing
checking for stdlib extension module _hashlib... missing
The failing SSL probe links in this order (paths abbreviated):
gcc ... conftest.c -ldl /path/to/libz.a -lssl -lcrypto
libcrypto.a(libcrypto-lib-c_zlib.o): undefined reference to `inflate'
libcrypto.a(libcrypto-lib-c_zlib.o): undefined reference to `deflate'
Expected: both API checks succeed. Moving the OpenSSL libraries before LIBS fixes both checks with otherwise identical inputs:
- LIBS="$LIBS $OPENSSL_LIBS"
+ LIBS="$OPENSSL_LIBS $LIBS"
- LIBS="$LIBS $LIBCRYPTO_LIBS"
+ LIBS="$LIBCRYPTO_LIBS $LIBS"
After regenerating configure with Autoconf 2.72, both API checks and both module configuration results become yes. The unmodified source also passes with ordinary static OpenSSL built without zlib, so this is specific to dependency ordering, not all static OpenSSL configurations.
CPython versions tested on:
CPython main branch, 3.13.15
Operating systems tested on:
main branch on Linux (WSL Ubuntu), 3.13.15 on all vcpkg ci https://github.com/microsoft/vcpkg/pull/53840
Linked PRs
- gh-157756
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·