ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.31k stars 227 forks source link

Support for uclibc-ng/musl libc ? #762

Open gameblabla opened 1 year ago

gameblabla commented 1 year ago

I wanted to compile box86 just for fun to see if it's interpreter would work on MIPS32r2. However, i noticed that it seemingly makes assumptions about glibc as stuff like dlvsym, __chk_fail, backtrace, among others (csqrtf, clogf)... are not available in uclibc-ng. I noticed that there's a port of Android in there but i have no idea if it even works.

I sort of made an attempt to hack it for OpenDingux here : https://github.com/gameblabla/box86/tree/opendingux But obviously, there's still the undefined functions as mentioned above.

ptitSeb commented 1 year ago

The point of box86 is to emulate a linux x86 environement, that's why it assume the underlying system is a linux glibc yes.

Those missing function needs some "stub" if your libc doesn't have them, because running program might use them.

(well, the complex function are not often used, so maybe you can live without them)

Also, without a dynarec, donc expect too much of this...

Richard-Rogalski commented 1 year ago

Just curious, how much work would it take to have box86/64, to be built with musl on a little-endian host, to run x86/64 programs linked to glibc? If it's just fixing the build issues, I could try to whip up a PR

ptitSeb commented 1 year ago

It would need to fix build (should not be too complex), but also write all glibc function that don't exist in musl (probably more work). But that 2nd point could be done be increment, on a need-by-need basis.

Richard-Rogalski commented 1 year ago

Alright.. I'll see if I can get it to build then :)