Files
cpython/Modules/getpath_noop.c
T
Gregory P. Smith c8da735f4f gh-157142: Fix linking _freeze_module with built-in test modules (GH-157143)
Programs/_freeze_module is linked with Modules/getpath_noop.o rather than
Modules/getpath.o, and getpath_noop.c only defined _PyConfig_InitPathConfig().
With MODULE_BUILDTYPE=static (the default on wasm), _testinternalcapi.o is
part of LIBRARY_OBJS_OMIT_FROZEN and its get_getpath_codeobject() left
_Py_Get_Getpath_CodeObject() as an undefined reference. Define a stub for it.
2026-09-07 18:32:36 -07:00

22 lines
674 B
C

/* Implements the getpath API for compiling with no functionality */
#include "Python.h"
#include "pycore_initconfig.h" // _Py_Get_Getpath_CodeObject()
#include "pycore_pathconfig.h" // _PyConfig_InitPathConfig()
PyStatus
_PyConfig_InitPathConfig(PyConfig *config, int compute_path_config)
{
return PyStatus_Error("path configuration is unsupported");
}
/* Used by _testinternalcapi, which is linked into Programs/_freeze_module
when extension modules are built in (MODULE_BUILDTYPE=static). */
PyObject *
_Py_Get_Getpath_CodeObject(void)
{
PyErr_SetString(PyExc_RuntimeError,
"path configuration is unsupported");
return NULL;
}