Skip to content

Commit 2efcc71

Browse files
committed
CHANGELOG: the third armv6 wall, under Upcoming.
What V8 asserted and why an 8-byte atomic is not lock-free on the ARMv6 baseline, that ARM1176JZF-S is ARMv6KZ so building for the real CPU is the accurate thing rather than a workaround, that nothing else about the target moves, and that the guard now covers both walls and was checked failing. Thanks to xet7 !
1 parent 3d16f16 commit 2efcc71

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,43 @@ patched `v8.gyp` still parses; and the trio check sees its `.patch`,
294294

295295
</details>
296296

297+
<details>
298+
<summary><a href="https://github.com/wekan/node-patches/commit/3d16f16">armv6 builds for the CPU those boards have, so V8's 8-byte atomics are lock-free</a>. Thanks to xet7.</summary>
299+
300+
With `-marm` and the `HWY_BROKEN_EMU128` define in, the third run got **74
301+
minutes** further — past the host tools and into the real ARM cross compile —
302+
and stopped in V8:
303+
304+
```
305+
deps/v8/src/common/segmented-table.h:124:44: error: static assertion failed
306+
static_assert(std::atomic<FreelistHead>::is_always_lock_free);
307+
required from 'class SegmentedTable<JSDispatchEntry, 268435456>'
308+
```
309+
310+
`FreelistHead` is two `uint32`s, so that is an **8-byte atomic**. The plain
311+
ARMv6 baseline has `LDREX`/`STREX` for words only; the 64-bit pair,
312+
`LDREXD`/`STREXD`, arrived in **ARMv6K**. Without them an 8-byte atomic is not
313+
lock-free, the assertion is false, and V8's JS dispatch table — leaptiering,
314+
which is on by default — does not compile.
315+
316+
The fix is `-mcpu=arm1176jzf-s` instead of `-march=armv6+fp`, and it is not a
317+
workaround: **that is the CPU these boards have.** The Raspberry Pi 1 and the
318+
Zero are ARM1176JZF-S, which is ARMv6KZ — ARMv6K plus the security extensions —
319+
so building for the baseline was asking for a machine narrower than anything
320+
that will ever run this bundle, and paying for it with V8.
321+
322+
Nothing else moves. `-marm`, `-mfpu=vfp` and `-mfloat-abi=hard` stay;
323+
`configure.py` still probes `__ARM_ARCH_6*__` and still comes out at
324+
`arm_version` 6, so `--arm-arch=armv6` and the `HWY_BROKEN_EMU128` patch —
325+
which keys on `arm_version==6` — apply exactly as before.
326+
327+
The guard covers both walls now, and reads the armv6 matrix entry rather than
328+
grepping for a flag string that has just changed: ARM mode, an ARMv6K CPU, and
329+
hard-float. Checked in the failing direction too — putting `-march=armv6+fp`
330+
back fails it with *"asks for a CPU without LDREXD"*.
331+
332+
</details>
333+
297334
and fixes the following in the release workflows:
298335

299336
**Release All** - the workflow that clones upstream, applies the patches and

0 commit comments

Comments
 (0)