Skip to content

Commit

Permalink
gh-112984: Fix link error on free-threaded Windows build (GH-114455)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
colesbury committed Jan 23, 2024
1 parent ba253a4 commit 5f19978
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tools/peg_generator/pegen/build.py
Expand Up @@ -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,
Expand Down

0 comments on commit 5f19978

Please sign in to comment.