mirror of
https://github.com/python/cpython.git
synced 2026-10-28 10:25:05 +08:00
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.
22 lines
674 B
C
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;
|
|
}
|