mirror of
https://github.com/python/cpython
synced 2026-11-23 00:04:08 +03: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.
(cherry picked from commit c8da735f4f)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
21 lines
674 B
C
21 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;
|
|
}
|