termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
783 stars 160 forks source link

Blocker: CANNOT LINK EXECUTABLE "/system/bin/sh" #74

Closed zorrobyte closed 5 years ago

zorrobyte commented 5 years ago

I'm trying to compile come C modules with termux using proot termux-chroot, but some of the compilation steps result in this error: CANNOT LINK EXECUTABLE "/system/bin/sh": library "/data/data/com.termux/files/usr/lib/libtermux-exec.so" needed or dlopened by "/system/bin/sh" is not accessible for the namespace "(default)"

I'm unsure how to solve it. Any help would be greatly appreciated!

edit: is this due to some sort of permissions issue?

image

This is my printenv


termux-chroot
$ printenv
SHELL=/data/data/com.termux/files/usr/bin/bash
PREFIX=/data/data/com.termux/files/usr
PWD=/home
LOGNAME=u0_a128
EXTERNAL_STORAGE=/sdcard
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
HOME=/home
LANG=en_US.UTF-8
TMPDIR=/data/data/com.termux/files/usr/tmp
SSH_CONNECTION=192.168.1.176 50030 192.168.1.158 8022
ANDROID_DATA=/data
TERM=xterm-256color
USER=u0_a128
SHLVL=2
ANDROID_ROOT=/system
SSH_CLIENT=192.168.1.176 50030 8022
PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
SSH_TTY=/dev/pts/1
_=/data/data/com.termux/files/usr/bin/printenv```
zorrobyte commented 5 years ago

Trying to set libtermux-exec.so to 777 didn't work.

zorrobyte commented 5 years ago

The specific compilation I am attempting is


echo "Installing c-capnp"
git clone https://github.com/commaai/c-capnproto.git
cd c-capnproto
git submodule update --init --recursive
autoreconf -f -i -s
CXXFLAGS="-fPIC" ./configure
make -j4
make install```
ghost commented 5 years ago

Use unset LD_PRELOAD. Termux-exec lib shouldn't be used inside proot.