From d12f4f9f14bbdd1bdc4e4d7309e61e0981266254 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Mon, 5 Oct 2020 18:07:41 -0700 Subject: [PATCH] unix: don't redefine HMAC symbols when using LibreSSL This works around a redefinition of symbols exported by LibreSSL's libcrypto. I filed https://bugs.python.org/issue41949 upstream to track this. --- cpython-unix/build-cpython.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index dbb6cae4..22f56a6e 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -218,6 +218,27 @@ EOF sed s/__APPLE__/USE_LIBEDIT/g Modules/readline-libedit.c > tmp mv tmp Modules/readline-libedit.c +# Modules/_hashopenssl.c redefines some libcrypto symbols on Python 3.9 and +# this makes the linker unhappy. So rename the symbols to work around. +# https://bugs.python.org/issue41949. +if [ "${PYTHON_MAJMIN_VERSION}" = "3.9" ]; then + patch -p1 <