Skip to content

README: -mm=own and Android; release zip Android layout - #529

Merged
ASDAlexander77 merged 2 commits into
mainfrom
readme-own-model-android
Oct 6, 2026
Merged

ASDAlexander77 merged 2 commits into
mainfrom
readme-own-model-android

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

README

  • What's new and Contents: entries for -mm=own and the Android targets.
  • Compile for Android (new): covers
    • the targets (aarch64-linux-android29, x86_64-linux-android29), the NDK option, and why the API level must be in the triple;
    • which release-zip library goes with which option;
    • an arm64 --emit=exe example and a note on --emit=dll;
    • running the result with adb. It needs chmod +x, because a file pushed from Windows isn't executable and the run fails with exit 126.
  • Memory models: an -mm=own row in the table, and a subsection covering
    • moves, borrows and frees at points known at compile time;
    • a two-owners example with the real diagnostic;
    • Shared<T> with .value and Shared.count;
    • --no-default-lib, since there is no own default library yet.
  • Build for Android (new): build_gc_release_android.bat, build_tslang_runtime_release_android.bat, and the DefaultLib repo's build_android.bat.

Release zip: Android layout

Get-ChildItem -Path ... .\android_stage\android | Compress-Archive packs that folder's children. So the Windows zip has arm64-v8a\lib\ and x86_64\lib\ at its root, not the android\<abi>\lib\ that the workflow comment and the DefaultLib README document. The fix is to pass .\android_stage, the same way gcdll_stage and resourcedir_stage are passed.

I checked this by running the same pipeline on a small staged tree:

Before After
arm64-v8a/lib/libgc.a android/arm64-v8a/lib/libgc.a

v0.0-pre-alpha91's zip was built before this fix, so its Android libraries are at <zip>\<abi>\lib.

Test plan

  • Every README example compiled with the current Release tslang.exe.
  • On the API 29 x86_64 emulator, hello world printed correctly under gc, rc and own (adb push, chmod +x, run), and the Shared<T> example printed 1 1 2.
  • An arm64 gc executable linked to an AArch64 ELF. Not run: no arm64 device.
  • The packaging fix was checked on a staged tree, as shown above. Not checked on a real release run yet.

While writing the -mm=own section I found that reassigning a moved-from let is rejected, and filed it as a separate issue.

🤖 Generated with Claude Code

ASDAlexander77 and others added 2 commits October 6, 2026 19:38
What's new and the contents gain both. "Compile for Android" covers the
targets, the NDK, the release-zip libraries and their options, an arm64
executable, and running it with adb (chmod +x: a file pushed from
Windows is not executable). The memory models table and a new -mm=own
subsection cover moves, borrows, the compile error when ownership cannot
be proven, Shared<T>, and --no-default-lib (no own default library yet).
"Build for Android" lists the two scripts and the DefaultLib one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Get-ChildItem on .\android_stage\android packed that folder's children,
so the zip had arm64-v8a\lib and x86_64\lib at its root rather than the
android\<abi>\lib the comment above and the DefaultLib README document.
Pass .\android_stage, as gcdll_stage and resourcedir_stage are passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 3ddea31 into main Oct 6, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the readme-own-model-android branch October 6, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant