Commit graph

441 commits

Author SHA1 Message Date
Carlos Sánchez de La Lama
094b988be3 interpreters: add Tcl support
Tcl is added using The Jim Interpreter. Jim is an opensource small-footprint
implementation of the Tcl programming language. It implements a large subset
of Tcl and adds new features like references with garbage collection,
closures, built-in Object Oriented Programming system, Functional Programming
commands, first-class arrays and UTF-8 support.

Signed-off-by: Carlos Sánchez de La Lama <csanchezdll@gmail.com>
2026-07-24 17:15:49 +08:00
Filipe Cavalcanti
09682dad05 interpreters/python: support build without network
Adds options to support building when CONFIG_NET is not set.
This allows building Python for boards that do not have networking support.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-17 08:37:30 +08:00
Tiago Medicci
8e00b4d672 interpreters/python: Disable no-maybe-uninitialized warning
This commit disables the `no-maybe-uninitialized` warning because
it's wrongly evaluated after increasing the optimization level of
the Python's library.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-07-03 09:19:04 -03:00
Frederick Blais
e61f46536e interpreters/berry: Fix Wshadow build errors
The pinned Berry source emits -Wshadow diagnostics in a couple of files. NuttX CI passes -Werror, so sim:berry fails when those third-party warnings are promoted to errors.\n\nAdd -Wno-shadow to Berry-specific compiler flags in both Make and CMake paths, keeping the local source patch limited to the NuttX port changes.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-07-02 09:07:50 -03:00
Frederick Blais
fc25af7cd7 interpreters/berry: Patch CRLF upstream source directly
Berry's downloaded default/berry.c uses CRLF line endings, while the local NuttX patch was LF. Fresh Linux and CMake builds failed when patch saw the line-ending mismatch.

Regenerate the local Berry patch against the pinned upstream CRLF source and apply it directly in both Make and CMake fetch paths. This keeps the integration working until the Berry-side change is merged upstream and the pinned commit can be updated.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-06-30 23:55:57 +08:00
Frederick Blais
a2b1cc16da interpreters/berry: Add Berry scripting language
Add an optional Berry interpreter under apps/interpreters.

Fetch the pinned upstream source and apply the NuttX default-port patch.

Generate Berry constant objects and build the NSH command through Kconfig.

Make and CMake build paths are included for normal app integration.

Signed-off-by: Frederick Blais <fred_blais5@hotmail.com>
2026-06-28 02:16:58 +08:00
Tiago Medicci
b523f0e513 interpreters/python: Optmize Python for size
This aims to reduce Python's library size.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:54:51 -03:00
Filipe Cavalcanti
c00dc40525 interpreters/python: support nuttx-periphery package
Adds support for installing nuttx-periphery Python package by default
on Python support. This package provides API for accessing Nuttx
character drivers.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
Filipe Cavalcanti
e18a206082 interpreters/python: update repack_wheel script
Updates the repack_wheel_add_pyc.py script to support other packages,
not only pip.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
hanzj
b5b54e7663 interpreters/quickjs,testing/nettest: fix typos in Kconfig and source.
Fix spelling errors in QuickJS Kconfig and nettest source:
* "distable" -> "disable" in INTERPRETERS_QUICKJS_NONE description
* "destory" -> "destroy" in INTERPRETERS_QUICKJS_EXT_HOOK option
  and help text (2 occurrences)
* "err_destory" -> "err_destroy" label in nettest_tcpserver.c
  (3 occurrences: 2 goto targets and 1 label definition)

These are cosmetic fixes with no functional change.

Signed-off-by: hanzj <hanzjian@zepp.com>
2026-05-28 15:02:31 +08: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
Piyush Patle
9d849adfab include/debug.h: Use <nuttx/debug.h> in apps
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-11 10:39:27 -03:00
Matteo Golin
448b0bd0a6 interpreters: Fix spelling errors
Fix some spelling errors for CI.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
3ce356378d !interpreters/python: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_PYTHON_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
a604c46b00 !interpreters/minibasic: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_MINIBASIC_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
468ded86bb !interpreters/lua: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_LUA_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Matteo Golin
be2cdfa597 !interpreters/bas: Align naming of configuration options
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_BAS_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-18 11:01:02 +01:00
Bartosz Wawrzynek
f09d0b2e09 apps: Fix minor issues for latest toolchains
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header

Signed-off-by: Bartosz <bartol2205@gmail.com>
2026-01-23 10:00:52 +08:00
Huang Qi
73bc5cbcc6 interpreters: Add mquickjs JavaScript interpreter integration
Add complete integration for the MicroQuickJS JavaScript interpreter,
supporting both CMake and Make build systems with automatic source
acquisition.

Key features:
* FetchContent downloads mquickjs from bellard/mquickjs if local
  git repository is not available in interpreters/mquickjs/mquickjs/
* Builds mqjs_stdlib host tool to generate mqjs_stdlib.h and
  mquickjs_atom.h headers during build
* Creates libmquickjs library with proper header generation dependencies
  to prevent parallel build failures
* Provides mqjs NSH application for interactive JavaScript execution
* Configurable task priority and stack size via Kconfig options
  (INTERPRETERS_MQJS_PRIORITY, INTERPRETERS_MQJS_STACKSIZE)
* Supports both 32-bit and 64-bit architectures with appropriate build flags

Files added:
* CMakeLists.txt - CMake build configuration with FetchContent support
* Kconfig - Configuration options for interpreter features
* Make.defs - Make build definitions
* Makefile - Alternative Make-based build support
* .gitignore - Ignores generated files and local mquickjs source directory

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-07 09:44:19 +08:00
Tiago Medicci
c83e17c083 interpreters/python: Fix symbol collision with list_length function
NuttX implements a function with the same name which may end up
being included whenever `CONFIG_MM_KERNEL_HEAP` is set. To avoid
it, insert a prefix to it on Python's implementation.

Please note that the other patches had their metadata updated too.
2025-07-22 14:18:23 +08:00
Tiago Medicci
d63bb6d81d interpreters/python: Do not link to standard libraries
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.
2025-05-11 11:31:57 +08:00
YAMAMOTO Takashi
57365ac05d toywasm: regen for v67.0.0
```shell
REF=2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
YAMAMOTO Takashi
1094573025 toywasm: bump to v67.0.0
see below for the included changes.
the "fix GCC warnings for the target with long uint32_t" change
is for https://github.com/apache/nuttx/pull/16022.

```shell
2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef wapm.toml: bump the version
95fdefcd3ea85ce18d0fd9c41536e609f6b0d7b2 suppress ubsan complaints on function type mismatches
9e131d0b86f29f453b51390e7a57db2f12efa8af fix a type in a comment
6832384862dab5f44b5328dbfe2a09cdba35713b platform.h: add WRONG_FUNC_TYPE macro to suppress -fsanitize=function
50062832c0481f4dcc67458fcfd2e1184e423d8b fix GCC warnings for the target with long uint32_t
04861b1084cd4925d99bfc758d5ae00359360c5d explain a cryptic dyld error
569aaa9b0ab6309311f331cdf3376e8d4445b1c0 libwasi_littlefs: emulate preadv/pwritev
b3f665319efe68215d9c9f51f489ba61b03c27fb ci: bump littlefs version
fe5cd58608c0eab0e3383626988240da1971a6ba fix debug info with IPO on macOS
7ef1b8abc4e4d1558986336732f21cf54f6abc58 libwasi_littlefs: fix crashes with non-debug builds
abb5efe1141721225945087d414d348f4afd4976 libwasi_littlefs: fix a few races
125d8973b485583d3ac4a8c4a60f97334135ee53 lfs_error_to_errno: translate unknown values to EIO
f1eda35d45229d02c7e23c872d2e0faeb9b2c731 Fix compilation errors with the latest macOS 15.2 SDK
3a01d8c5a063c18c8ebc58c45a61c7dd12cd4b75 libwasi_littlefs/README.md: remove a stale section
b7f015fd933fd330ed6e4e6f9af0dfc7b280e70d CI: update actions/upload-artifact download-artifact to v4
3a90622e105a2064878d4d63fc5e4566c6d1906b comment
6cdb84116abb930e903221231dd657ec08fec9e2 cmake: add custom-page-sizes tests
a2958960f59b6b0ccf7733fc3db301236991ff0b add run-wasm3-spec-test-custom-page-sizes.sh
f1029a818e638e0a5995a7fef43988592e709740 fetch-spec-test.sh: bump wasm-spec-test
7aa3d9050abcac11f7f8abef12ced6334acf0670 prepare-spec-test.sh: use my fork of custom-page-sizes for now
c987677a10557a0f938e3c10cfd05e5d741cf51e fetch-spec-test.sh: bump wasm-spec-test
c9372193a766c145a76a7ceaf79c820ce4576ce8 test/prepare-spec-test.sh: add custom-pages-sizes tests
9a74326a8d9503151ca3868ea6ed855293cb77b1 doc
cc700465b4275cc27007950f00ecf5079f68a778 comment
1700c523acf9fa3ba20772731eb04096852902a2 add a comment
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-04-13 11:31:36 +08:00
YAMAMOTO Takashi
036fe7668d toywasm: regen for v66.0.0
```
REF=b0e100a4ebd666f02b2bb9222d402a9f399a740b ./regen.sh
```

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-02-28 10:24:51 +01:00
YAMAMOTO Takashi
322c81bd8a toywasm: bump to v66.0.0
the included changes are:

```shell
spacetanuki% git log --pretty=oneline v65.0.0..v66.0.0
b0e100a4ebd666f02b2bb9222d402a9f399a740b (tag: v66.0.0) wapm.toml: bump the version
7604b9b896d7f48c46e484f560bbc679a87b0241 LICENSE: new year
c674c030025aab4cac94962328ae69590c5f1367 test/spectest.wat: update to match the spec harness
a5cf6bda2b2e022775d4d2d54aa11afc2e1295c2 test/fetch-spec-test.sh: update wasm-spec-test
c97f2d8e9e19d586d46b5db48a0582f374796d12 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/multi-memory
b5f75600df812c421855ab7008b13113658af1c4 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/spec version
1bfdc750dc18d085ac739a629b8b12b7ed9d9f6b escape.c: fix an integer overflow issue, especially on 32-bit archs
e15be49961d32e1878bfea399fd9cd609ff94045 escape.c: fix a comment
spacetanuki%
```

for nuttx-apps, only the escape.c fix is important.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-02-28 10:24:51 +01:00
simbit18
d05ecafc4b interpreters/quickjs/CMakeLists.txt: Sync of build Cmake with build Make
Setting the right version 2024-02-14

To avoid future breakage, used the URL with last commit ID

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-22 13:48:26 +08:00
simbit18
71ff60753c interpreters/quickjs/Makefile: fix the build with Make
QUICKJS_URL_BASE in Cmakefile and Makefile was not the same.
Updated the correct url in Makefile.

fix https://github.com/apache/nuttx/issues/15712

To avoid future breakage, used the URL with last commit ID

Current version 2024-02-14 as found in the VERSION file https://github.com/bellard/quickjs/blob/master/VERSION

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-02-21 10:52:29 -03:00
Tiago Medicci
db8542d2b1 interpreters/python: fix patch to set _PyRuntime attribute
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.
2025-02-14 20:53:07 +08:00
Tiago Medicci
43439a6b16 interpreters/python: set ROMFS-generated data to const char
This allows the data to be placed in the .rodata section, which can
be allocated in the flash or other read-only storage, freeing the
internal memory.
2025-02-01 23:34:24 +01:00
Tiago Medicci
87f4eb8021 interpreters/python: add wrapper to initialize Python
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.
2025-02-01 23:34:24 +01: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
Tiago Medicci
5a7661a928 interpreters/python: add patch to set _PyRuntime section
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).
2025-02-01 23:34:24 +01:00
Huang Qi
6669372415 wamr: Map armv7a/thumbv7a to armv7/thumbv7 for wamrc
Summary:
- Added explicit mapping of thumbv7a architecture to thumbv7 in the WAMR toolchain definitions
- WAMR's AOT compiler uses armv7/thumbv7 as the target architecture for all ARMv7-A processors
- This includes Cortex-A series processors like Cortex-A9 which use the armv7a/thumbv7a ISA

Impact:
- Fixes AOT compilation for ARM Cortex-A processors using thumbv7a architecture
- Maintains compatibility with WAMR's expected target architecture naming
- Ensures consistent architecture targeting across all ARMv7-A processors
- No impact on other architectures or build configurations

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-17 23:31:49 +08:00
Tiago Medicci
a61fd58f8e interpreters/python: Enable Python's socket module
Enables the Python's socket module. This allows applications to be
built to interact with POSIX-compatible sockets, which is supported
by NuttX.
2025-01-07 05:51:02 +08:00
YAMAMOTO Takashi
7a36a70e06 toywasm: regen
```
REF=e972e94fa427c3371fb21ad4bb9f238a1cca7795 ./regen.sh
```
2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
9b6bb67f9e interpreters/toywasm/tmpl/license.in: Add SPDX identifier 2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
c2b6c75cdc toywasm/tmpl: Revert "interpreters: migrate to SPDX identifier"
Note that these files are templates used by regen.sh script.
2024-12-29 20:40:22 +08:00
YAMAMOTO Takashi
c7a694ecc8 toywasm: bump to v65.0.0 2024-12-29 20:40:22 +08:00
Alin Jerpelea
d3102f0dce interpreters: migrate to SPDX identifier
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>
2024-12-21 13:53:10 +08:00
YAMAMOTO Takashi
d8faa9b18e interpreters/luamodules/luv: use "depends on" instead of "select" 2024-12-18 20:04:12 +08:00
YAMAMOTO Takashi
53db7817d9 Remove all references to CONFIG_SCHED_ATEXIT
It has been removed a few years ago.
https://github.com/apache/nuttx/pull/6197
2024-12-18 17:42:24 +08:00
Tiago Medicci
d7ed69200f interpreters/python: Avoid warnings that could be treated as errors
This commit disables some warnings when building CPython to avoid
CI failing when `EXTRAFLAGS="-Wno-cpp -Werror"` is set.
2024-12-12 02:12:25 +08:00
Tiago Medicci
efc1bf710c interpreters/python: Add Python's port to NuttX
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.
2024-12-06 19:42:09 -03:00
xuxin19
fee82bd3d3 cmake(build):add missing basic and nxlooper cmake script
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-18 13:52:45 +08:00
Xiang Xiao
c7530f5e45 quickjs: fix mp_mul multiple definition
in function `mp_mul':
apps/interpreters/quickjs/quickjs/libbf.c:1179: multiple definition of `mp_mul';
nuttx/staging/libapps.a:apps/math/libtommath/libtommath/bn_mp_mul.c:8: first defined here

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-16 21:34:11 +01:00
wenlingyun1
4a1c40aa96 update quickjs patch for cmake compilation
Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-11-11 17:17:22 +08:00
wenlingyun1
1adfefd88d add CMakeLists.txt for quickjs
Signed-off-by: wenlingyun1 <wenlingyun1@xiaomi.com>
2024-11-11 17:17:22 +08:00
Huang Qi
3799e0922d wamr: add iwasm include directory to nuttx target
This patch allow from other module that outside
WAMR directory include `wasm_export.h` to use WAMR as library.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-04 02:27:50 +08:00
yinshengkai
427b107dac quickjs: fix mp_mul multiple definition
in function `mp_mul':
apps/interpreters/quickjs/quickjs/libbf.c:1179: multiple definition of `mp_mul';
nuttx/staging/libapps.a:apps/math/libtommath/libtommath/bn_mp_mul.c:8: first defined here

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 10:34:43 +08:00