Currently using termux-exec as LD_PRELOAD causes things to fail if loading a glibc-based executable with a bionic-based termux-exec preload or viceversa a bionic-based executable with a glibc-based termux-exec preload.
This makes it impossible, for instance, to run, from a glibc-based program, a script using "#!/usr/bin/env node" where node uses bionic, because to run it LD_PRELOAD has to be set to a glibc-based termux-exec, but that will cause a failure to run node.
The solution is to make termux-exec loadable in both glibc and bionic based programs, which should be achievable by not depending on any libc and instead doing raw Linux system calls in termux-exec, and exporting both Bionic-flavored and glibc-flavored exec* functions if they differ.
Currently using termux-exec as LD_PRELOAD causes things to fail if loading a glibc-based executable with a bionic-based termux-exec preload or viceversa a bionic-based executable with a glibc-based termux-exec preload.
This makes it impossible, for instance, to run, from a glibc-based program, a script using "#!/usr/bin/env node" where node uses bionic, because to run it LD_PRELOAD has to be set to a glibc-based termux-exec, but that will cause a failure to run node.
The solution is to make termux-exec loadable in both glibc and bionic based programs, which should be achievable by not depending on any libc and instead doing raw Linux system calls in termux-exec, and exporting both Bionic-flavored and glibc-flavored exec* functions if they differ.