Skip to content
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

Termux can not use emcc #23458

Open
hyfhaozero opened this issue Jan 19, 2025 · 7 comments
Open

Termux can not use emcc #23458

hyfhaozero opened this issue Jan 19, 2025 · 7 comments

Comments

@hyfhaozero
Copy link

Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.1 (89ce854)

Failing command line in full:
emcc: warning: cannot check node version: [Errno 2] No such file or directory: '/data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node' [-Wversion-check]
emcc: error: '/data/data/com.termux/files/home/emsdk/upstream/bin/clang --version' failed: [Errno 2] No such file or directory: '/data/data/com.termux/files/home/emsdk/upstream/bin/clang'

Full link command and output with -v appended:
~/emsdk $ source ./emsdk_env.sh
Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1)
Adding directories to PATH:
PATH += /data/data/com.termux/files/home/emsdk
PATH += /data/data/com.termux/files/home/emsdk/upstream/emscripten

Setting environment variables:
PATH = /data/data/com.termux/files/home/emsdk:/data/data/com.termux/files/home/emsdk/upstream/emscripten:/data/data/com.termux/files/home/.pub-cache/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/home/dotnet:/data/data/com.termux/files/home/.config/v-analyzer/bin
EMSDK = /data/data/com.termux/files/home/emsdk
EMSDK_NODE = /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node
~/emsdk $ emcc
emcc: warning: cannot check node version: [Errno 2] No such file or directory: '/data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node' [-Wversion-check]
emcc: error: '/data/data/com.termux/files/home/emsdk/upstream/bin/clang --version' failed: [Errno 2] No such file or directory: '/data/data/com.termux/files/home/emsdk/upstream/bin/clang'

Everything is okay before i run emcc,and i think it may was caused by different architectures(My system: arm64)

@sbc100
Copy link
Collaborator

sbc100 commented Jan 19, 2025

What happens if you try to run on of the executable directly, i.e. node or clang?

Can you run /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node --version?

What does file /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node say?

What does ldd /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node say?

@hyfhaozero
Copy link
Author

/data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node --version
bash: /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node: cannot execute: required file not found
~ $ ldd /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node
libdl.so.2 => not found
libstdc++.so.6 => not found
libm.so.6 => not found
libgcc_s.so.1 => not found
libpthread.so.0 => not found
libc.so.6 => not found
ld-linux-aarch64.so.1 => not found

@sbc100
Copy link
Collaborator

sbc100 commented Jan 19, 2025

Looks like you are somehow missing that needed shared libraries to run node.

What does file /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node say?

What does file /usr/bin/ls say?

What linux distro are you using?

@hyfhaozero
Copy link
Author

~/emsdk $ file /data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node
/data/data/com.termux/files/home/emsdk/node/20.18.0_64bit/bin/node: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=6f13d8ac8e5a36701f088cfb18fb88e2d85b9751, for GNU/Linux 3.7.0, with debug_info, not stripped, too many notes (256)

~/emsdk $ file ~/../usr/bin/ls
/data/data/com.termux/files/home/../usr/bin/ls: symbolic link to coreutils

@hyfhaozero
Copy link
Author

And I use termux so there's no any linux distro is used by me

@sbc100
Copy link
Collaborator

sbc100 commented Jan 20, 2025

I have no idea want termux is.

What does file /data/data/com.termux/files/home/../usr/bin/ls say? The reason I'm asking is that it seems that maybe you have install the arm64 version of emsdk inside and environment that is not setup for arm64. At least it seems to be missing all of the core DLLs.

@sbc100
Copy link
Collaborator

sbc100 commented Jan 20, 2025

It looks like you might not have the glibc libraries installed in termux. I see some instructions for getting starting with glibc packages here: https://github.com/termux/glibc-packages. Note that emsdk binaries are all linked against glibc and require glibc .so files it be available at runtime.

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

No branches or pull requests

2 participants