WineBox86.apk icon indicating copy to clipboard operation
WineBox86.apk copied to clipboard

Compilation error

Open Hacker1245 opened this issue 3 years ago • 17 comments

When compiling on Ubuntu 20.10 I get this error

/home/kacper/WineBox86.apk/apk-builder/build/box86/src/elfs/elfloader.c:801:23: error: use of undeclared identifier 'STB_GNU_UNIQUE'
            if((bind==STB_GNU_UNIQUE /*|| (bind==STB_GLOBAL && type==STT_FUNC)*/) && FindGlobalSymbol(maplib, symname))
                      ^
/home/kacper/WineBox86.apk/apk-builder/build/box86/src/elfs/elfloader.c:826:23: error: use of undeclared identifier 'STB_GNU_UNIQUE'
            if((bind==STB_GNU_UNIQUE || (bind==STB_GLOBAL && type==STT_FUNC)) && FindGlobalSymbol(maplib, symname))
                      ^

Hacker1245 avatar May 21 '21 19:05 Hacker1245

Thanks for the issue! I can reproduce this. I'm not sure what caused this, but it's low-priority right now compared to figuring out how to get Box86 to work with the internal Android APIs the Wine port uses (libhardware, libandroid, etc).

io12 avatar May 21 '21 21:05 io12

Thanks for the issue! I can reproduce this. I'm not sure what caused this, but it's low-priority right now compared to figuring out how to get Box86 to work with the internal Android APIs the Wine port uses (libhardware, libandroid, etc).

Might be a stretch, but consider looking at the Halium project? https://halium.org/

Hacker1245 avatar Jun 13 '21 09:06 Hacker1245

Might be a stretch, but consider looking at the Halium project? https://halium.org/

This looks like another good approach. I think you can run Box86+Wine in a chroot on Android using something like Linux Deploy, but then you don't get hardware acceleration because the OpenGL implementation works only with the bionic linker, not the glibc linker. I tried for a bit to mount certain directories in a chroot like /system and use libhybris, but couldn't get it working really.

io12 avatar Jun 15 '21 18:06 io12

Might be a stretch, but consider looking at the Halium project? https://halium.org/

This looks like another good approach. I think you can run Box86+Wine in a chroot on Android using something like Linux Deploy, but then you don't get hardware acceleration because the OpenGL implementation works only with the bionic linker, not the glibc linker. I tried for a bit to mount certain directories in a chroot like /system and use libhybris, but couldn't get it working really.

https://github.com/RandomCoderOrg/gl4es-port for termux proot

abasgames avatar Sep 02 '21 18:09 abasgames

Might be a stretch, but consider looking at the Halium project? https://halium.org/

This looks like another good approach. I think you can run Box86+Wine in a chroot on Android using something like Linux Deploy, but then you don't get hardware acceleration because the OpenGL implementation works only with the bionic linker, not the glibc linker. I tried for a bit to mount certain directories in a chroot like /system and use libhybris, but couldn't get it working really.

https://github.com/RandomCoderOrg/gl4es-port for termux proot

It's just normal gl4es. It don't give you any acceleration.

I think that hallium chroot have higher chance for acceleration as userspace like this could be compatible with Android kernel as it could run blob drivers. Similar way as I'm running Zink on Turnip with KGSL (KGSL is proprietary way to load GPU driver on some Adreno devices, but it's supported by Mesa).

Heasterian avatar Sep 16 '21 17:09 Heasterian

gl4es acceleration still possible https://github.com/RandomCoderOrg/ubuntu-on-android

abasgames avatar Sep 26 '21 15:09 abasgames

This proot don't have GPU acceleration. GL4ES can have acceleration in proper environment but don't provide any on it's own.

Heasterian avatar Sep 27 '21 21:09 Heasterian

what about vmos and exagear virgl

abasgames avatar Sep 28 '21 15:09 abasgames

@io12 Taking all of the suggestions here into account, would it be possible to get a "ToDo List" for this project? So that developers could work towards a clear goal and contribute? Would this be a feasible approach?

DaniAsh551 avatar Oct 16 '21 14:10 DaniAsh551

I haven't been working on this recently, so it's possible things changed since I last checked, but the two main possible approaches are

  1. Make a GNU+Linux environment run inside Android (through a chroot or proot), run Box86 inside that, and somehow get GPU acceleration working (by using Android's built-in drivers through libhybris or some OpenGL forwarding server like virgil). This approach probably needs gl4es since I think Android only has drivers for OpenGL ES and not regular OpenGL. The upside to this approach is that Wine+Box86 is known to work well inside of ARM GNU+Linux. The downside is that getting GPU acceleration working is hard.
  2. Integrate Box86 with the Wine Android port. The upside of this is it can be easily packaged in an installable app and GPU acceleration probably works more easily. The downside is that Android Wine is basically unmaintained and newer versions don't work at all. If I remember correctly the setup screen keeps loading forever and the logs have an error. Since Wine doesn't use emulation, the idea is to embed Box86 in the x86 Wine Android port and change the metadata so Android thinks it's an ARM app. Unfortunately, the Wine Android port seems to rely on internal Android APIs that use lots of function pointers and structs, which makes writing Box86 wrappers for them hard.

This repo is a very early attempt at the second approach. I think the next steps would be to figure out why the newer versions of Android Wine are broken with git bisect, get the newer versions to work, and change it to not use internal Android APIs.

The process to build Android Wine isn't well documented, but the script they use to built it on their build server is here. It has lots of things hardcoded (like /home/winehq) so it probably needs to be modified to build Wine locally for git bisect.

I'm probably not going to spend lots of time on this in the future but good luck to anyone who tries.

io12 avatar Oct 17 '21 00:10 io12

@io12 Thanks for the overview. I have thought about this and I also came to the conclusion that the 2nd approach would probably be the better option of the two - albeit a bit more difficult maybe to implement on the first try.

But if it comes to that, maybe the first approach can yield some acceptable results (provided that we could get something like virgil working - I think a really early attempt at this approach is located here, if someone could get 3d acceleration with either libhybris or virgil or gl4es that is.

This would definitely be a fun project to try, with what little time and experience I have - but I doubt it.

Edit: Having said these, I still have a hunch that the first approach might prove to be a bit easier to maintain than the 2nd? As I think it would not require any maintenance on the linux->android wrappers for box86 (because there is not going to be any) - but during sometime in the future, virgl server for android might stop working - so it isn't going to be completely hassle-free. I am not sure though - if anyone has any opinions/ideas please do weigh in and share.

DaniAsh551 avatar Oct 17 '21 06:10 DaniAsh551

Any progress made ? It's still possible to have gpu acceleration in proot and i have it using turnip zink but you can still get it with gl4es in pbuffer mode

abasgames avatar Jul 19 '22 09:07 abasgames

Is there a guide anywhere on how to set up turnip and zink?

io12 avatar Aug 04 '22 02:08 io12

Is there a guide anywhere on how to set up turnip and zink?

https://i.reddit.com/r/termux/comments/p7i5kg/world_of_warcraft_wrath_of_the_lich_king_with/

abasgames avatar Aug 05 '22 13:08 abasgames

Is there a guide anywhere on how to set up turnip and zink?

Check this out: https://ivonblog.com/en-us/posts/termux-compile-mesa-driver

DaniAsh551 avatar Aug 25 '22 16:08 DaniAsh551

I haven't been working on this recently, so it's possible things changed since I last checked, but the two main possible approaches are

1. Make a GNU+Linux environment run inside Android (through a chroot or proot), run Box86 inside that, and somehow get GPU acceleration working (by using Android's built-in drivers through libhybris or some OpenGL forwarding server like [virgil](https://virgil3d.github.io/)). This approach probably needs [gl4es](https://github.com/ptitSeb/gl4es) since I think Android only has drivers for OpenGL ES and not regular OpenGL. The upside to this approach is that Wine+Box86 is known to work well inside of ARM GNU+Linux. The downside is that getting GPU acceleration working is hard.

2. Integrate Box86 with the [Wine Android port](https://dl.winehq.org/wine-builds/android/). The upside of this is it can be easily packaged in an installable app and GPU acceleration probably works more easily. The downside is that Android Wine is basically unmaintained and newer versions don't work at all. If I remember correctly the setup screen keeps loading forever and the logs have an error. Since Wine doesn't use emulation, the idea is to embed Box86 in the x86 Wine Android port and change the metadata so Android thinks it's an ARM app. Unfortunately, the Wine Android port seems to rely on internal Android APIs that use lots of function pointers and structs, which makes writing Box86 wrappers for them hard.

This repo is a very early attempt at the second approach. I think the next steps would be to figure out why the newer versions of Android Wine are broken with git bisect, get the newer versions to work, and change it to not use internal Android APIs.

The process to build Android Wine isn't well documented, but the script they use to built it on their build server is here. It has lots of things hardcoded (like /home/winehq) so it probably needs to be modified to build Wine locally for git bisect.

I'm probably not going to spend lots of time on this in the future but good luck to anyone who tries.

second approach sounds pretty similar to hangover. they had Android support before, but removed it after 0.4. maybe it can be a reference?

https://github.com/AndreRH/hangover/issues/113

rhjdvsgsgks avatar Oct 14 '22 01:10 rhjdvsgsgks

there also a project between approach 1 and 2 , maybe another reference? https://github.com/AllPlatform/Box86Launcher

ps: if you are looking for hardware acceleration things for Android. there is a project used to play Minecraft java version on Android. which include a lot solution of having opengl hardware acceleration on Android. https://github.com/PojavLauncherTeam/PojavLauncher

rhjdvsgsgks avatar Oct 14 '22 01:10 rhjdvsgsgks