Skip to content

Add Zephyr support with native threading and atomics - #3

Merged
yorkie merged 9 commits into
masterfrom
codex/rquickjs-zephyr
Sep 7, 2026
Merged

yorkie merged 9 commits into
masterfrom
codex/rquickjs-zephyr

Conversation

@yorkie

@yorkie yorkie commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Zephyr threading, mutex, condition-variable, and once primitives.
  • Provide spinlock-backed Atomics support, including 64-bit operations on non-lock-free targets.
  • Add a runnable mps2/an385 Zephyr example covering C API use, promises, jobs, SharedArrayBuffer, waits, and Atomics.
  • Document Zephyr setup and usage.

Testing

  • Added an example-level runtime validation that reports QuickJS Zephyr: PASS after exercising the supported APIs.
  • Not run (not requested).

Let CMake select the Visual Studio version installed on the runner. Configure clang-cl sanitizer builds to use the release CRT and expose the Clang sanitizer runtime to Meson's direct linker invocation.
Meson invokes lld-link directly, so reproduce clang-cl's required ASan link inputs: retain the dynamic runtime thunk, include its SEH interceptor, and disable incremental linking.
Pass the clang-cl runtime inputs through Meson's c_link_args option so compiler sanity checks place them after /link instead of treating linker switches as source files.
Meson 1.12 shell-splits c_link_args unless it receives an explicit array literal. Preserve each clang-cl linker switch as a separate argument.
Add the Windows ASan runtime inputs after compiler detection so Meson passes them only to target link commands. Derive the compiler-rt suffix from the target architecture and keep the CI runtime directory discoverable through LIB and PATH.
Disable global reporting for clang-cl sanitizer tests, matching the existing MSVC ASan configuration. Clang 20 otherwise marks the one-byte empty string global as a redzone and fails every runtime test at startup.
Remove the committed .DS_Store files and ignore them throughout the repository so Finder metadata cannot be added again.
Print the value returned by the Atomics and promise script before validating it so QEMU output demonstrates that JavaScript evaluation produced 42.
@yorkie
yorkie merged commit 836f07d into master Sep 7, 2026
124 checks passed
@yorkie
yorkie deleted the codex/rquickjs-zephyr branch September 7, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant