@@ -605,7 +605,6 @@ def hack_project_files(
605
605
pass
606
606
607
607
608
-
609
608
PYPORT_EXPORT_SEARCH_39 = b"""
610
609
#if defined(__CYGWIN__)
611
610
# define HAVE_DECLSPEC_DLL
@@ -894,12 +893,11 @@ def build_openssl_for_arch(
894
893
# uplink.c tries to find the OPENSSL_Applink function exported from the current
895
894
# executable. However, it is exported from _ssl[_d].pyd in shared builds. So
896
895
# update its sounce to look for it from there.
897
- if "shared" in profile :
898
- static_replace_in_file (
899
- source_root / "ms" / "uplink.c" ,
900
- b"((h = GetModuleHandle(NULL)) == NULL)" ,
901
- b'((h = GetModuleHandleA("_ssl.pyd")) == NULL) if ((h = GetModuleHandleA("_ssl_d.pyd")) == NULL) if ((h = GetModuleHandle(NULL)) == NULL)' ,
902
- )
896
+ static_replace_in_file (
897
+ source_root / "ms" / "uplink.c" ,
898
+ b"((h = GetModuleHandle(NULL)) == NULL)" ,
899
+ b'((h = GetModuleHandleA("_ssl.pyd")) == NULL) if ((h = GetModuleHandleA("_ssl_d.pyd")) == NULL) if ((h = GetModuleHandle(NULL)) == NULL)' ,
900
+ )
903
901
904
902
if arch == "x86" :
905
903
configure = "VC-WIN32"
@@ -1189,7 +1187,6 @@ def collect_python_build_artifacts(
1189
1187
1190
1188
extension_projects .add (extension )
1191
1189
1192
-
1193
1190
depends_projects |= {
1194
1191
"liblzma" ,
1195
1192
"sqlite3" ,
@@ -1313,9 +1310,7 @@ def find_additional_dependencies(project: pathlib.Path):
1313
1310
for obj in process_project (ext , dest_dir ):
1314
1311
entry ["objs" ].append ("build/extensions/%s/%s" % (ext , obj ))
1315
1312
1316
- for lib in CONVERT_TO_BUILTIN_EXTENSIONS .get (ext , {}).get (
1317
- "shared_depends" , []
1318
- ):
1313
+ for lib in CONVERT_TO_BUILTIN_EXTENSIONS .get (ext , {}).get ("shared_depends" , []):
1319
1314
entry ["links" ].append (
1320
1315
{"name" : lib , "path_dynamic" : "install/DLLs/%s.dll" % lib }
1321
1316
)
@@ -1390,7 +1385,7 @@ def build_cpython(
1390
1385
libffi_archive ,
1391
1386
openssl_entry : str ,
1392
1387
):
1393
- pgo = "- pgo" in profile
1388
+ pgo = profile in ( " pgo", "shared-pgo" )
1394
1389
1395
1390
msbuild = find_msbuild (msvc_version )
1396
1391
log ("found MSBuild at %s" % msbuild )
@@ -1724,7 +1719,7 @@ def build_cpython(
1724
1719
1725
1720
crt_features = ["vcruntime:140" ]
1726
1721
1727
- if "pgo" in profile :
1722
+ if profile in ( "pgo" , "shared-pgo" ) :
1728
1723
optimizations = "pgo"
1729
1724
else :
1730
1725
optimizations = "noopt"
@@ -1841,8 +1836,9 @@ def main():
1841
1836
)
1842
1837
parser .add_argument (
1843
1838
"--profile" ,
1844
- choices = {"shared-noopt" , "shared-pgo" },
1845
- default = "shared-noopt" ,
1839
+ # 'shared-pgo' is an alias for 'pgo'; 'shared-noopt' is an alias for 'noopt'.
1840
+ choices = {"noopt" , "pgo" , "shared-noopt" , "shared-pgo" },
1841
+ default = "noopt" ,
1846
1842
help = "How to compile Python" ,
1847
1843
)
1848
1844
parser .add_argument (
0 commit comments