Skip to content

Commit bb3e77e

Browse files
author
Alex J Lennon
committed
fix(e2e): default native_sim/native/64 for Zephyr (avoid -m32 multilib)
First run failed on x86_64 without 32-bit libgcc; Zephyr documents LP64 variant. Validated: west build + gdbserver -> rsgdb -> gdb batch OK. Made-with: Cursor
1 parent 3f65af1 commit bb3e77e

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN_E2E_GDB=1 ./scripts/validate_local.sh
6767

6868
To debug a **real Zephyr app** (still RSP/gdbserver) without QEMU or hardware, build for the **`native_sim`** board: Zephyr links a normal Linux executable (`zephyr.exe`). Flow matches CI: **gdbserver → rsgdb → GDB**.
6969

70-
Requires a full [Zephyr west workspace](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) (`ZEPHYR_WORKSPACE` with `.west/` and `zephyr/`). See [native_sim](https://docs.zephyrproject.org/latest/boards/native/native_sim/doc/index.html).
70+
Requires a full [Zephyr west workspace](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) (`ZEPHYR_WORKSPACE` with `.west/` and `zephyr/`). See [native_sim](https://docs.zephyrproject.org/latest/boards/native/native_sim/doc/index.html). The script builds **`native_sim/native/64`** by default (LP64 host binary); the plain `native_sim` target is 32-bit and needs multilib on x86_64.
7171

7272
```bash
7373
export ZEPHYR_WORKSPACE=/path/to/zephyrproject

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ cargo test
200200
# cargo build --release && ./scripts/e2e_gdb_smoke.sh
201201
# Or: RUN_E2E_GDB=1 ./scripts/validate_local.sh
202202
#
203-
# Optional: Zephyr native_sim (Linux ELF) — needs ZEPHYR_WORKSPACE; see CONTRIBUTING.md
203+
# Optional: Zephyr native_sim (Linux ELF) — needs ZEPHYR_WORKSPACE; default board is native_sim/native/64
204204
# ./scripts/e2e_zephyr_native_sim.sh
205205
# Or: RUN_E2E_ZEPHYR_NATIVE=1 ./scripts/validate_local.sh
206206

scripts/e2e_zephyr_native_sim.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#
1515
# Optional:
1616
# ZEPHYR_APP=zephyr/samples/hello_world (path relative to workspace root)
17+
# ZEPHYR_BOARD=native_sim/native/64 (default: 64-bit LP64 — works on typical x86_64 Linux without gcc-multilib)
1718
# RSGDB, GDB_PORT, PROXY_PORT — same as e2e_gdb_smoke.sh
1819
#
1920
# CI: not run by default (heavy); set RUN_E2E_ZEPHYR_NATIVE=1 in validate_local.sh locally.
@@ -53,17 +54,19 @@ if ! command -v gcc >/dev/null 2>&1 && ! command -v clang >/dev/null 2>&1; then
5354
fi
5455

5556
ZEPHYR_APP="${ZEPHYR_APP:-zephyr/samples/hello_world}"
57+
# Default board is 64-bit native_sim so linking does not require 32-bit multilib (-m32 + libgcc).
58+
ZEPHYR_BOARD="${ZEPHYR_BOARD:-native_sim/native/64}"
5659
WORKDIR="$(mktemp -d)"
5760
trap 'rm -rf "$WORKDIR"; kill ${RSGDB_PID:-0} ${GDBSERVER_PID:-0} 2>/dev/null || true' EXIT
5861

5962
GDB_PORT="${GDB_PORT:-13335}"
6063
PROXY_PORT="${PROXY_PORT:-13336}"
6164
BUILD_DIR="$WORKDIR/native_sim_build"
6265

63-
echo "==> west build -b native_sim (first run can take several minutes)"
66+
echo "==> west build -b $ZEPHYR_BOARD (first run can take several minutes)"
6467
(
6568
cd "$ZEPHYR_WORKSPACE"
66-
west build -b native_sim -p auto -d "$BUILD_DIR" "$ZEPHYR_APP" -- \
69+
west build -b "$ZEPHYR_BOARD" -p auto -d "$BUILD_DIR" "$ZEPHYR_APP" -- \
6770
-DCONFIG_NO_OPTIMIZATIONS=y
6871
)
6972

0 commit comments

Comments
 (0)