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

glibc-for-termux support 32bit arm and bug fixes #3

Closed
ExtinctDrift19 opened this issue Jul 12, 2022 · 32 comments
Closed

glibc-for-termux support 32bit arm and bug fixes #3

ExtinctDrift19 opened this issue Jul 12, 2022 · 32 comments
Labels
good first issue Good for newcomers

Comments

@ExtinctDrift19
Copy link

glibc 32

@Maxython
Copy link
Member

glibc-for-termux will support all architectures, it's just a matter of time. So I understand what you mean by 32bit - arm architecture (armv7)? If yes, support for this architecture will not appear soon, since I do not have a device with arm.

@Maxython Maxython pinned this issue Jul 13, 2022
@ExtinctDrift19
Copy link
Author

Yes

@ghost
Copy link

ghost commented Jul 14, 2022

glibc-for-termux will support all architectures, it's just a matter of time. So I understand what you mean by 32bit - arm architecture (armv7)? If yes, support for this architecture will not appear soon, since I do not have a device with arm.

can i help you with compiling for arm since i have a armv8l (but armv7 compatible) device with termux?

@ExtinctDrift19
Copy link
Author

Yes can i help you with compiling for arm since i have a armv8l (but armv7 compatible) device with termux?

@ghost
Copy link

ghost commented Jul 14, 2022

Yes can i help you with compiling for arm since i have a armv8l (but armv7 compatible) device with termux?

bruh its my device but if you have smth like that cool

@ExtinctDrift19
Copy link
Author

my device samsung a10 galaxy

@Maxython
Copy link
Member

Maxython commented Oct 5, 2022

Hi all. Now you can install glibc packages for armv7 architecture and experiment with packages for compiling in termux (note: in the termux section, not all packages are configured to compile in armv7).

https://github.com/Maxython/glibc-for-termux/releases/tag/20221005

@Maxython Maxython unpinned this issue Oct 5, 2022
@ghost
Copy link

ghost commented Oct 6, 2022

after running gcc i got this bad sys call
Screenshot_20221005_222700
and heres a bit of gdb in case you need it
Screenshot_20221005_222831_com termux

@ghost
Copy link

ghost commented Oct 6, 2022

after running strace i got this, weird
Screenshot_20221005_224022

@Maxython
Copy link
Member

Maxython commented Oct 6, 2022

Thanks for reporting the bug. I'll fix it soon and update the package archive in the release.

Is it just gcc or all glibc commands not working?

@ghost
Copy link

ghost commented Oct 6, 2022

Screenshot_20221006_081441
yep

@Maxython
Copy link
Member

Maxython commented Oct 6, 2022

@Randomxdp, I need you to do the following:

I need this so that I understand whether you have a statx system call (according to the bionic system call standard, it must exist - https://android.googlesource.com/platform/bionic/+/master/libc/SYSCALLS.TXT#214).

@ghost
Copy link

ghost commented Oct 6, 2022

my luck.
Screenshot_20221006_195933_com termux

@Maxython
Copy link
Member

Maxython commented Oct 7, 2022

Now, I would like to get the result of the termux-info command. And also try running some glibc commands with proot (for example: proot gcc).

@ghost
Copy link

ghost commented Oct 7, 2022

termux-info
Screenshot_20221007_080549
and proot fixes it?
Screenshot_20221007_080618

@Maxython
Copy link
Member

Maxython commented Oct 7, 2022

Similar case: libuv/libuv#2282 (I left it for further action)

@Maxython Maxython changed the title glibc-for-termux support 32bit arm glibc-for-termux support 32bit arm and bug fixes Oct 7, 2022
@Maxython
Copy link
Member

Maxython commented Oct 8, 2022

@Randomxdp, install this glibc and try to compile something based on gcc-glibc.

wget https://github.com/Maxython/glibc-for-termux/files/9738900/glibc-2.36-1-armv7.zip
unzip glibc-2.36-1-armv7.zip
proot --link2symlink pacman -U glibc-2.36-1-any.pkg.tar.xz

glibc-2.36-1-armv7.zip

@ghost
Copy link

ghost commented Oct 8, 2022

when trying to build with pacman it couldnt verify the signature of binutils, (the package i tried to build) but the sha suceeded and this is a screenshot of my attempt to run gcc and also some debugging info
Screenshot_20221008_085747

@Maxython
Copy link
Member

Maxython commented Oct 8, 2022

The result of strace is not fully shown here. Can you show the full or end result of strace?

@ghost
Copy link

ghost commented Oct 8, 2022

Screenshot_20221008_112555_com termux
Screenshot_20221008_112601_com termux

@Maxython
Copy link
Member

Maxython commented Oct 8, 2022

@Randomxdp, now try using this glibc.

glibc-2.36-1-armv7.zip

After you install it, you must compile one program written below based on gcc-glibc and send me the result.

#include <stdio.h>
#include <time.h>
#include <fcntl.h>

int main () {
        struct timespec tp;

        if (clock_gettime(CLOCK_REALTIME, &tp) == -1) {
                perror("clock_gettime");
        }
        else {
                printf("clock_gettime success: %ld\n", tp.tv_nsec);
        }
        return 0;
}

@ghost
Copy link

ghost commented Oct 8, 2022

@Maxython
Copy link
Member

Maxython commented Oct 9, 2022

Run this

gcc test.c -c test.o
strace ld -o test -dynamic-linker $PREFIX/glibc/lib/ld-linux-armhf.so.3 $PREFIX/glibc/lib/crt1.o $PREFIX/glibc/lib/crti.o -lc test.o $PREFIX/glibc/lib/crtn.o

@ghost
Copy link

ghost commented Oct 9, 2022

here
Screenshot_20221009_084338
Screenshot_20221009_084400
Screenshot_20221009_084426

@Maxython
Copy link
Member

Maxython commented Oct 9, 2022

Bruh, you didn't copy the ld command all the way.

@ghost
Copy link

ghost commented Oct 9, 2022

@Maxython
Copy link
Member

@Randomxdp, install this glibc.

glibc-2.36-1-armv7.zip

After that, try to compile the last file and run it (send the result).

@ghost
Copy link

ghost commented Oct 17, 2022

help2.mp4

@Maxython
Copy link
Member

@Randomxdp, try to do the same but only with this glibc.

glibc-2.36-1-armv7.zip

@ghost
Copy link

ghost commented Oct 22, 2022

Screenshot_20221022_083746
Screenshot_20221022_083736

@Maxython
Copy link
Member

Great, you now have a working glibc (in theory). As a test, try compiling a program that doesn't require additional glibc libraries (for example, vitetris).

@Maxython Maxython added the good first issue Good for newcomers label Oct 23, 2022
@ghost
Copy link

ghost commented Oct 24, 2022

yep, its working, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants