Repository navigation
litert-sys: add pre-generated bindings for aarch64-unknown-linux-ohos - #2
Open
shubhamg13 wants to merge 1 commit into
Open
shubhamg13 wants to merge 1 commit into
shubhamg13 wants to merge 1 commit into
Conversation
shubhamg13
marked this pull request as draft
October 6, 2026 08:41
shubhamg13
force-pushed
the
litert-sys/ohos-bindings
branch
from
October 7, 2026 05:51
60184b8 to
87756aa
Compare
Byte-identical to x86_64-unknown-linux-gnu.rs, because that is what the generator produces: build.rs::generate_bindings() never passes --target to clang, so the LITERT_HAS_* compile-time constants are selected by the preprocessor of the machine running the generation, not by the target. wasm32-unknown-emscripten.rs is in the same position -- it is also byte-identical to the x86_64 Linux file. The types are target-resolved Rust types (std::os::raw scalars, usize and opaque handle pointers) with no libc types; c_char appears only behind *const/*mut, so its signedness cannot move a byte. Checked with the OHOS SDK's clang: cargo check -p litert-sys --target aarch64-unknown-linux-ohos passes with LITERT_LIB_DIR set. Scope: bindings only. target_spec() has no OHOS entry, so building for this target requires LITERT_LIB_DIR pointing at a locally built libLiteRt.so -- the path locate_library() already directs users to for targets without pinned prebuilts. xtask TARGETS mirrors target_spec(), so it is not updated here; Cross.toml, prebuilt checksums and CI are follow-ups.
shubhamg13
force-pushed
the
litert-sys/ohos-bindings
branch
from
October 7, 2026 05:56
87756aa to
1dc4709
Compare
shubhamg13
marked this pull request as ready for review
October 7, 2026 06:00
shubhamg13
added a commit
to shubhamg13/rustnn
that referenced
this pull request
Oct 8, 2026
Pins litert + litert-sys to shubhamg13/offbit-ai-LiteRT branch litert-sys/litert-2.2.0 (rev e7517df9), which carries both the OpenHarmony binding file (upstream PR offbit-ai/LiteRT#2) and the LiteRT 2.2.0 / 4-arg migration. Pinned by rev rather than branch so the pin cannot drift under `cargo update`. Adjusts the two call sites the 4-arg API requires: - LiteRtCreateModelFromBuffer now takes the environment first (litert.rs, using the existing LiteRt::env() handle) - LiteRtLayout::set_has_strides takes an integer bit-field value Verified: cargo check --features litert-runtime on host and for aarch64-unknown-linux-ohos (LITERT_LIB_DIR pointing at the OHOS build). Swap the git pin back to a version requirement once a released crate carries both changes.
3 of 6 tasks
shubhamg13
added a commit
to shubhamg13/rustnn
that referenced
this pull request
Oct 8, 2026
Pins litert + litert-sys to shubhamg13/offbit-ai-LiteRT branch litert-sys/litert-2.2.0 (rev e7517df9), which carries both the OpenHarmony binding file (upstream PR offbit-ai/LiteRT#2) and the LiteRT 2.2.0 / 4-arg migration. Pinned by rev rather than branch so the pin cannot drift under `cargo update`. Adjusts the two call sites the 4-arg API requires: - LiteRtCreateModelFromBuffer now takes the environment first (litert.rs, using the existing LiteRt::env() handle) - LiteRtLayout::set_has_strides takes an integer bit-field value Verified: cargo check --features litert-runtime on host and for aarch64-unknown-linux-ohos (LITERT_LIB_DIR pointing at the OHOS build). Swap the git pin back to a version requirement once a released crate carries both changes.
shubhamg13
added a commit
to shubhamg13/rustnn
that referenced
this pull request
Oct 8, 2026
Pins litert + litert-sys to shubhamg13/offbit-ai-LiteRT branch litert-sys/litert-2.2.0 (rev e7517df9), which carries both the OpenHarmony binding file (upstream PR offbit-ai/LiteRT#2) and the LiteRT 2.2.0 / 4-arg migration. Pinned by rev rather than branch so the pin cannot drift under `cargo update`. Adjusts the two call sites the 4-arg API requires: - LiteRtCreateModelFromBuffer now takes the environment first (litert.rs, using the existing LiteRt::env() handle) - LiteRtLayout::set_has_strides takes an integer bit-field value Verified: cargo check --features litert-runtime on host and for aarch64-unknown-linux-ohos (LITERT_LIB_DIR pointing at the OHOS build). Swap the git pin back to a version requirement once a released crate carries both changes.
shubhamg13
added a commit
to shubhamg13/rustnn
that referenced
this pull request
Oct 13, 2026
Pins litert + litert-sys to shubhamg13/offbit-ai-LiteRT branch litert-sys/litert-2.2.0 (rev e7517df9), which carries both the OpenHarmony binding file (upstream PR offbit-ai/LiteRT#2) and the LiteRT 2.2.0 / 4-arg migration. Pinned by rev rather than branch so the pin cannot drift under `cargo update`. Adjusts the two call sites the 4-arg API requires: - LiteRtCreateModelFromBuffer now takes the environment first (litert.rs, using the existing LiteRt::env() handle) - LiteRtLayout::set_has_strides takes an integer bit-field value Verified: cargo check --features litert-runtime on host and for aarch64-unknown-linux-ohos (LITERT_LIB_DIR pointing at the OHOS build). Swap the git pin back to a version requirement once a released crate carries both changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
litert-sysbindings foraarch64-unknown-linux-ohos.The file is byte-identical to
x86_64-unknown-linux-gnu.rs.Testing.
cargo check -p litert-sys --target aarch64-unknown-linux-ohospasses withLITERT_LIB_DIRset.Scope. Bindings only.
target_spec()has no OHOS entry, so building requiresLITERT_LIB_DIRpointing at a locally builtlibLiteRt.so— the pathlocate_library()already directs users to.Follow-up. Give
target_spec(),xtask TARGETSandCross.tomlan OHOS entry once alibLiteRt.sofor this target is published — blocked on google-ai-edge/LiteRT#10576 and the XNNPACK platform allowlist.Used by rustnn.