This commit prevents Python from linking to standard libraries.
This is needed because Python's `configure` script tests for a set
of available functions that are provided by NuttX (instead of the
toolchain) and not having `-nostdlib` set may give wrong results.
This commit also adds the check for the `__NuttX__` macro to the
patch file that allows setting an attribute to the `_PyRuntime`
structure. The `__NuttX__` macro is guaranteed to be present when
building any application for NuttX.
This wrapper application checks if the Python's modules are already
mounted (and mounts them, if not), sets the necessary environment
variables and, then, runs the Python interpreter.
The `Setup.local` and the `config.site` files are used by Python's
build system to, respectively, enable or disable Python's modules
and set/unset available functions in the target system. These files
are now set according to NuttX's configs, enabling or disabling
Python's features according to the configs set on NuttX.
By setting a specific region for the `_PyRuntime` structure, it is
possible to move it to the external memory, for instance, freeing
the internal memory (this structure occupies around 140KiB).
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This is the NuttX's port of Python (cpython)!
Initial support of Python includes building the Python's static
library and the `python` (Programs/python.c) application. Python's
modules are stored in `pyc` (byte-code file) and loaded as needed
from flash.