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

grun auto-translate interpreter ld.so and hook /tmp file-access libc-calls #239

Open
leegao opened this issue May 2, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@leegao
Copy link

leegao commented May 2, 2024

Problem description

This is more of a hacky feature request / "could it work" question

I really like grun -c, and it feels like it should be possible to use the same ideas to automatically emulate the proper prefix path for fast on-the-fly translation somehow.

For interpreter:

  1. Check if the interpreter isn't either statically-linked, /system/bin/linker64, or /data/data/com.termux/files/usr/glibc/lib/ld*
  2. If not, then create a copy with the patchelf
  3. Do the same thing with all DT_NEEDED libraries transitively (maybe create a dedicated rpath copy for this)

For automatic /tmp, /etc, /share, /opt, /usr reroute:

  1. (for non-static libraries, still using libc without inlined syscalls) - you could offer a libwrap.so style hook+redirect that just rewrites all paths to prepend the prefix /data/data/com.termux/files/usr/glibc. This could even be something that you can specify as a filter, or only replay if the initial call fails.
  2. (otherwise) - offer a proot/ptrace style hooks (or tell them to use proot in a proper distro for e.g.)

System information

termux-info:

@leegao leegao added the bug Something isn't working label May 2, 2024
@Maxython Maxython added enhancement New feature or request and removed bug Something isn't working labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants