apkenv icon indicating copy to clipboard operation
apkenv copied to clipboard

Compilation fails on RPi 3

Open HelloOO7 opened this issue 7 years ago • 11 comments

In case this is still alive, the compilation fails on the RPi 3, similar to this issue with:

In file included from compat/gles2_wrappers.c:4:0:
/opt/vc/include/GLES2/gl2.h:49:26: error: two or more data types in declaration specifiers
/opt/vc/include/GLES2/gl2.h:49:1: warning: useless type name in empty declaration [enabled by default]

If I use @krnlyng 's RPi2 branch, the compilation gets almost finished, failing at:

libEGL.so undefined reference to "XCreateImage"

and 4 other similar libEGL errors just with different references.

HelloOO7 avatar Jul 20 '18 14:07 HelloOO7

Did you try linking against the X11 libs? -lX11 -lXext

thp avatar Jul 27 '18 12:07 thp

Also, I wonder if we can get a pull request for @krnlyng's RPi2 branch?

thp avatar Jul 27 '18 12:07 thp

Yep, I linked -lX11 and the compilation was succesful. The problem is that I still can't pretty much run anything. First of all, I tried Portal, but I kinda figured out that probably wasn't gonna work, so I tried a really old version of Fruit Ninja (from ~2014 I think - 1.8.6), and that didn't do anything too.

All of the basic bionic libraries (m, c, stdc++) cannot link because of: cannot locate '__cxa_finalize'

Then it stops. (BTW Portal segfaults)

HelloOO7 avatar Jul 27 '18 13:07 HelloOO7

Maybe this helps? https://wiki.maemo.org/Apkenv/Game_Compatibility

thp avatar Jul 27 '18 13:07 thp

V. 1.5.4, which should work according to the wiki does the same (+can't find sqrt in libm.so). Though I'm using bionic libs from Oreo, I'll try the old ones too.

Edit: The CM7 libs "cannot map lib*.so, will try general pool", JVM error 12. https://confluence.atlassian.com/bitbucketserverkb/forking-jvm-error-12-cannot-allocate-memory-or-error-12-not-enough-space-779171744.html this doesn't help

HelloOO7 avatar Jul 27 '18 13:07 HelloOO7

@helloOO7 as far as i remember apkenv uses a linker from android 4. android 5 base libraries might still work with it, but libraries from android 6 and above have changed a lot and sometimes depend on extra functionality from the linker, like packed relocations, or custom callbacks in android libdl for namespaces and other things. also last time i checked many applications shipped custom versions of libgui and other android libraries which need further handling. i think your best bet are android libraries from cm10.1 or cm11 or maybe cm12. i would start by getting one of the supported games to work to understand what things do and then add support for the apps you want to run gradually.

@thp i don't remember if that branch was fully working, i only have a beaglebone black and the branch was experimental. but i will look into it :)

krnlyng avatar Jul 27 '18 17:07 krnlyng

@krnlyng

Libs from Lollipop crash with:

unimplemented but required: pthread_gettid_np

Haven't been able to find any version of 4.x for RPi3 nor 2, do you happen to know one?

By the way, your RPi2 branch works just fine compilation and general "running" - wise on the RPi 3. The only problem was that you need to link against -lX11 in rpi2.mk platform file. The Bionic libraries included there are obsolete 2.3 ones though and show the errors mentioned in my previous comment.

Edit: Do you happen to have an app that works on your beaglebone that I could check if it works on my end? Because if it does, then it's probably apkenv's problem, which would be much harder to fix and I doubt anyone would want to do that, considering this was abandoned 2 years ago.

Edit 2: Shall we change the title for future reference?

HelloOO7 avatar Jul 27 '18 18:07 HelloOO7

@HelloOO7 Have you tried with the libs from harmattan?

https://github.com/thp/apkenv/tree/master/libs/harmattan

thp avatar Jul 31 '18 16:07 thp

@thp Yep, tried them and it definitely looks more promising.

https://pastebin.com/mNEPzn1u

(log)

It just hangs from there, but it's definitely progress!

HelloOO7 avatar Jul 31 '18 17:07 HelloOO7

Do you have the $DISPLAY variable set and/or X11 started or is it just running on the framebuffer device? Not sure how the RPi port is set up, but that might be something to look out for.

Also, maybe attach gdb (or run in gdb and then break) and see where it hangs and/or build with make DEBUG=1 to get some more debug output.

thp avatar Jul 31 '18 17:07 thp

Nice, debug mode shows some more useful info. Looks like apkenv is running just fine (the terminal is full of constantly updated lines like:

gl*****() gl()

etc.

It seems that the only problem here is that an X11 windows isn't showing up. Any idea?

HelloOO7 avatar Jul 31 '18 19:07 HelloOO7

@HelloOO7 Is this still an issue? Have you updated to a newer version of Raspbian OS? Has this fixed the issue?

thp avatar Dec 19 '22 15:12 thp

It's been a while since I tested this and I'm kind of in a holiday rush at the moment, but I'll dig out my Pi3 when I get the time and give you an update.

HelloOO7 avatar Dec 22 '22 10:12 HelloOO7

I have tested the current Git master branch on an RPi3 with Raspbian GNU/Linux 11 (bullseye). Instructions are in README.raspberrypi, you can build it using make PLATFORM=rpi3. This might not necessarily be accelerated using VideoCore libs, but the standard (Mesa?) libs seem to work well enough for me.

Edit: Forgot to mention, it's the 32-bit version of Raspbian OS (although the 64-bit version should still support 32-bit userland, as the CPU definitely still supports it, but it's untested and YMMV).

thp avatar Feb 01 '23 21:02 thp