Closed Maxython closed 3 years ago
but I'm wondering why it happens.
ABI difference between Android (Bionic) libc and GNU libc. Termux packages are built with Android NDK toolchain and cannot be executed with GNU libc, Musl, uClibc and others not compatible with Bionic.
That is, need library analogues on the Android NDK tool?
No, this means if you are using Termux packages, the libc must be Bionic. I.e. from /system/lib. If unsupported libc.so will appear in library search path, you won't be able to execute any of Termux utility.
So if you want to use pacman
with GNU libc, rm -rf $PREFIX
and fill it with compatible binaries.
OK thanks)
@xeffyr
It's not for nothing, but if it's still fixed, I think some packages wouldn't work because they're echos to work in the standard routes (/bin /share /etc) or am I wrong?
The installer has added termux-chroot activation.
https://wiki.termux.com/wiki/Differences_from_Linux
Therefore, those packages should not actually break.
@Yisus7u7 https://wiki.termux.com/wiki/Differences_from_Linux states this regarding execution behavior:
Therefore, those packages should not actually break.
@Maxython termux-chroot
only fixes FHS and some system calls. Nothing more. Bash linked with Bionic libc won't suddenly start work with GNU libc.
Well if it's true, using termux-chroot can evade the problem
@xeffyr I understand that termux-chroot fixes the FHS and that's what I mean.
@Yisus7u7, there are still packages that are not supported on termux. These packages will be written here.
Another bug with the glibc package, but with a different library and for a different reason. And if you delete this file, then pacman stops working.
I'm probably going to ask a dumb question, but I'm curious. Is it possible to link libraries (with GNU libc and with Bionic) if replace some commands with GNU libc (for example bash)?
It's just that some termux commands play an important role, for example the same termux-chroot.
@Maxython Everything that you need to do is to place GNU libc outside of library search path. $PREFIX/lib is reserved solely for Termux purpose and is hardcoded into each ELF executable (in both utilities and libraries).
So if you want to place GNU libc files to $PREFIX/lib, this will not work. Use proot
to separate $PREFIX from the rest of FHS layout, i.e. don't use termux-chroot
implementation packaged in Termux since you need there a custom directory bindings.
You can use https://github.com/termux/proot-distro/blob/master/proot-distro.sh as example of co-existing of $PREFIX and Linux distribution.
Is it possible to make an analogue of glibc, but for termux?
GNU libc, even if will be compiled with Android NDK will have a different ABI (application binary interface) anyway, so you won't be able to execute Termux binaries with it. Is that not understandable that GNU libc and Bionic libc are different things on binary and source levels?
Compiler doesn't matter, unlike the information coded into ELF header of executable during compilation time. It is specific to used shared libraries. So if you compiled & linked program with GNU libc, it will not work with Bionic and other libc, unless this different libc has compatibility with GNU libc on binary level.
To accomplish what you are asking, here is what required (minimal):
I've did an experiment with porting Musl libc (it is smaller than GNU libc) - https://archive.org/details/termux-musl-repository-25.01.2019.tar, and it didn't finished successfully. Maintenance requires a lot more effort than current setup with Android NDK. It just not worth it, unless you have unlimited amount of free time and very good knowledge in GCC and libc internals to successfully troubleshoot them.
So if
Is it possible to make an analogue of glibc, but for termux?
is actually request for GNU libc package in Termux, then answer is: no, not possible.
I personally see no reason to have pacman with few GNU libc packages and packages from Termux repositories with termux-chroot use. Better to use proot-distro
then or make termux-packages
fork producing pacman packages.
Ok, I understand you.
If it's impossible, then how can nix-on-droid run both bionic and glibc binaries?
@leapofazzam123 Because glibc is not in a library search path of Bionic-linked programs. Glibc is stored in Nix store bind-mounted via proot. It works in same way as UserLAnd or other proot launchers.
Hi @xeffyr, @WMCB-Tech, @Yisus7u7 and others. You know about pacman-for-termux development. So I found a way to install packages, although it is installing but does not work. This is due to unworthy libraries. All necessary libraries were in the glibc package, although it was conflicting, but the conflict was due to header files. As a result, after installation, this error occurred.
After that I decided to extract specific libraries from the package and after adding the libc.so file the same error is displayed.
Of course, I know how to fix this error, but I'm wondering why it happens.