Closed alexmozaidze closed 1 year ago
@sayanarijit @alexmozaidze
Could you try again (after running cargo update
)? I published new luajit-src
version.
PS Please make sure you have gcc/binutils/make installed
This time around, it errors while compiling mlua-sys
:
error: failed to run custom build command for `mlua-sys v0.2.1`
Caused by:
process didn't exit successfully: `/data/data/com.termux/files/home/projects/xplr/target/debug/build/mlua-sys-82f0cb4243bf512f/build-script-main` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=CC_aarch64-linux-android
CC_aarch64-linux-android = None
cargo:rerun-if-env-changed=CC_aarch64_linux_android
CC_aarch64_linux_android = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
CFLAGS_aarch64-linux-android = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
CFLAGS_aarch64_linux_android = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("neon")
--- stderr
thread 'main' panicked at 'cannot find aarch64-linux-android-ar', /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/luajit-src-210.4.6+resty2cf5186/src/lib.rs:167:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Do you have binutils installed?
Yikes, I had not.
There seems to be no problems compiling mlua now, however, xplr's codebase is not ready for the new API yet.
The old one should also work too.
Hm, most of the errors seem to come from ui.rs
, so I'm pretty sure that some UI lib doesn't follow semver properly.
@alexmozaidze I guess you're talking about ratatui update. Try with --locked
.
Btw, @khvzak thank you for fixing the bug.
@alexmozaidze not sure how you were able to compile it, but I failed. The problem is that the latest version of termux (from fossdroid) is strictly clang. It even symlinks gcc to clang. And while I was able to install gcc8 from other sources, it didn't work because of missing libraries. @khvzak is there any way to make luajit compile with clang? Else, I guess I'll have drop support for Android, until there comes a friendlier alternative to termux.
error: linking with `aarch64-linux-android-clang` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/data/data/com.termux/files/usr/lib/rustlib/aarch64-linux-android/bin:/data/data/com.termux/files/usr/bin" VSLANG="1033" "aarch64-linux-android-clang" "/data/data/com.termux/files/usr/tmp/rustcE6QDM9/symbols.o" "/data/data/com.termux/files/home/xplr/target/release/deps/xplr-7023db21a3091fcb.xplr.6ba5a12f-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/data/data/com.termux/files/home/xplr/target/release/deps" "-L" "/data/data/com.termux/files/home/xplr/target/release/build/mlua-d6984c6b5706f9ba/out/luajit-build/lib" "-L" "/data/data/com.termux/files/usr/lib/rustlib/aarch64-linux-android/lib" "-Wl,-Bstatic" "/data/data/com.termux/files/usr/tmp/rustcE6QDM9/libmlua-0fcc934e005c5239.rlib" "/data/data/com.termux/files/usr/lib/rustlib/aarch64-linux-android/lib/libcompiler_builtins-135f0ea21e1a3847.rlib" "-Wl,-Bdynamic" "-ldl" "-llog" "-lunwind" "-ldl" "-lm" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/data/data/com.termux/files/usr/lib/rustlib/aarch64-linux-android/lib" "-o" "/data/data/com.termux/files/home/xplr/target/release/deps/xplr-7023db21a3091fcb" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs" "-rdynamic"
= note: ld.lld: error: undefined symbol: __clear_cache
>>> referenced by lj_mcode.c:49
>>> lj_mcode.o:(lj_mcode_sync) in archive /data/data/com.termux/files/usr/tmp/rustcE6QDM9/libmlua-0fcc934e005c5239.rlib
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `xplr` (bin "xplr") due to previous error
error: failed to compile `xplr v0.21.2 (/data/data/com.termux/files/home/xplr)`, intermediate artifacts can be found at `/data/data/com.termux/files/home/xplr/target`
I just used --locked
and get the same error message. I found gcc-9 (and other versions) on Termux User Repository (TUR), but I've yet to figure out a way to make cargo use gcc for building.
As a side note, Termux devs dropped support for gcc after Android did, making it harder to maintain. There are no plans to officially support gcc. See https://github.com/termux/termux-packages/issues/407 for more info on that.
Yep, doesn't work with gcc. I guess all is left is to make it work with clang.
Unfortunately I don't have any android device and can test only on emulator (android studio).
I can confirm that xplr (commit) can be build and works fine on the x86_64 android 14 with latest termmux installed from f-droid store.
@sayanarijit gcc is definitely not needed for luajit, it can be compiled using clang (I even did not install gcc).
I need to test somehow using aarch64
Wow cool. I haven't tried in x86_64. Mine is aarch64. Looks like the issue is limited to aarch64 Android then.
I found what causes the linking issue.
@sayanarijit in xplr in .cargo/config
the following section needed:
[target.aarch64-linux-android]
rustflags = ["-C", "linker=aarch64-linux-android-clang", "-C", "link-args=-rdynamic", "-C", "default-linker-libraries"]
you currently don't pass -C default-linker-libraries
option.
Was facing the same issue, trying to rebuild with these linker arguments now.
I tried installing xplr file explorer, but it got stuck on building mlua. Here's the error: