From f10daa384af1435323d6f3d8d5c8eed7673ac2f5 Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 19 May 2026 22:44:41 +0300 Subject: [PATCH] ffi 1.24: verify inverse OS gate for #jni_call on iOS-sim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `ios-sim|examples/ffi-jni-call-02-void.sx` to the cross-compile tuple list. The `inline if OS == .android { #jni_call(...) }` arm in that example must strip its body before sema/lower runs on iOS, otherwise emit_llvm would attempt to load libjvm vtable slots that don't exist in the iOS SDK and the link step would fail. This is the JNI mirror of step 1.14, which did the same for `#objc_call` against Android. Phase 1C is functionally complete: - Parser accepts all three FFI intrinsics (1.1–1.2) - `#objc_call` full return-type matrix + selector interning (1.3–1.10) - `#objc_call` enclosing-construct coverage (1.11–1.13) - `#objc_call` cross-Android gate (1.14) - `#jni_call(void)` codegen with vtable indirection (1.15) - `#jni_call` literal-keyed slot interning (1.16–1.17) - `#jni_call` return-type matrix s32/s64/f64/bool/*void (1.18–1.22) - `#jni_static_call` lowering (1.23) - `#jni_call` cross-iOS gate (1.24, this commit) 3/3 cross-compile tuples pass; 118/119 host tests pass (one unrelated regression in working tree). Next: Phase 1D for `library/vendors/sx_android_jni/sx_android_jni.c` — migrate the C JNI helpers to sx via `#jni_call`. Requires on-device chess verification per the FFI plan. --- tests/cross_compile.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cross_compile.sh b/tests/cross_compile.sh index fee1f59..edaf99e 100755 --- a/tests/cross_compile.sh +++ b/tests/cross_compile.sh @@ -28,6 +28,10 @@ mkdir -p "$TMP_DIR" TUPLES=( "android|examples/ffi-objc-call-10-os-gate.sx" "android|examples/ffi-jni-call-02-void.sx" + # Step 1.24: verify the inverse OS gate — `inline if OS == .android + # { #jni_call(...) }` must strip its body before lowering on iOS so + # emit_llvm doesn't try to use libjvm symbols the iOS SDK lacks. + "ios-sim|examples/ffi-jni-call-02-void.sx" ) PASS=0