Commit graph

4 commits

Author SHA1 Message Date
raiden00pl
fa4a430080 interpreters/python: fix build for x86_64 targets built with the host gcc
NuttX x86_64 (qemu-intel64) builds with the native host gcc, which
exposed several host-environment leaks in the CPython cross build:

- Pass the -D/-U macro flags from CFLAGS as CPPFLAGS so
  preprocessor-only configure probes (Misc/platform_triplet.c) do not
  see the host's __linux__ and misdetect the platform as
  x86_64-linux-gnu, enabling Linux-only code such as the perf
  trampoline.

- Force linux/random.h and sys/xattr.h probes to no in config.site:
  NuttX provides neither, but a native toolchain resolves them against
  the host /usr/include.  The former drags host ioctl macros into
  posixmodule, the latter enables os xattr support with no xattr
  syscalls to link against.

- Disable _curses, _curses_panel, _dbm, _gdbm, _hashlib and _tkinter:
  their host libraries are discovered via pkg-config when the target
  compiler can compile host headers.  hashlib keeps working through
  the built-in HACL implementations.

- Only build _posixsubprocess when the arch has a real fork(): its
  vfork() support is only an optimization and the fork() fallback path
  (PyOS_BeforeFork/PyOS_AfterFork_*) is compiled unconditionally but
  declared only under HAVE_FORK.  This also fixes rv-virt:python,
  which became vfork-only after the fork/vfork split.

Signed-off-by: raiden00pl <raiden00@railab.me>
Assisted-by: Claude Code
2026-08-18 15:23:54 -03:00
Tiago Medicci
58b780c280 interpreters/python: Add ctypes prototype patches for NuttX
Integrate NuttX-specific ctypes and posixmodule updates.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-22 21:51:31 +08:00
Tiago Medicci
8ba84edb0a interpreters/python: Enable using pip to install Python packages
This commit enables using `pip` as a pre-compiled (pyc) built-in
distributed along with cpython.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-18 15:08:30 -04:00
Tiago Medicci
4c6a6c7b16 interpreters/python: create Python's config files dynamically
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.
2025-02-01 23:34:24 +01:00
Renamed from interpreters/python/Setup.local (Browse further)