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

Build issues for NG on Arm #457

Closed
hissingshark opened this issue Feb 3, 2021 · 5 comments
Closed

Build issues for NG on Arm #457

hissingshark opened this issue Feb 3, 2021 · 5 comments

Comments

@hissingshark
Copy link

hissingshark commented Feb 3, 2021

Hi, I tried this great application using a ChristopherHX produced AppImage on my Linux Mint desktop.

Impressed I began trying to get it working on my daily gaming box, which is an Arm S905x. It's essentially an Odroid-C2, with Mali EGL/GLESv2 support. The main hurdle - the application is X11 based, where my system is not and runs directly in framebuffer.

I did briefly get an experimental X11/Xfce desktop working to test. The Qt based frontend worked and downloaded the apk from the Play Store, but the game could not launch due to graphics issues. I built from the ChristopherHX source, natively on my board, but that didn't help with any video detection etc.

I would rather cut out the X11 overhead anyway... So I've opted to try and provide framebuffer support for the video, and SDL2 support for the input. I'm working from the NG source as this seems to be the recommended project.

I've compiled Qt for my platform to add the EGLFS_Mali plugin support. That allowed the Qt-UI to work without X11, but it froze after a bit. No Matter - I'll come back to that. Priority is the client.

First cmake issues with mcpelauncher-manifest were with new dependancies. Installed those.

I tried to still follow the advice about:

cd mcpelauncher-linux-bin
git checkout armhf
cd ..
cd minecraft-symbols/tools
python3 process_headers.py --armhf
cd ..

However that folder isn't created after the checkout, so there's no script to run...

I also found it insisted on building with CLang, which I've never used before so I installed that.
So now I configure with:
CC=clang CXX=clang++ cmake ..

This yields

-- Configuring done                                                                                                                                                                                                                                                                           
CMake Warning (dev) in mcpelauncher-errorwindow/CMakeLists.txt:                                                                                                                                                                                                                               
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.                                                                                                                                                                                                                 
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy                                                                                                                                                                                                                 
  command to set the policy and suppress this warning.                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                              
  For compatibility, CMake is excluding the GENERATED source file(s):                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                              
    "/home/osmc/mcpelauncher-manifest/build/mcpelauncher-errorwindow/src_qml_main_qml.cpp"                                                                                                                                                                                                    
    "/home/osmc/mcpelauncher-manifest/build/mcpelauncher-errorwindow/qmlcache_loader.cpp"                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                              
  from processing by AUTOMOC and AUTOUIC.  If any of the files should be                                                                                                                                                                                                                      
  processed, set CMP0071 to NEW.  If any of the files should not be                                                                                                                                                                                                                           
  processed, explicitly exclude them by setting the source file property                                                                                                                                                                                                                      
  SKIP_AUTOGEN:                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                              
    set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                              
This warning is for project developers.  Use -Wno-dev to suppress it.                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                              
-- Generating done                                                                                                                                                                                                                                                                            
-- Build files have been written to: /home/osmc/mcpelauncher-manifest/build  

Running make I fail with:

[ 21%] Building CXX object mcpelauncher-linker/CMakeFiles/linker.dir/bionic/linker/arch/arm_neon/linker_gnu_hash_neon.cpp.o
In file included from /home/osmc/mcpelauncher-manifest/mcpelauncher-linker/bionic/linker/arch/arm_neon/linker_gnu_hash_neon.cpp:39:                                                                                                                                                           
/usr/include/clang/7.0.1/include/arm_neon.h:28:2: error: "NEON support not enabled"
#error "NEON support not enabled"                                                                                                                                                                                                                                                             
 ^
/usr/include/clang/7.0.1/include/arm_neon.h:48:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t;                                                                                                                                                                                                                                 
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:49:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(16))) int8_t int8x16_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:50:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(4))) int16_t int16x4_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:51:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(8))) int16_t int16x8_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:52:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(2))) int32_t int32x2_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:53:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(4))) int32_t int32x4_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:54:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(1))) int64_t int64x1_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:55:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(2))) int64_t int64x2_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:56:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(8))) uint8_t uint8x8_t;                                                                                                                                                                                                                               
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:57:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(16))) uint8_t uint8x16_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:58:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(4))) uint16_t uint16x4_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:59:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:60:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(2))) uint32_t uint32x2_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:61:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(4))) uint32_t uint32x4_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:62:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:63:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t;                                                                                                                                                                                                                             
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:64:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t;                                                                                                                                                                                                                           
                       ^
/usr/include/clang/7.0.1/include/arm_neon.h:65:24: error: 'neon_vector_type' attribute is not supported for this target                                                                                                                                                                       
typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;                                                                                                                                                                                                                           
                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]                                                                                                                                                                                                                           
20 errors generated.                                                                                                                                                                                                                                                                          
make[2]: *** [mcpelauncher-linker/CMakeFiles/linker.dir/build.make:531: mcpelauncher-linker/CMakeFiles/linker.dir/bionic/linker/arch/arm_neon/linker_gnu_hash_neon.cpp.o] Error 1                                                                                                             
make[1]: *** [CMakeFiles/Makefile2:527: mcpelauncher-linker/CMakeFiles/linker.dir/all] Error 2                                                                                                                                                                                                
make: *** [Makefile:141: all] Error 2        

Any advice would be greatly appreciated.

Many thanks in advance.

@ChristopherHX
Copy link
Member

You mean armv7 32bit?

You need to enable neon support, your cpu needs also neon.
Not all arm32 cpus have neon therefore disabled by default. Android armv7 requires neon (or changes to mcpelauncher-linker).

CFLAGS="-march=armv7 -mfpu=neon" CXXFLAGS="-march=armv7 -mfpu=neon" CC=clang CXX=clang++ cmake ..

SRC: https://github.com/ChristopherHX/Buildbot/blob/16ea97ad8892ac9e88492089a0513c8c5662cd57/.github/workflows/manual.yml#L358

Minecraft Symbols and the script were removed, you saw it

@hissingshark
Copy link
Author

Many thanks for getting back to me.
Yes it's armv7/32bit with neon. That progressed the build nicely.

Should I be building with the Fake-JNI? That is the default and I ran into build issues. I was working through them, mostly by adding -lpthread and -lffi to the offending CMakeLists, as the errors were about undefined references. I can pursue that if the Fake-JNI is required or recommended.

Building went fine if I disabled it with -DJNI_USE_JNIVM=ON.
However the successful builds crash at startup.

Minecraft Symbols and the script were removed, you saw it

Should I still be checking out the armhf branch though? If I do then the client crashes with:

./mcpelauncher-client -dg ~/.local/share/mcpelauncher/versions/1.16.201.01/

09:50:54 Info  [Launcher] Version: client 2a16784 / manifest 592d02d
09:50:54 Trace [Launcher] Loading hybris libraries
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to find data file: lib/armeabi-v7a/libc.so
Signal 6 received
Backtrace elements: 3
#0 ./mcpelauncher-client(_ZN12CrashHandler12handleSignalEiPv+0xf0) [0x804e04]
#1 /lib/arm-linux-gnueabihf/libc.so.6(+0x25ca0) [0xf6b5eca0]
#2 /lib/arm-linux-gnueabihf/libc.so.6(+0x17746) [0xf6b50746]
Dumping stack...
Aborted

With the master branch:

 ./mcpelauncher-client -dg ~/.local/share/mcpelauncher/versions/1.16.201.01/
09:49:47 Info  [Launcher] Version: client 2a16784 / manifest 592d02d
09:49:47 Trace [Launcher] Loading hybris libraries
09:49:47 Trace [HybrisUtils] Loaded OS library libz.so.1
09:49:47 Warn  [FMOD] Failed to load host libfmod: 'Failed to find data file: lib/native/armeabi-v7a/libfmod.so.10.20', use experimental pulseaudio backend if available
load_library: Undefined symbol glMultMatrixf
load_library: Undefined symbol glFogfv
load_library: Undefined symbol glClearColor
load_library: Undefined symbol glClear
load_library: Undefined symbol glFlush
^^^
   There were loads of these

09:49:47 Trace [Launcher] Loading Minecraft library
09:49:51 Info  [Launcher] Loaded Minecraft library
09:49:51 Debug [Launcher] Minecraft is at offset 0x0xe78c0000
09:49:51 Info  [Launcher] Game version: 0.0.0.0
09:49:51 Info  [Launcher] Applying patches
09:49:51 Info  [Launcher] Initializing JNI
09:49:51 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeRegisterThis
09:49:51 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeUnregisterThis
09:49:51 Info  [Launcher] Executing main thread
09:49:51 Trace [JniSupport] Invoking nativeRegisterThis
09:49:51 Trace [JniSupport] Invoking ANativeActivity_onCreate
09:49:51 Warn  [Main] Android stub called
09:49:51 Warn  [Main] Android stub called
09:49:51 Warn  [Main] Android stub called
09:49:51 Warn  [Main] Android stub called
09:49:51 Info  [Launcher] Loading gamepad mappings
09:49:51 Trace [Launcher] Loading gamepad mappings: /home/osmc/mcpelauncher-manifest/build/gamecontrollerdb/gamecontrollerdb.txt
09:49:51 Info  [Launcher] Creating window

EGLUT_FB: Clearing the screen to Minecraft Sky Blue...
EGLUT_FB: 3 seconds are up!

09:49:57 Trace [JniSupport] Invoking start activity callbacks
09:49:57 Info  [Minecraft] android_main starting. internalDataPath is '/internal', externalDataPath is '/external'
09:49:57 Info  [Minecraft] NO LOG FILE! - AppPlatform_android::setStorageDirectory - using External dir - CurrentFileStoragePath is now '/home/osmc/.local/share/mcpelauncher/'
09:49:57 Warn  [Main] Android stub called
Signal 11 received
Backtrace elements: 2
#0 ./mcpelauncher-client(_ZN12CrashHandler12handleSignalEiPv+0xf0) [0x804e04]
#1 /lib/arm-linux-gnueabihf/libc.so.6(+0x25ca0) [0xf6f3bca0]
Dumping stack...
#28 HYBRIS (null)+0xec500143 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c40143 [0x0xec500143]
#38 HYBRIS (null)+0xefc45260 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8385260 [0x0xefc45260]
#43 HYBRIS (null)+(nil) in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x90ee414 [0x0xf09ae414]
#49 HYBRIS mce::Platform::OGL::GetProcAddress(char const*)+0x10 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x7419989 [0x0xeecd9989]
#55 HYBRIS (null)+0xefc45260 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8385260 [0x0xefc45260]
#58 HYBRIS (null)+0xefc45260 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8385260 [0x0xefc45260]
#178 HYBRIS (null)+(nil) in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x90eed44 [0x0xf09aed44]
#191 HYBRIS mce::Platform::OGL::InitBindings()+0xe in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x7417983 [0x0xeecd7983]
#193 HYBRIS (null)+0xec500129 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c40129 [0x0xec500129]
#225 HYBRIS (null)+0xf0860750 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa0750 [0x0xf0860750]
#230 HYBRIS (null)+0xf0860750 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa0750 [0x0xf0860750]
#233 HYBRIS (null)+0xec4fc473 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c3c473 [0x0xec4fc473]
#244 HYBRIS vtable for std::__ndk1::basic_ostringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >+0xc in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8be4d4c [0x0xf04a4d4c]
#245 HYBRIS vtable for std::__ndk1::basic_streambuf<char, std::__ndk1::char_traits<char> >+0x8 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8be22a4 [0x0xf04a22a4]
#246 HYBRIS (null)+0xe7749310 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libc++_shared.so+0x0x89310 [0x0xe7749310]
#258 HYBRIS vtable for std::__ndk1::ios_base+0x8 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libc++_shared.so+0x0x83694 [0x0xe7743694]
#265 HYBRIS (null)+0xe7749310 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libc++_shared.so+0x0x89310 [0x0xe7749310]
#284 HYBRIS (null)+0xf0860750 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa0750 [0x0xf0860750]
#287 HYBRIS (null)+0xec50542b in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c4542b [0x0xec50542b]
#295 HYBRIS (null)+0xf08606e0 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa06e0 [0x0xf08606e0]
#297 HYBRIS InitOnce::initOnce()+0x16 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x7640b7d [0x0xeef00b7d]
#299 HYBRIS (null)+0xf08606e0 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa06e0 [0x0xf08606e0]
#301 HYBRIS (null)+0x2a0 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c3b75d [0x0xec4fb75d]
#305 HYBRIS MainAndroid::Internal::JNIQueueToMainThreadTaskGroup+(nil) in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa0664 [0x0xf0860664]
#308 HYBRIS (null)+0xf0860750 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8fa0750 [0x0xf0860750]
#336 HYBRIS (null)+0xf04a5548 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x8be5548 [0x0xf04a5548]
#351 HYBRIS (null)+0xec50840f in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c4840f [0x0xec50840f]
#368 HYBRIS (null)+0xec508391 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c48391 [0x0xec508391]
#398 HYBRIS (null)+0xe78c0000 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x(nil) [0x0xe78c0000]
#399 HYBRIS (null)+0xe78c0000 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x(nil) [0x0xe78c0000]
#843 HYBRIS (null)+0xec5081c7 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c481c7 [0x0xec5081c7]
#844 HYBRIS (null)+0xec5081cf in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c481cf [0x0xec5081cf]
#845 HYBRIS (null)+0xec5081d7 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c481d7 [0x0xec5081d7]
#846 HYBRIS (null)+0xec508229 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c48229 [0x0xec508229]
#847 HYBRIS (null)+0xec508231 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c48231 [0x0xec508231]
#848 HYBRIS (null)+0xec50816d in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c4816d [0x0xec50816d]
#849 HYBRIS (null)+0xec505479 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c45479 [0x0xec505479]
#850 HYBRIS (null)+0xec508259 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c48259 [0x0xec508259]
#853 HYBRIS (null)+0xec50825f in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c4825f [0x0xec50825f]
#854 HYBRIS (null)+0xec508267 in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c48267 [0x0xec508267]
#855 HYBRIS (null)+0xec50826d in /home/osmc/.local/share/mcpelauncher/versions/1.16.201.01/lib/armeabi-v7a/libminecraftpe.so+0x0x4c4826d [0x0xec50826d]
Backtrace or dumping stack hung up, aborting

Note - the bit about EGLUT_FB is from my own changes which successfully used the fullscreen display and drawing context to clear the screen with:

fprintf(stderr, "EGLUT_FB: Clearing the screen to Minecraft Sky Blue...\n");
glClearColor(0.375, 0.5, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
eglSwapBuffers(_eglut->dpy, win->surface);
sleep(3);
fprintf(stderr, "EGLUT_FB: 3 seconds are up!\n");
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
eglSwapBuffers(_eglut->dpy, win->surface);

So not sure why all the "load_library: Undefined symbol" errors, considering 3 of them were used successfully above. That's something for me to debug.

Many Thanks

@ChristopherHX
Copy link
Member

Should I be building with the Fake-JNI?

Fake-JNI was required some month ago, but I made it optional. It was never my idea to use fake-jni.
I don't build fake-jni anymore, since I added fake-jni api emulation into my own jnivm. Yes I use -DJNI_USE_JNIVM=ON in all my prebuilds. I386 versions of 1.16.100 crashed with fake-jni while worked with my own jnivm. Additionally fake-jni seems to be unmaintained as of 2020.8.
All in all I ran only on macOS xcode 12+ into build issues with fake-jni/ffi, not on linux.
Ffi is a submodule of fake-jni.
Does your system ffi override the headers of the submodule?
Cmake should have added -lpthread during configure itself.

Should I still be checking out the armhf branch though? If I do then the client crashes with:

No, it was an annoying leftover of the old armhf version. I added new armhf compat directly to master.

load_library: Undefined symbol .. Some of them are needed others are optional.

...
About your last crash, I have no idea what exactly you have changed.

It seems your GetProcAddress returns or is a nullptr for a required function
Consider add a printf to get an idea what function might be missing.

I hope you didn't tried to return a nullptr while implementing this function
https://github.com/minecraft-linux/game-window/blob/ca1dcc207068018b63e21e8ad8609af07ebe26cc/include/game_window_manager.h#L26

E.g. for libEGL it have to return something like the pointer to eglGetProcAddr(const char*) which returning the specfic opengles function pointer.

eglGetProcAddr("glClearColor") == & glClearColor

@hissingshark
Copy link
Author

If Fake-JNI has no benefit then I'll leave that and go with the working build.

I hope you didn't tried to return a nullptr while implementing this function

LOL, no I worked out the importance of that.
I've done some separate tests of eglGetProcAddress and it is returning NULL for everything I've requested. I see here that

If the EGL version is not 1.5 or greater, only queries of EGL and client API extension functions will succeed.

My EGL version is 1.4. So I will require a workaround to return the function pointers to the game. I found a rough example here which uses dlsym. It puts me a bit off course but hopefully I'll get a loading game after that (or just move onto the next round of errors!).

@hissingshark
Copy link
Author

I've written a drop-in as above to allow linking to the GL functions and fixed a few build issues. The game now launches up to the "Microsoft Sign In" screen, complete with scrolling 3D cave background. So things are looking very good. I can go no further than that as I've yet to implement the input system...

First I'm going to move video to SDL2 rather than raw EGL as it will make blitting in a mouse pointer for the menus far easier. I was already going to be using it for mouse/keyboard/gamepad anyway, and it might make this more portable to other boards without X11.

Many thanks for the advice and keep up the good work.

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

No branches or pull requests

2 participants