From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sat, 5 Apr 2025 16:00:54 +0000 (+0200) Subject: gh-131591: Fix GENERATE_DEBUG_SECTION for clangcl on Windows (GH-132112) X-Git-Tag: v3.14.0a7~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d827d4d0184f8832075c6b75120892439a1d97ee;p=thirdparty%2FPython%2Fcpython.git gh-131591: Fix GENERATE_DEBUG_SECTION for clangcl on Windows (GH-132112) --- diff --git a/Include/internal/pycore_debug_offsets.h b/Include/internal/pycore_debug_offsets.h index 124b104e4ba8..b280633c9ef6 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 d938955e8cb0..b32db3a277cf 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 18e543ab33bb..14dc5007b658 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 - ##################################