From 618dc367146069f8f0aaeb0a4a7f1b834dc4a213 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Wed, 3 Dec 2025 23:08:51 +0100 Subject: [PATCH] GH-142050: Jit stencils on Windows contain debug data (#142052) Co-authored-by: Savannah Ostrowski --- .../next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst | 1 + Tools/jit/_schema.py | 1 + Tools/jit/_targets.py | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst diff --git a/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst b/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst new file mode 100644 index 00000000000..8917d5df76e --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst @@ -0,0 +1 @@ +Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl. diff --git a/Tools/jit/_schema.py b/Tools/jit/_schema.py index c47e9af924a..4e86abe6049 100644 --- a/Tools/jit/_schema.py +++ b/Tools/jit/_schema.py @@ -89,6 +89,7 @@ class COFFSection(typing.TypedDict): Characteristics: dict[ typing.Literal["Flags"], list[dict[typing.Literal["Name"], str]] ] + Name: dict[typing.Literal["Value"], str] Number: int RawDataSize: int Relocations: list[dict[typing.Literal["Relocation"], COFFRelocation]] diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index a76d8ff2792..4c188d74a68 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -267,6 +267,10 @@ class _COFF( def _handle_section( self, section: _schema.COFFSection, group: _stencils.StencilGroup ) -> None: + name = section["Name"]["Value"] + if name == ".debug$S": + # skip debug sections + return flags = {flag["Name"] for flag in section["Characteristics"]["Flags"]} if "SectionData" in section: section_data_bytes = section["SectionData"]["Bytes"]