graalvm-mobile

2026-05-11T11:51:32.556399Z

Thanks @smith.adriane, I've got your LearnLisp app running on my iPhone (after seeing your talk at bbconf). I ran into a few issues and given this is a whole ecosystem and language I know nothing about, I got Claude to help me through the issues. This is what it found, in case it's helpful to anyone else:

⏺ Summary of changes

  Two background facts drove most of the changes:
  - Apple Clang 21 (Xcode 26) is stricter — new errors-as-warnings, promoted-to-error warnings, and a tightened assembler.
  - macOS Sequoia 15+ stamps a SIP-protected com.apple.provenance extended attribute on extracted files.

  The grease project bundles an old labs-openjdk-21 + GraalVM that pre-dates both of those, so it fails to build on a current Mac without patches.

  Patches

  1. libffi — assembler rejected CFI directives

  File: third_party/libffi-3.4.6/darwin_ios/src/aarch64/sysv_arm64.S
  Why: Apple Clang 21's assembler now errors on cfi_startproc placed before the function label ("invalid CFI advance_loc expression"). The file had this pattern in 3 of the 5 functions;
  the other 2 were already correct.
  Fix: Swapped cfi_startproc to come after the label in ffi_call_SYSV, ffi_closure_SYSV, ffi_go_closure_SYSV.
  (Note: this file is generated from third_party/libffi-3.4.6/src/aarch64/sysv.S by generate-darwin-source-and-headers.py; if you ever regenerate, apply the swap upstream too.)

  2. labs-openjdk — xattr -cs failed on SIP-protected attribute

  File: third_party/ios-graal-jdk-21/labs-openjdk/labs-openjdk-21/make/common/MakeBase.gmk
  Why: The install-file macro runs xattr -cs after every file copy to strip macOS extended attributes. macOS Sequoia stamps com.apple.provenance on extracted source files and that
  attribute is SIP-protected — non-root users can't remove it. With 84k+ affected files, the build was guaranteed to die.
  Fix: Filter com.apple.provenance out of the xattr-presence check (so we don't bother clearing if it's the only one), and made the actual clear non-fatal (2>/dev/null || true).

  3. Harfbuzz — -Wnontrivial-memcall is new in Apple Clang 21

  File: labs-openjdk-21/make/modules/java.desktop/lib/Awt2dLibraries.gmk
  Why: Harfbuzz's Null<T>/Crap<T> machinery memcpys into non-trivially-copyable types on purpose. New warning + -Werror = build break.
  Fix: Added nontrivial-memcall to HARFBUZZ_DISABLED_WARNINGS_clang.

  4. libpng — included Carbon-era <fp.h> on Apple platforms

  File: labs-openjdk-21/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h
  Why: The bundled libpng (very old) had a conditional that included <fp.h> (a Mac OS Classic header) when TARGET_OS_MAC was defined. TARGET_OS_MAC is now defined for all Apple SDKs
  (macOS and iOS), so the wrong branch fired.
  Fix: Removed defined(TARGET_OS_MAC) from the conditional so Apple platforms fall through to <math.h>.

  5. libsplashscreen — -Wunterminated-string-initialization is new in Apple Clang 21

  File: labs-openjdk-21/make/modules/java.desktop/lib/Awt2dLibraries.gmk
  Why: Code like static const char szNetscape20ext[11] = "NETSCAPE2.0"; (fixed-size array exactly sized for the literal, no room for terminator) is intentional in the splashscreen GIF
  parser. New warning + -Werror = build break.
  Fix: Added unterminated-string-initialization to DISABLED_WARNINGS_clang for the libsplashscreen target.

  6. libjsound — -Wvla-cxx-extension promoted to error

  File: labs-openjdk-21/make/modules/java.desktop/Lib.gmk
  Why: PLATFORM_API_MacOSX_Ports.cpp uses C++ variable-length arrays in 7 places. Clang has long flagged this with -Wvla-cxx-extension; Apple Clang 21 makes it -Werror by default in this
  build config.
  Fix: Added vla-cxx-extension to DISABLED_WARNINGS_clang for libjsound.

👍 1
🙏 1
phronmophobic 2026-05-11T12:57:26.889609Z

I was working with @kevin.lynagh who has a newer OS version and we ran into largely the same issues. I hope to make a new testflight build soon and need to update my OS anyway to make that happen so these changes will be helpful to include in the grease project. Thanks for the detailed report!

🙏 1
phronmophobic 2026-05-12T10:47:56.243439Z

Also, I only updated the instructions for the test app. I’ll update the readme with instructions for the learnlisp app soon as well. It’s basically the same, except the last two steps are ./compile-membrane and ./build-membrane.

phronmophobic 2026-05-14T16:41:58.048479Z

@jamescroft, I would welcome some patches or pull requests if they're available.