--- Python-3.9.5/configure.ac.orig 2021-06-03 15:49:37.703127100 -0700 +++ Python-3.9.5/configure.ac 2021-06-03 16:28:45.151498200 -0700 @@ -3062,6 +3062,11 @@ VxWorks*) LINKFORSHARED='--export-dynamic';; esac + case $host in + *-*-mingw*) + # for https://bugs.python.org/issue40458 on MINGW + LINKFORSHARED="-Wl,--stack,2000000";; + esac fi AC_MSG_RESULT($LINKFORSHARED)