]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112984: Fix link error on free-threaded Windows build (GH-114455)
authorSam Gross <colesbury@gmail.com>
Tue, 23 Jan 2024 18:05:15 +0000 (13:05 -0500)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 18:05:15 +0000 (18:05 +0000)
The test_peg_generator test tried to link the python313_d.lib library,
which failed because the library is now named python313t_d.lib. The
underlying problem is that the "compiler" attribute was not set when
we call get_libraries() from distutils.

Tools/peg_generator/pegen/build.py

index 00295c984d1bb6bc11fa26ed4e59bd78f4b396b1..67a7c0c4788e9d00f167269155a9b22f44595232 100644 (file)
@@ -220,6 +220,9 @@ def compile_c_extension(
         )
     else:
         objects = compiler.object_filenames(extension.sources, output_dir=cmd.build_temp)
+    # The cmd.get_libraries() call needs a valid compiler attribute or we will
+    # get an incorrect library name on the free-threaded Windows build.
+    cmd.compiler = compiler
     # Now link the object files together into a "shared object"
     compiler.link_shared_object(
         objects,