-
-
Notifications
You must be signed in to change notification settings - Fork 20
About glibc runner (grun)
Glibc-runner is a bash script that provides two main features that can make it easier to use Glibc and Glibc based commands.
The shell in Termux is set up so that when running a Glibc-based binary, it will return an error about the absence of the libdl.so
library.
~ $ export PATH=$PREFIX/glibc/bin:$PATH
~ $ locale
locale: error while loading shared libraries: libdl.so: cannot open shared object file: No such file or directory
This is due to the LD_PRELOAD
value being set which points to the Bionic based libtermux-exec.so
library.
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
To fix this, you can simply remove the value of LD_PRELOAD
and then the Glibc-based binaries that are configured to work in Termux will work.
~ $ unset LD_PRELOAD
~ $ locale
**result of running `locale` command**
Glibc-runner configures a shell and configures access to Glibc-based commands, so you can simply run a special shell or from glibc-runner run a glibc command.
~ $ grun --shell locale --help
**message help from `locale` command**
~ $ grun --shell
~ $ # after this command the shell is configured and you have access to the glibc command
In order for a Glibc-based binary to run in Termux, it must have a properly specified dynamic linker directory. Otherwise, they will return the following error:
~ $ ./bun
bash: ./bun: cannot execute: required file not found
Glibc-runner allows you to run such binaries with $PREFIX/glibc/bin/ld.so
or set the dynamic linker path and Glibc-based libraries directory path with patchelf
.
~ $ grun ./bun --help
**result of running `bun` binary**
~ $ grun --set ./bun
~ $ ./bun --help
**result of running `bun` binary**
Note: the shell in Termux needs to be configure.