Files
MeowOS-For-R3P2/patch_v2/sdk/test_time32_abi.sh
T
AskaEth 340c41afb7 fix(m40): 评审 r1 — rebase 解冲突 + 宿主构建/可复验断言(无运行逻辑改动)
- rebase 到 main(b1acc90,含 M39 r1):fw_content.conf 冲突取 launcherd 605e13a9、
  watchdog 37c57e0f;nyai 保持 main 的 ef7940ec(M39 6c6da79 已修,本单不再改该行)
- build_ncm_host.sh:SDK_SRC 补 meow_time32(否则链接 U meow_time32_monotonic_ms);
  顺带补 meow_jpeg/meow_png_stream/meow_img_color,脚本端到端可构建
- build_sdk.sh / build_launcher.sh 加 -Wall -Wextra 并重编:0 warning,产物 md5 不变
  (meow_ui.a=86800633、meow_launcherd=605e13a9)
- 新增 sdk/test_time32_abi.sh:反汇编断言 4263≥1、4403=0(覆盖宿主 fallback 测不到的真机路径)
- 注释修正 sdk/meow_ui_repaint.c → .h
- P1-1(launcherd 只能刷固件;watchdog 可热更但需退出重进 App)为交付说明修正,无代码改动
2026-11-10 22:54:11 +08:00

38 lines
1.7 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# test_time32_abi.sh — 反汇编断言:mipsel 二进制必须走 o32 time32 取时(4263),
# 不得残留 time64 入口(4403)。这是宿主 fallback 单测无法覆盖的「真机取时路径」证据。
#
# 用法(任意目录):
# bash patch_v2/sdk/test_time32_abi.sh patch_v2/meow_watchdog/meow_watchdog
# bash patch_v2/sdk/test_time32_abi.sh patch_v2/meow_watchdog/meow_watchdog patch_v2/meow_launcherd/meow_launcherd
# 可用 OBJDUMP=<path> 指定 objdump(默认 llvm-objdump)。
#
# 期望:每个二进制 4263 出现 ≥1 次(time32 取时路径存在),4403 出现 0 次
# (CLOCK_ABI.md §2.3:zig musl 把 time64 分支整段编掉,残留 4403 说明链接到了未修复的取时)。
set -u
OD="${OBJDUMP:-llvm-objdump}"
command -v "$OD" >/dev/null 2>&1 || { echo "缺少 objdump: $OD(可用 OBJDUMP=... 覆盖)" >&2; exit 2; }
[ "$#" -gt 0 ] || { echo "用法: $0 <mipsel-binary> [...]" >&2; exit 2; }
fail=0
for bin in "$@"; do
[ -f "$bin" ] || { echo "FAIL 文件不存在: $bin"; fail=1; continue; }
dis="$("$OD" -d --triple=mipsel "$bin" 2>/dev/null)" || {
echo "FAIL objdump 失败: $bin"; fail=1; continue;
}
n_time32=$(printf '%s\n' "$dis" | grep -c '0x10a7' || true)
n_time64=$(printf '%s\n' "$dis" | grep -c '0x1133' || true)
printf '%-60s SYS_clock_gettime(4263)=%s clock_gettime64(4403)=%s\n' \
"$bin" "$n_time32" "$n_time64"
if [ "$n_time32" -lt 1 ]; then
echo "FAIL $bin: 未找到 4263(o32 time32)取时路径"; fail=1
fi
if [ "$n_time64" -ne 0 ]; then
echo "FAIL $bin: 发现 4403(time64)路径(应有 0 处)"; fail=1
fi
done
[ "$fail" -eq 0 ] && echo "ALL PASS" || echo "SOME TESTS FAILED"
exit "$fail"