Skip to content

Commit 3dc337b

Browse files
Subbarao Garlapatimeta-codesync[bot]
authored andcommitted
Fix build issues caused by Lazy Imports 3.14t
Summary: The land of Lazy Imports in 3.14t (D85977460) led to Github test failures (e.g. T244893771). [This](https://github.com/facebookincubator/cinder/actions/runs/19307995749) is the link to the builds/tests run on the change. Although some of the issues were pre-existing, some of them were due to the Lazy Imports 3.14t change: - Windows build errors ([example](https://github.com/facebookincubator/cinder/actions/runs/19307995749/job/55220483261)): These seem likely due to not defining `_Py_atomic_load_uchar_acquire()` and `_Py_atomic_store_uchar_release()` in `pyatomic_msc.h` - macOS (free-threading) build error ([link](https://github.com/facebookincubator/cinder/actions/runs/19307995749/job/55220483210)): This is likely due to having a label immediately followed by a declaration in `dictobject.c`, which is not allowed sometimes in C (I think before C-23). Reviewed By: itamaro Differential Revision: D86888783 fbshipit-source-id: 0ccd7e86e17ac7a05ddc6f39b96022741d9b6312
1 parent d63bf96 commit 3dc337b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Include/cpython/pyatomic_msc.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,30 @@ _Py_atomic_load_ssize_acquire(const Py_ssize_t *obj)
11541154
#endif
11551155
}
11561156

1157+
static inline void
1158+
_Py_atomic_store_uchar_release(unsigned char *obj, unsigned char value)
1159+
{
1160+
#if defined(_M_X64) || defined(_M_IX86)
1161+
*(unsigned char volatile *)obj = value;
1162+
#elif defined(_M_ARM64)
1163+
__stlr8((unsigned __int8 volatile *)obj, (unsigned __int8)value);
1164+
#else
1165+
# error "no implementation of _Py_atomic_store_uchar_release"
1166+
#endif
1167+
}
1168+
1169+
static inline unsigned char
1170+
_Py_atomic_load_uchar_acquire(const unsigned char *obj)
1171+
{
1172+
#if defined(_M_X64) || defined(_M_IX86)
1173+
return *(unsigned char volatile *)obj;
1174+
#elif defined(_M_ARM64)
1175+
return (unsigned char)__ldar8((unsigned __int8 volatile *)obj);
1176+
#else
1177+
# error "no implementation of _Py_atomic_load_uchar_acquire"
1178+
#endif
1179+
}
1180+
11571181
// --- _Py_atomic_fence ------------------------------------------------------
11581182

11591183
static inline void

Objects/dictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ Py_ssize_t
19411941
_Py_dict_lookup_threadsafe_stackref(PyDictObject *mp, PyObject *key, Py_hash_t hash, _PyStackRef *value_addr)
19421942
{
19431943
#ifdef ENABLE_LAZY_IMPORTS
1944-
start:
1944+
start:;
19451945
#endif
19461946
PyDictKeysObject *dk = _Py_atomic_load_ptr(&mp->ma_keys);
19471947
if (DK_KIND(dk) == DICT_KEYS_UNICODE && PyUnicode_CheckExact(key)) {

0 commit comments

Comments
 (0)