From d827d4d0184f8832075c6b75120892439a1d97ee Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sat, 5 Apr 2025 18:00:54 +0200 Subject: gh-131591: Fix GENERATE_DEBUG_SECTION for clangcl on Windows (GH-132112) --- Include/internal/pycore_debug_offsets.h | 4 +++- Modules/_asynciomodule.c | 2 +- Tools/c-analyzer/cpython/ignored.tsv | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Include/internal/pycore_debug_offsets.h b/Include/internal/pycore_debug_offsets.h index 124b104..b280633 100644 --- a/Include/internal/pycore_debug_offsets.h +++ b/Include/internal/pycore_debug_offsets.h @@ -23,7 +23,9 @@ extern "C" { declaration \ _GENERATE_DEBUG_SECTION_LINUX(name) -#if defined(MS_WINDOWS) && !defined(__clang__) +// Please note that section names are truncated to eight bytes +// on Windows! +#if defined(MS_WINDOWS) #define _GENERATE_DEBUG_SECTION_WINDOWS(name) \ _Pragma(Py_STRINGIFY(section(Py_STRINGIFY(name), read, write))) \ __declspec(allocate(Py_STRINGIFY(name))) diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index d938955..b32db3a 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -116,7 +116,7 @@ typedef struct _Py_AsyncioModuleDebugOffsets { } asyncio_thread_state; } Py_AsyncioModuleDebugOffsets; -GENERATE_DEBUG_SECTION(AsyncioDebug, Py_AsyncioModuleDebugOffsets AsyncioDebug) +GENERATE_DEBUG_SECTION(AsyncioDebug, Py_AsyncioModuleDebugOffsets _AsyncioDebug) = {.asyncio_task_object = { .size = sizeof(TaskObj), .task_name = offsetof(TaskObj, task_name), diff --git a/Tools/c-analyzer/cpython/ignored.tsv b/Tools/c-analyzer/cpython/ignored.tsv index 18e543a..14dc500 100644 --- a/Tools/c-analyzer/cpython/ignored.tsv +++ b/Tools/c-analyzer/cpython/ignored.tsv @@ -56,7 +56,7 @@ Python/pyhash.c - _Py_HashSecret - Python/parking_lot.c - buckets - ## data needed for introspecting asyncio state from debuggers and profilers -Modules/_asynciomodule.c - AsyncioDebug - +Modules/_asynciomodule.c - _AsyncioDebug - ################################## -- cgit v0.12