Skip to content

fix(ci): locate armv7 GCC runtime when using Clang - #111

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/armv7-ci-toolchain
Oct 24, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/armv7-ci-toolchain

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

The armv7 example fails during CMake's compiler check because Clang cannot find crtbeginS.o, crtendS.o, or libgcc in the napi-cross toolchain. The C compiler target is normalized to arm-unknown-linux-gnueabihf, while the bundled GCC installation uses armv7-unknown-linux-gnueabihf, which Clang does not discover through its usual aliases.

Pass --gcc-triple=armv7-unknown-linux-gnueabihf only for this target. Keep Clang and LLD: the bundled GCC 4.8.5 itself lacks the stdatomic.h support required by the existing mimalloc sources. The change is four lines in the workflow; source code, dependencies, and submodules are unchanged.

Validation

  • Workflow syntax (actionlint with optional ShellCheck/Pyflakes disabled), extracted Bash syntax, and git diff --check pass.
  • An offline Linux Clang 19 test using napi-cross 1.0.3 reproduces the missing startup objects/libgcc before the flag and successfully links a C11-atomic ARM hard-float shared library afterward. The local smoke test uses the bundled GNU linker; the complete workflow tests Clang with LLD.
  • CI run 40080526715 completed successfully for head 78475baf4c40d106701e1d2e72957686cf2a9c5b: 19 passed, 0 failed, 0 skipped, 0 cancelled. The armv7 job passes all four v2/v3 debug/release builds; Android also passes.

Stack

main → this CI repair → #110 (mimalloc v3.6.0 upgrade). This prerequisite is independent of the upgrade.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@Brooooooklyn
Brooooooklyn added this pull request to stack #112 October 24, 2026 08:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T09:00:28.386317Z 081e6ae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Select the napi-cross GCC triple explicitly so Clang can find its startup objects and libgcc. Keep Clang for the C11 atomic support missing from the bundled GCC 4.8.5.
@Brooooooklyn Brooooooklyn changed the title fix(ci): use bundled GCC for armv7 cross builds fix(ci): locate armv7 GCC runtime when using Clang Oct 24, 2026
@Brooooooklyn
Brooooooklyn force-pushed the fix/armv7-ci-toolchain branch from 081e6ae to 78475ba Compare October 24, 2026 09:04
@Brooooooklyn
Brooooooklyn merged commit 84ea131 into main Oct 24, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/armv7-ci-toolchain branch October 24, 2026 09:26
Brooooooklyn added a commit that referenced this pull request Oct 24, 2026
Update the v3 submodule from `afa6c90df2d8f0f78f12b42a598a4e93c10a51e6`
(v3.5.2 plus the initialization fix) to the official Microsoft [v3.6.0
release](https://github.com/microsoft/mimalloc/releases/tag/v3.6.0),
`b18ab4eef383f655e760881b02eff8af02800879`. The release already contains
the fork's initialization fix, so restore the Microsoft submodule URL
and remove the obsolete fork branch. The v2 submodule remains at v2.5.2.

On macOS, select `MI_TLS_MODEL=PTHREADS` for v3. With the previous
`LOCAL` TLS configuration, v3.6.0 fails seven upstream native tests
during thread teardown at the cached-theap reference-count assertion in
`src/heap/init.c`. Per-image pthread keys preserve isolation between
statically linked addons and make all twelve native tests pass.

On Android, override v3.6.0's `execinfo.h` availability probe: the NDK
ships that header below API 33 without declaring `backtrace`. Use
mimalloc's portable profiling fallback to preserve support for the
example's API 24 target.

## Validation

On macOS arm64 with Rust 1.99.0, 25 local commands passed:

- Root crate tests: default, secure, extended, v3, v3+extended,
v3+secure+extended, v3+override, and v3 with TLS/THP/architecture/exit
options; release tests with v3+extended and v3+secure+extended.
- Sys crate extended unit tests in release, with and without secure;
debug unit tests with the expected option defaults supplied explicitly
through the environment.
- Existing C binding test commands for v2/v3, with and without secure.
- Napi example builds: arm64 debug/release and x86_64 macOS release;
rustfmt, workspace Clippy, and rustdoc with warnings denied.
- Upstream Debug/PTHREADS CTest: 12/12 native tests passed.
- Two separately loaded copies of the statically linked napi addon: 16
Node worker lifecycles and 340,000 allocator-backed calls per run,
passing arm64 Debug and x86_64 Release.

After the Android CI regression was identified, reproduced it with the
local NDK at API 24. The corrected CMake static/shared builds and all
four Cargo example cross-builds (v2/v3, debug/release) pass. Rechecked
rustfmt, workspace v3 Clippy and v3+extended tests.

## Existing limitations

- The sys crate's debug `runtime_stable_option` test assumes
`show_errors=0`, while its build script enables it. The extended doctest
also imports the old `libmimalloc_sys` crate name. Both failures
reproduce on unchanged main with the old v3 submodule. These unrelated
baseline issues are unchanged.
- The existing ABI harness uses v2 headers even when `v3` is enabled.
Its passing commands do **not** establish full v3 ABI agreement. A
separate actual-v3-header audit finds existing option/struct/signature
mismatches with both old and new v3 headers; v3.6.0 also renames
`guarded_precise` to `unsafe_guarded_precise` without changing value 32.
Public binding cleanup is outside this update.
- Local native execution was limited to macOS; Android API 24 was
cross-built with the NDK. This PR's CI covers the configured platforms.
Upstream's separate new Rust-wrapper test was excluded from the native
CTest run after its crates.io access failed in the restricted local
environment.

No package version changes or release actions.


## PR stack and CI

Depends on #111, which independently repairs the pre-existing armv7
cross-toolchain discovery failure. This PR contains only the submodule
and macOS/Android compatibility changes relative to that prerequisite.
Both PRs remain non-draft.

[CI run
40080528221](https://github.com/napi-rs/mimalloc-safe/actions/runs/40080528221)
completed successfully for head
`acd6e379df0b98b0f90f8487886badf6a593cb87`: **19 passed, 0 failed, 0
skipped, 0 cancelled**. The armv7 job passes all four v2/v3
debug/release builds; Android also passes.

Prerequisite #111 also passes all 19 jobs at its current head.
@github-actions github-actions Bot mentioned this pull request Oct 24, 2026
Brooooooklyn pushed a commit that referenced this pull request Oct 24, 2026
## 🤖 New release

* `libmimalloc-sys2`: 0.1.63 -> 0.1.64 (✓ API compatible changes)
* `mimalloc-safe`: 0.1.67 -> 0.1.68 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `libmimalloc-sys2`

<blockquote>

## [0.1.64] - 2026-10-24

### Features

- *(sys)* Add free_use_pagemap feature
([#109](#109))

### Chore

- *(deps)* Update mimalloc3 to v3.6.0
([#110](#110))
</blockquote>

## `mimalloc-safe`

<blockquote>

## [0.1.68] - 2026-10-24

### Features

- *(sys)* Add free_use_pagemap feature
([#109](#109))

### Bug Fixes

- *(ci)* Locate armv7 GCC runtime when using Clang
([#111](#111))

### Chore

- *(deps)* Update mimalloc3 to v3.6.0
([#110](#110))
- *(deps)* Update emnapi to v2.0.0-beta.2
([#108](#108))
- *(deps)* Update yarn to v4.18.1
([#107](#107))
- *(deps)* Update dependency @napi-rs/cli to v3.10.9
([#103](#103))
- *(deps)* Update dependency @napi-rs/cli to v3.10.9
([#114](#114))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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