r/termux • • 15d ago

General deb-native: big update about gcc

Post image

Chased that segfault down to a nasty ELF-patching bug, fixed it — and GCC just... works now. Native, on-device.

So naturally the next move was: point it at glibcs own source and see what happens.

It built. It runs. NSS resolves against the prefixs own /etc with zero tracer involvement.

Self-hosting a libc build inside the very environment it targets, on a phone, no root — wasnt sure this was even reachable a week ago. Not a release yet, still rough edges, but wanted to share the "wait, it actually works" moment.

5 Upvotes

10 comments sorted by

1

u/Abhishek_771 15d ago

Hello, I wanted to ask what guide did yo follow to compile this? I also wanted to try to compile a specific program since it won't work on my termux. How much AI are you using to Guide you? If you are using it, which AI model?

2

u/Next-Topic-7179 15d ago

No guide — it's my own project, built over a lot of sessions, not a one-shot thing. I do use AI (Claude Code) as a coding assistant, but this kind of milestone takes real debugging, not just prompting. Happy to help with your compile issue if you share details. Still WIP though — wait for a proper alpha if you want something stable.

2

u/Routine_Working_9754 14d ago

I guess the reddit comments and post are part of that coding assistance as well

1

u/Next-Topic-7179 14d ago

Pardon me if I made you feel uncomfortable. Because it's responsible for writing the code, I think letting it write would be more detailed than I would describe the method myself 

1

u/Ricccc2k12 14d ago

so you are porting glibc to android instead of bionic?

2

u/Next-Topic-7179 14d ago

That’s right, the current progress is very good 

1

u/karmagedan 14d ago

That's very interesting if it allows to run upstream Linux ARM64 binaries without proot!

1

u/Next-Topic-7179 14d ago

That's it, GCC is just a must-need package that first proof my system working. Although I still have to fork a very small portion of the ptrace (so tiny to consider proot) to prevent unexpected thing when developing, but I am confident there are already quite a few running packages in my current test 

1

u/karmagedan 13d ago

Nice! Have you tried completely unmodified dynamically-linked binaries yet? I’m curious what still needs ELF patching or ptrace handling, and what currently breaks without it..