-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross compile deno for aarch64-linux-android #19759
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Can this be done for arm32 as well ? the comments here #2295 says that rustyv8 can be compiled to arm32 |
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for testing I'll investigate that part |
this works for me
|
@sigmaSd I can not run it with this error:
|
I see I get the same error when compiling the example
|
We need to modify > git diff build.rs
diff --git a/v8-0.74.1/build.rs b/v8-0.74.1/build.rs
index 94e8950..57ab10f 100644
--- a/v8-0.74.1/build.rs
+++ b/v8-0.74.1/build.rs
@@ -144,7 +144,7 @@ fn build_v8() {
let clang_base_path = clang_download();
gn_args.push(format!("clang_base_path={:?}", clang_base_path));
- if cfg!(target_os = "android") && cfg!(target_arch = "aarch64") {
+ if cfg!(target_os = "android") && (cfg!(target_arch = "aarch64") || cfg!(target_arch = "armv7")) {
gn_args.push("treat_warnings_as_errors=false".to_string());
}
}
@@ -179,6 +179,13 @@ fn build_v8() {
maybe_install_sysroot("arm64");
maybe_install_sysroot("amd64");
};
+ // armv7-linux-androideabi
+ if target_triple == "armv7-linux-androideabi" {
+ gn_args.push(r#"target_cpu="arm""#.to_string());
+ //gn_args.push("use_sysroot=true".to_string());
+ //maybe_install_sysroot("arm64");
+ //maybe_install_sysroot("amd64");
+ };
if target_triple == "aarch64-linux-android" {
gn_args.push(r#"v8_target_cpu="arm64""#.to_string());
@@ -207,6 +214,13 @@ fn build_v8() {
&format!("{}/catapult.git", CHROMIUM_URI),
);
};
+ // armv7-linux-androideabi
+ if target_triple == "armv7-linux-androideabi" {
+ gn_args.push(r#"v8_target_cpu="arm""#.to_string());
+ gn_args.push(r#"target_os="android""#.to_string());
+
+ gn_args.push("treat_warnings_as_errors=false".to_string());
+ };
}
if target_triple.starts_with("i686-") {
@@ -564,13 +578,13 @@ fn find_compatible_system_clang() -> Option<PathBuf> {
fn clang_download() -> PathBuf {
let clang_base_path = build_dir().join("clang");
println!("clang_base_path {}", clang_base_path.display());
- assert!(Command::new(python())
- .arg("./tools/clang/scripts/update.py")
- .arg("--output-dir")
- .arg(&clang_base_path)
- .status()
- .unwrap()
- .success());
+ // assert!(Command::new(python())
+ // .arg("./tools/clang/scripts/update.py")
+ // .arg("--output-dir")
+ // .arg(&clang_base_path)
+ // .status()
+ // .unwrap()
+ // .success());
assert!(clang_base_path.exists());
clang_base_path
} |
This comment was marked as outdated.
This comment was marked as outdated.
Wow, very inventive technique! |
A new method to cross build deno for android: With a modified cargo and termux-docker (QEMU), we can run So we do not need to modify a lot of source code files, This method is much simple than the old method. see here: https://github.com/fm-elpac/v8-src/tree/deno-1.36 |
Here is the patch for the new method: diff '--color=auto' -ru -x Cargo.lock workdir-1/deno-1.36.1/build.rs workdir/deno-1.36.1/build.rs
--- workdir-1/deno-1.36.1/build.rs 2023-08-21 13:43:45.462849697 +0800
+++ workdir/deno-1.36.1/build.rs 2023-08-21 20:17:19.569271010 +0800
@@ -340,7 +340,6 @@
deno_broadcast_channel::InMemoryBroadcastChannel::default(),
false, // No --unstable.
),
- deno_ffi::deno_ffi::init_ops::<PermissionsContainer>(false),
deno_net::deno_net::init_ops::<PermissionsContainer>(
None, false, // No --unstable.
None,
@@ -400,12 +399,9 @@
// Host snapshots won't work when cross compiling.
let target = env::var("TARGET").unwrap();
let host = env::var("HOST").unwrap();
- if target != host {
- panic!("Cross compiling with snapshot is not supported.");
- }
let symbols_path = std::path::Path::new("napi").join(
- format!("generated_symbol_exports_list_{}.def", env::consts::OS).as_str(),
+ format!("generated_symbol_exports_list_{}.def", "linux").as_str(),
)
.canonicalize()
.expect(
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno-1.36.1/Cargo.toml workdir/deno-1.36.1/Cargo.toml
--- workdir-1/deno-1.36.1/Cargo.toml 2023-08-21 13:43:45.405846998 +0800
+++ workdir/deno-1.36.1/Cargo.toml 2023-08-21 18:15:47.361783037 +0800
@@ -385,3 +385,12 @@
[target."cfg(windows)".build-dependencies.winres]
version = "=0.1.12"
+
+[patch.crates-io]
+v8 = { path = "../v8-0.75.0" }
+deno_runtime = { path = "../deno_runtime-0.123.0" }
+deno_core = { path = "../deno_core-0.200.0" }
+serde_v8 = { path = "../serde_v8-0.111.0" }
+libz-ng-sys = { path = "../libz-ng-sys-1.1.12" }
+deno_fs = { path = "../deno_fs-0.25.0" }
+deno_node = { path = "../deno_node-0.52.0" }
Only in workdir/deno-1.36.1: target
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_core-0.200.0/Cargo.toml workdir/deno_core-0.200.0/Cargo.toml
--- workdir-1/deno_core-0.200.0/Cargo.toml 2023-08-21 14:23:37.195216886 +0800
+++ workdir/deno_core-0.200.0/Cargo.toml 2023-08-21 18:15:47.362783080 +0800
@@ -91,7 +91,7 @@
]
[dependencies.v8]
-version = "0.74.3"
+version = "0.75.0"
default-features = false
[dev-dependencies.bencher]
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_core-0.200.0/runtime/jsruntime.rs workdir/deno_core-0.200.0/runtime/jsruntime.rs
--- workdir-1/deno_core-0.200.0/runtime/jsruntime.rs 2023-08-21 14:23:37.216217840 +0800
+++ workdir/deno_core-0.200.0/runtime/jsruntime.rs 2023-08-21 18:15:47.365783210 +0800
@@ -326,7 +326,7 @@
#[repr(C, align(16))]
struct IcuData([u8; 10541264]);
static ICU_DATA: IcuData = IcuData(*include_bytes!("icudtl.dat"));
- v8::icu::set_common_data_72(&ICU_DATA.0).unwrap();
+ v8::icu::set_common_data_73(&ICU_DATA.0).unwrap();
let base_flags = concat!(
" --wasm-test-streaming",
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_fs-0.25.0/std_fs.rs workdir/deno_fs-0.25.0/std_fs.rs
--- workdir-1/deno_fs-0.25.0/std_fs.rs 2023-08-21 15:46:24.398685329 +0800
+++ workdir/deno_fs-0.25.0/std_fs.rs 2023-08-21 18:15:47.367783296 +0800
@@ -62,7 +62,7 @@
let _ = umask(prev);
prev
};
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
{
Ok(r.bits())
}
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_node-0.52.0/ops/os.rs workdir/deno_node-0.52.0/ops/os.rs
--- workdir-1/deno_node-0.52.0/ops/os.rs 2023-08-21 15:50:56.641553194 +0800
+++ workdir/deno_node-0.52.0/ops/os.rs 2023-08-21 18:15:47.388784205 +0800
@@ -60,7 +60,7 @@
use libc::id_t;
use libc::PRIO_PROCESS;
- #[cfg(target_os = "macos")]
+ #[cfg(any(target_os = "macos", target_os = "android"))]
#[allow(non_camel_case_types)]
type priority_t = i32;
#[cfg(target_os = "linux")]
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_node-0.52.0/polyfills/internal_binding/uv.ts workdir/deno_node-0.52.0/polyfills/internal_binding/uv.ts
--- workdir-1/deno_node-0.52.0/polyfills/internal_binding/uv.ts 2023-08-21 15:50:56.701556428 +0800
+++ workdir/deno_node-0.52.0/polyfills/internal_binding/uv.ts 2023-08-21 20:06:42.203785426 +0800
@@ -494,6 +494,8 @@
? codeToErrorDarwin
: osType === "linux"
? codeToErrorLinux
+ : osType === "android"
+ ? codeToErrorLinux
: osType === "freebsd"
? codeToErrorFreebsd
: osType === "openbsd"
@@ -508,6 +510,8 @@
? errorToCodeDarwin
: osType === "linux"
? errorToCodeLinux
+ : osType === "android"
+ ? errorToCodeLinux
: osType === "freebsd"
? errorToCodeFreebsd
: osType === "openbsd"
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_node-0.52.0/polyfills/_util/os.ts workdir/deno_node-0.52.0/polyfills/_util/os.ts
--- workdir-1/deno_node-0.52.0/polyfills/_util/os.ts 2023-08-21 15:50:56.670554757 +0800
+++ workdir/deno_node-0.52.0/polyfills/_util/os.ts 2023-08-21 20:07:47.396796206 +0800
@@ -2,7 +2,7 @@
const { ops } = globalThis.__bootstrap.core;
-export type OSType = "windows" | "linux" | "darwin" | "freebsd" | "openbsd";
+export type OSType = "windows" | "linux" | "android" | "darwin" | "freebsd" | "openbsd";
export const osType: OSType = ops.op_node_build_os();
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/build.rs workdir/deno_runtime-0.123.0/build.rs
--- workdir-1/deno_runtime-0.123.0/build.rs 2023-08-21 13:44:12.370122735 +0800
+++ workdir/deno_runtime-0.123.0/build.rs 2023-08-21 18:15:47.391784335 +0800
@@ -107,15 +107,6 @@
}
}
- impl deno_ffi::FfiPermissions for Permissions {
- fn check_partial(
- &mut self,
- _path: Option<&Path>,
- ) -> Result<(), deno_core::error::AnyError> {
- unreachable!("snapshotting!")
- }
- }
-
impl deno_napi::NapiPermissions for Permissions {
fn check(
&mut self,
@@ -257,7 +248,6 @@
deno_broadcast_channel,
// FIXME(bartlomieju): this should be reenabled
// "deno_node",
- deno_ffi,
deno_net,
deno_napi,
deno_http,
@@ -333,7 +323,6 @@
deno_broadcast_channel::InMemoryBroadcastChannel::default(),
false, // No --unstable.
),
- deno_ffi::deno_ffi::init_ops_and_esm::<Permissions>(false),
deno_net::deno_net::init_ops_and_esm::<Permissions>(
None, false, // No --unstable.
None,
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/Cargo.toml workdir/deno_runtime-0.123.0/Cargo.toml
--- workdir-1/deno_runtime-0.123.0/Cargo.toml 2023-08-21 13:44:12.369122687 +0800
+++ workdir/deno_runtime-0.123.0/Cargo.toml 2023-08-21 18:15:47.392784379 +0800
@@ -62,9 +62,6 @@
[dependencies.deno_fetch]
version = "0.139.0"
-[dependencies.deno_ffi]
-version = "0.102.0"
-
[dependencies.deno_fs]
version = "0.25.0"
features = ["sync_fs"]
@@ -202,9 +199,6 @@
[build-dependencies.deno_fetch]
version = "0.139.0"
-[build-dependencies.deno_ffi]
-version = "0.102.0"
-
[build-dependencies.deno_fs]
version = "0.25.0"
features = ["sync_fs"]
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/js/10_permissions.js workdir/deno_runtime-0.123.0/js/10_permissions.js
--- workdir-1/deno_runtime-0.123.0/js/10_permissions.js 2023-08-21 13:44:12.374122924 +0800
+++ workdir/deno_runtime-0.123.0/js/10_permissions.js 2023-08-21 18:15:47.393784422 +0800
@@ -33,7 +33,7 @@
* @property {boolean} partial
*/
-/** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "ffi" | "hrtime">} */
+/** @type {ReadonlyArray<"read" | "write" | "net" | "env" | "sys" | "run" | "hrtime">} */
const permissionNames = [
"read",
"write",
@@ -41,7 +41,6 @@
"env",
"sys",
"run",
- "ffi",
"hrtime",
];
@@ -129,7 +128,7 @@
function cache(desc, rawStatus) {
let { name: key } = desc;
if (
- (desc.name === "read" || desc.name === "write" || desc.name === "ffi") &&
+ (desc.name === "read" || desc.name === "write") &&
ReflectHas(desc, "path")
) {
key += `-${desc.path}&`;
@@ -180,7 +179,7 @@
*/
function formDescriptor(desc) {
if (
- desc.name === "read" || desc.name === "write" || desc.name === "ffi"
+ desc.name === "read" || desc.name === "write"
) {
desc.path = pathFromURL(desc.path);
} else if (desc.name === "run") {
@@ -266,7 +265,7 @@
if (typeof permissions == "object" && permissions != null) {
const serializedPermissions = {};
for (
- const key of new SafeArrayIterator(["read", "write", "run", "ffi"])
+ const key of new SafeArrayIterator(["read", "write", "run"])
) {
if (ArrayIsArray(permissions[key])) {
serializedPermissions[key] = ArrayPrototypeMap(
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/js/90_deno_ns.js workdir/deno_runtime-0.123.0/js/90_deno_ns.js
--- workdir-1/deno_runtime-0.123.0/js/90_deno_ns.js 2023-08-21 13:44:12.377123065 +0800
+++ workdir/deno_runtime-0.123.0/js/90_deno_ns.js 2023-08-21 18:15:47.414785331 +0800
@@ -5,7 +5,6 @@
import * as timers from "ext:deno_web/02_timers.js";
import * as httpClient from "ext:deno_fetch/22_http_client.js";
import * as console from "ext:deno_console/01_console.js";
-import * as ffi from "ext:deno_ffi/00_ffi.js";
import * as net from "ext:deno_net/01_net.js";
import * as tls from "ext:deno_net/02_tls.js";
import * as http from "ext:deno_http/01_http.js";
@@ -163,11 +162,6 @@
createHttpClient: httpClient.createHttpClient,
// TODO(bartlomieju): why is it needed?
http,
- dlopen: ffi.dlopen,
- UnsafeCallback: ffi.UnsafeCallback,
- UnsafePointer: ffi.UnsafePointer,
- UnsafePointerView: ffi.UnsafePointerView,
- UnsafeFnPointer: ffi.UnsafeFnPointer,
flock: fs.flock,
flockSync: fs.flockSync,
funlock: fs.funlock,
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/lib.rs workdir/deno_runtime-0.123.0/lib.rs
--- workdir-1/deno_runtime-0.123.0/lib.rs 2023-08-21 13:44:12.378123113 +0800
+++ workdir/deno_runtime-0.123.0/lib.rs 2023-08-21 18:15:47.417785461 +0800
@@ -6,7 +6,6 @@
pub use deno_core;
pub use deno_crypto;
pub use deno_fetch;
-pub use deno_ffi;
pub use deno_fs;
pub use deno_http;
pub use deno_io;
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/ops/os/mod.rs workdir/deno_runtime-0.123.0/ops/os/mod.rs
--- workdir-1/deno_runtime-0.123.0/ops/os/mod.rs 2023-08-21 13:44:12.380123207 +0800
+++ workdir/deno_runtime-0.123.0/ops/os/mod.rs 2023-08-21 18:15:47.419785548 +0800
@@ -305,7 +305,7 @@
}
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "android"))]
fn rss() -> usize {
// Inspired by https://github.com/Arc-blroth/memory-stats/blob/5364d0d09143de2a470d33161b2330914228fde9/src/linux.rs
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/ops/os/sys_info.rs workdir/deno_runtime-0.123.0/ops/os/sys_info.rs
--- workdir-1/deno_runtime-0.123.0/ops/os/sys_info.rs 2023-08-21 13:44:12.380123207 +0800
+++ workdir/deno_runtime-0.123.0/ops/os/sys_info.rs 2023-08-21 18:15:47.423785721 +0800
@@ -6,7 +6,7 @@
const DEFAULT_LOADAVG: LoadAvg = (0.0, 0.0, 0.0);
pub fn loadavg() -> LoadAvg {
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
{
use libc::SI_LOAD_SHIFT;
@@ -117,6 +117,10 @@
)
}
}
+ #[cfg(target_os = "android")]
+ {
+ String::from("")
+ }
}
#[cfg(target_family = "windows")]
@@ -198,7 +202,7 @@
swap_total: 0,
swap_free: 0,
};
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
{
let mut info = std::mem::MaybeUninit::uninit();
// SAFETY: `info` is a valid pointer to a `libc::sysinfo` struct.
@@ -331,7 +335,7 @@
pub fn os_uptime() -> u64 {
let uptime: u64;
- #[cfg(target_os = "linux")]
+ #[cfg(any(target_os = "linux", target_os = "android"))]
{
let mut info = std::mem::MaybeUninit::uninit();
// SAFETY: `info` is a valid pointer to a `libc::sysinfo` struct.
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/permissions/mod.rs workdir/deno_runtime-0.123.0/permissions/mod.rs
--- workdir-1/deno_runtime-0.123.0/permissions/mod.rs 2023-08-21 13:44:12.381123255 +0800
+++ workdir/deno_runtime-0.123.0/permissions/mod.rs 2023-08-21 18:15:47.429785981 +0800
@@ -1464,13 +1464,6 @@
}
}
-impl deno_ffi::FfiPermissions for PermissionsContainer {
- #[inline(always)]
- fn check_partial(&mut self, path: Option<&Path>) -> Result<(), AnyError> {
- self.0.lock().ffi.check_partial(path)
- }
-}
-
impl deno_kv::sqlite::SqliteDbHandlerPermissions for PermissionsContainer {
#[inline(always)]
fn check_read(&mut self, p: &Path, api_name: &str) -> Result<(), AnyError> {
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/web_worker.rs workdir/deno_runtime-0.123.0/web_worker.rs
--- workdir-1/deno_runtime-0.123.0/web_worker.rs 2023-08-21 13:44:12.382123302 +0800
+++ workdir/deno_runtime-0.123.0/web_worker.rs 2023-08-21 18:15:47.435786241 +0800
@@ -433,7 +433,6 @@
options.broadcast_channel.clone(),
unstable,
),
- deno_ffi::deno_ffi::init_ops_and_esm::<PermissionsContainer>(unstable),
deno_net::deno_net::init_ops_and_esm::<PermissionsContainer>(
options.root_cert_store_provider.clone(),
unstable,
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno_runtime-0.123.0/worker.rs workdir/deno_runtime-0.123.0/worker.rs
--- workdir-1/deno_runtime-0.123.0/worker.rs 2023-08-21 13:44:12.382123302 +0800
+++ workdir/deno_runtime-0.123.0/worker.rs 2023-08-21 18:15:47.438786370 +0800
@@ -334,7 +334,6 @@
options.broadcast_channel.clone(),
unstable,
),
- deno_ffi::deno_ffi::init_ops_and_esm::<PermissionsContainer>(unstable),
deno_net::deno_net::init_ops_and_esm::<PermissionsContainer>(
options.root_cert_store_provider.clone(),
unstable,
diff '--color=auto' -ru -x Cargo.lock workdir-1/libz-ng-sys-1.1.12/build_zng.rs workdir/libz-ng-sys-1.1.12/build_zng.rs
--- workdir-1/libz-ng-sys-1.1.12/build_zng.rs 2023-08-21 15:28:56.175241480 +0800
+++ workdir/libz-ng-sys-1.1.12/build_zng.rs 2023-08-21 18:15:47.439786414 +0800
@@ -17,6 +17,10 @@
if target == "i686-pc-windows-msvc" {
cmake.define("CMAKE_GENERATOR_PLATFORM", "Win32");
}
+ // Android
+ if target.contains("android") {
+ cmake.define("CMAKE_ANDROID_NDK", env::var("ANDROID_NDK_HOME").unwrap());
+ }
let install_dir = cmake.build();
diff '--color=auto' -ru -x Cargo.lock workdir-1/serde_v8-0.111.0/Cargo.toml workdir/serde_v8-0.111.0/Cargo.toml
--- workdir-1/serde_v8-0.111.0/Cargo.toml 2023-08-21 14:25:49.665241353 +0800
+++ workdir/serde_v8-0.111.0/Cargo.toml 2023-08-21 18:15:47.440786457 +0800
@@ -58,7 +58,7 @@
version = "1.0.40"
[dependencies.v8]
-version = "0.74.3"
+version = "0.75.0"
default-features = false
[dev-dependencies.bencher] |
This comment was marked as outdated.
This comment was marked as outdated.
Build deno for |
The new version of deno can not run on Android, because |
I made a shell script termux-pacman-glibc-setup.sh to setup |
@CodeIter interesting ! I tries your method, and it seems that the offical We just need to use $ patchelf --set-rpath /data/data/com.termux/files/usr/glibc/lib --set-interpreter /data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1 deno
$ unset LD_PRELOAD
$ ./deno --version
deno 1.43.3 (release, aarch64-unknown-linux-gnu)
v8 12.4.254.13
typescript 5.4.5
$ ./deno
Deno 1.43.3
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> 0.1+0.2
0.30000000000000004
> |
$ ldd deno
libdl.so.2 => /data/data/com.termux/files/usr/glibc/lib/libdl.so.2
libgcc_s.so.1 => /data/data/com.termux/files/usr/glibc/lib/libgcc_s.so.1
libpthread.so.0 => /data/data/com.termux/files/usr/glibc/lib/libpthread.so.0
libm.so.6 => /data/data/com.termux/files/usr/glibc/lib/libm.so.6
libc.so.6 => /data/data/com.termux/files/usr/glibc/lib/libc.so.6
ld-linux-aarch64.so.1 => /data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1
$ |
This method can also work out of raphael:/data/local/tmp $ pwd
/data/local/tmp
raphael:/data/local/tmp $ ls -l
total 138648
-rwxrwxrwx 1 shell shell 141959425 2024-05-17 06:57 deno
drwxrwxr-x 2 shell shell 4096 2024-05-17 06:54 lib
raphael:/data/local/tmp $ ls -l lib
total 4240
-rwxrwxrwx 1 shell shell 241064 2024-05-17 06:53 ld-linux-aarch64.so.1
-rwxrwxrwx 1 shell shell 2292352 2024-05-17 06:53 libc.so.6
-rwxrwxrwx 1 shell shell 69736 2024-05-17 06:53 libdl.so.2
-rw-rw-rw- 1 shell shell 591400 2024-05-17 06:53 libgcc_s.so.1
-rwxrwxrwx 1 shell shell 1039216 2024-05-17 06:53 libm.so.6
-rwxrwxrwx 1 shell shell 70120 2024-05-17 06:53 libpthread.so.0
raphael:/data/local/tmp $ export HOME=$(pwd)
raphael:/data/local/tmp $ ./deno --version
deno 1.43.3 (release, aarch64-unknown-linux-gnu)
v8 12.4.254.13
typescript 5.4.5
raphael:/data/local/tmp $ ./deno
Deno 1.43.3
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> 0.1 + 0.2
0.30000000000000004
> Deno.version
{ deno: "1.43.3", v8: "12.4.254.13", typescript: "5.4.5" }
> patch > patchelf --set-rpath /data/local/tmp/lib --set-interpreter /data/local/tmp/lib/ld-linux-aarch64.so.1 deno so, this is a really simple and great method ! |
I have updated the script. |
https://nodejs-mobile.github.io/ another note is that you should probably look at blink (https://github.com/jart/blink) , its faster than qemu (but its for x86_64) so I don't really know. |
Does this script still work? It first complained about no keyrings and I had to Then deno installs, but it fails to run @secext2022 I also tried an older version v1.43.3 since that worked in May, but get the same error:
...
|
This is Termux version |
Never mind. I was using the Play Store version which I shouldn't have done (1 2). I removed that and installed |
The following content is outdated, please see the new comment for a simple new method.
I find a way to manually cross compile deno 1.35.0 for aarch64 android.
x86_64-unknown-linux-gnu
(ArchLinux)aarch64-linux-android
(an Android phone)It's not good, but it works:
Build on Android is not possible, so you must do cross compile. The current problem of deno for cross compile is, snapshot.
I copy code from
build.rs
with a little modification, and build it as a binarydeno-mksnapshot
. Then rundeno-mksnapshot
on Android device, get the outputRUNTIME_SNAPSHOT.bin
,COMPILER_SNAPSHOT.bin
, andCLI_SNAPSHOT.bin
files. Finally disablebuild.rs
on host, and build deno.I have to modify a lot of source files for it to compile, and I have to disable
deno_ffi
andICU
.Detail build steps and patch for source code will be posted later.
The text was updated successfully, but these errors were encountered: