Skip to content

Commit 1514da2

Browse files
Subbarao Garlapatimeta-codesync[bot]
authored andcommitted
Fix duplicate symbol after Python 3.14.1 upgrade
Summary: The import of Python 3.14.1 from upstream (D88171463) made `_PyDict_DelItem_KnownHash_LockHeld` in `Objects/dictobject.c` public (no longer static). This caused a duplicate symbol linker error because the borrowing script was still borrowing this function, resulting in two definitions of the function. We do, however, need to keep borrowing the `_PyDict_DelItem_KnownHash_LockHeld` since it is not actually ever exported (via `PyAPI_FUNC`). To avoid the duplicate definition error, we rename it. This change removes the `Borrow` directives for both `delitem_knownhash_lock_held` and `_PyDict_DelItem_KnownHash_LockHeld` from the template, since `delitem_knownhash_lock_held` no longer exists and `_PyDict_DelItem_KnownHash_LockHeld` is public. Reviewed By: itamaro Differential Revision: D88274838 fbshipit-source-id: 3bd141a1e6d3ed8571a38195df0abdb794b7e323
1 parent ba96195 commit 1514da2

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

cinderx/UpstreamBorrow/borrowed-3.14.c.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ PyDictKeysObject* ci_dict_empty_keys;
141141
// @Borrow function delete_index_from_values from Objects/dictobject.c [3.14]
142142
// @Borrow function dictkeys_set_index from Objects/dictobject.c [3.14]
143143
// @Borrow function delitem_common from Objects/dictobject.c [3.14]
144-
// @Borrow function delitem_knownhash_lock_held from Objects/dictobject.c [3.14]
145144
// @Borrow function _PyDict_DelItem_KnownHash_LockHeld from Objects/dictobject.c [3.14]
146145
// @Borrow function new_keys_object from Objects/dictobject.c [3.14]
147146
#ifdef ENABLE_LAZY_IMPORTS

cinderx/UpstreamBorrow/borrowed.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#define _PyDict_CheckConsistency _CiDict_CheckConsistency
9696
#define _Py_dict_lookup_keep_lazy _Ci_dict_lookup_keep_lazy
9797
#define _PyDict_SetItem_LockHeld _CiDict_SetItem_LockHeld
98+
#define _PyDict_DelItem_KnownHash_LockHeld _CiDict_DelItem_KnownHash_LockHeld
9899
#define _PyInterpreterState_GetConfig _CiInterpreterState_GetConfig
99100

100101
#ifdef __cplusplus

0 commit comments

Comments
 (0)