OpenSSL configure API checks use the wrong library order for dependencies in LIBS
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Domínio
- build-system
Direção de pesquisa
Comece em configure.ac, nas verificações da API do OpenSSL, e compare a ordem das bibliotecas com a verificação de link inicial do AX_CHECK_OPENSSL. Reproduza o comando configure do OpenSSL estático com zlib, regenere configure com o Autoconf 2.72 e verifique se tanto as verificações da API quanto as verificações dos módulos _ssl e _hashlib reportam sucesso.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 558
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python/cpython
-
docs pending
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
stdlib type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
stdlib type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
build type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
stdlib topic-email type-feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Todas as issues de python/cpython
Issues semelhantes
-
link-check link-check:sphinx-theme
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
OpenHands/extensions#626 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
CSCfi/sd-search-api#39 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100