Closed Cebion closed 10 months ago
To get to the ground of this issue I tried to get back to the most simple examples.
For testing I used this simple SDL2 + GLES file
#include <SDL2/SDL.h>
// if we're compiling for iOS (iPhone/iPad)
#ifdef __IPHONEOS__
# include <SDL2/SDL_opengles.h> // we want to use OpenGL ES
#else
# include <SDL2/SDL_opengl.h> // otherwise we want to use OpenGL
#endif
int main(int argc, char * argv[])
{
// Initialize SDL with video
SDL_Init(SDL_INIT_VIDEO);
// Create an SDL window
SDL_Window* window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL);
// if failed to create a window
if(!window)
{
// we'll print an error message and exit
std::cerr << "Error failed to create window!\n";
return 1;
}
// Create an OpenGL context (so we can use OpenGL functions)
SDL_GLContext context = SDL_GL_CreateContext(window);
// if we failed to create a context
if(!context)
{
// we'll print out an error message and exit
std::cerr << "Error failed to create a context\n!";
return 2;
}
SDL_Event event; // used to store any events from the OS
bool running = true; // used to determine if we're running the game
glClearColor(1, 0, 0, 1);
while(running)
{
// poll for events from SDL
while(SDL_PollEvent(&event))
{
// determine if the user still wants to have the window open
// (this basically checks if the user has pressed 'X')
running = event.type != SDL_QUIT;
}
glClear(GL_COLOR_BUFFER_BIT);
// Swap OpenGL buffers
SDL_GL_SwapWindow(window);
}
// Destroy the context
SDL_GL_DeleteContext(context);
// Destroy the window
SDL_DestroyWindow(window);
// And quit SDL
SDL_Quit();
return 0;
}
I compiled it first in my aarch64 chroot and then tested it on my device. Example works fine and displays a red square. To prepare I compiled the newest box64 commit with -DARM64=ON and -DARM_DYNAREC=ON
Exports for ld_library is set
export BOX64_LD_LIBRARY_PATH="$GAMEDIR/box64/x64":"$GAMEDIR/box64/native":"$GAMEDIR/libs/x64"```
For some reason it fails to load the libGLESv2.so.2
```./Box64.sh
No sudo present.
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 PageSize:4096 Running on Cortex-A35 with 4 Cores
Params database has 14 entries
BOX64: Didn't detect 48bits of address space, considering it's 39bits
Counted 24 Env var
BOX64 LIB PATH: /roms/ports/box64/box64/native/:/usr/lib/:/usr/lib/aarch64-linux-gnu/:/roms/ports/box64/libs/:/usr/lib/:/usr/lib/pulseaudio/:/usr/lib32/:/roms/ports/box64/box64/x64/:/roms/ports/box64/box64/native/:/roms/ports/box64/libs/x64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/usr/bin/:/usr/sbin/:/usr/local/bin/:/usr/bin/:/storage/bin/
Looking for ./sdl_x64
Rename process to "sdl_x64"
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) librt.so.1
Using native(wrapped) libpthread.so.0
Error loading needed lib libGLESv2.so.2
Using emulated /roms/ports/box64/box64/x64/libstdc++.so.6
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libbsd.so.0
Error loading one of needed lib
Error: Loading needed libs in elf /storage/roms/ports/box64/sdl_x64```
If it saying Error loading needed lib libGLESv2.so.2 does it want to load the x64 lib of libGLESv2.so.2?
Out of curiosity I tried to do the same test on box86
No sudo present.
Shows details of dlopen / dlsym /dlclose : Yes
BOX86 using "/roms/ports/box86/box86/native/libGL.so.1" as libGL.so.1
Show Segfault signal even if a signal handler is present
Show Backtrace for signals
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA AES PMULL PageSize:4096 Running on Cortex-A35 with 4 Cores
BOX86_LD_LIBRARY_PATH: /roms/ports/box86/box86/x86/:/roms/ports/box86/box86/native/:/roms/ports/box86/libs/x86/
Using default BOX86_PATH: ./:bin/
Counted 23 Env var
Looking for sdl2test_86
Rename process to "sdl2test_86"
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using native(wrapped) libm.so.6
Error loading needed lib libGLESv2.so.2
Using emulated /roms/ports/box86/box86/x86/libstdc++.so.6
Error loading one of needed lib
Error: loading needed libs in elf /storage/roms/ports/box86/sdl2test_86```
It seems also box86 has the same issue loading the libmali libGLESv2.so.2 library.
If I load gl4es and point with SDL_VIDEO_GL_DRIVER=libGL.so.1 gl4es picks up the gles library and thus box86 has its library.
TLDR, box86 and box64 fail to find the native libGLESv2.so.2 library without using gl4es.
Not sure if connected to the main issue but may be a problem nonetheless.
Did some additional tests with LD_DEBUG=libs
It lists all search paths for the other libs just fine but never even attempts to load libgles2.v2
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 PageSize:4096 2856: find library=libtinfo.so.6 [0]; searching
2856: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2856: trying file=/roms/ports/box64/box64/native/libtinfo.so.6
2856: search path=/usr/lib (system search path)
2856: trying file=/usr/lib/libtinfo.so.6
2856:
2856: find library=libc.so.6 [0]; searching
2856: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2856: trying file=/roms/ports/box64/box64/native/libc.so.6
2856: search path=/usr/lib (system search path)
2856: trying file=/usr/lib/libc.so.6
2856:
2856:
2856: calling init: /lib/ld-linux-aarch64.so.1
2856:
2856:
2856: calling init: /usr/lib/libc.so.6
2856:
2856:
2856: calling init: /usr/lib/libtinfo.so.6
2856:
2856:
2856: initialize program: sh
2856:
2856:
2856: transferring control: sh
2856:
2859: find library=libm.so.6 [0]; searching
2859: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2859: trying file=/roms/ports/box64/box64/native/libm.so.6
2859: search path=/usr/lib (system search path)
2859: trying file=/usr/lib/libm.so.6
2859:
2859: find library=libc.so.6 [0]; searching
2859: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2859: trying file=/roms/ports/box64/box64/native/libc.so.6
2859: search path=/usr/lib (system search path)
2859: trying file=/usr/lib/libc.so.6
2859:
2859:
2859: calling init: /lib/ld-linux-aarch64.so.1
2859:
2859:
2859: calling init: /usr/lib/libc.so.6
2859:
2859:
2859: calling init: /usr/lib/libm.so.6
2859:
2859:
2859: initialize program: sed
2859:
2859:
2859: transferring control: sed
2859:
2858: find library=libc.so.6 [0]; searching
2858: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2858: trying file=/roms/ports/box64/box64/native/libc.so.6
2858: search path=/usr/lib (system search path)
2858: trying file=/usr/lib/libc.so.6
2858:
2857: find library=libsmartcols.so.1 [0]; searching
2857: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2857: trying file=/roms/ports/box64/box64/native/libsmartcols.so.1
2857: search path=/usr/lib (system search path)
2857: trying file=/usr/lib/libsmartcols.so.1
2857:
2857: find library=libc.so.6 [0]; searching
2857: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2857: trying file=/roms/ports/box64/box64/native/libc.so.6
2857: search path=/usr/lib (system search path)
2857: trying file=/usr/lib/libc.so.6
2857:
2858:
2858: calling init: /lib/ld-linux-aarch64.so.1
2858:
2858:
2858: calling init: /usr/lib/libc.so.6
2858:
2858:
2858: initialize program: grep
2858:
2858:
2858: transferring control: grep
2858:
2857:
2857: calling init: /lib/ld-linux-aarch64.so.1
2857:
2857:
2857: calling init: /usr/lib/libc.so.6
2857:
2857:
2857: calling init: /usr/lib/libsmartcols.so.1
2857:
2857:
2857: initialize program: lscpu
2857:
2857:
2857: transferring control: lscpu
2857:
2857:
2857: calling fini: [0]
2857:
2857:
2857: calling fini: /usr/lib/libsmartcols.so.1 [0]
2857:
2857:
2857: calling fini: /usr/lib/libc.so.6 [0]
2857:
2857:
2857: calling fini: /lib/ld-linux-aarch64.so.1 [0]
2857:
2859:
2859: calling fini: [0]
2859:
2859:
2859: calling fini: /usr/lib/libm.so.6 [0]
2859:
2859:
2859: calling fini: /usr/lib/libc.so.6 [0]
2859:
2859:
2859: calling fini: /lib/ld-linux-aarch64.so.1 [0]
2859:
2856:
2856: calling fini: [0]
2856:
2856:
2856: calling fini: /usr/lib/libtinfo.so.6 [0]
2856:
2856:
2856: calling fini: /usr/lib/libc.so.6 [0]
2856:
2856:
2856: calling fini: /lib/ld-linux-aarch64.so.1 [0]
2856:
Running on Cortex-A35 with 4 Cores
Params database has 14 entries
BOX64: Didn't detect 48bits of address space, considering it's 39bits
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: _pthread_cleanup_push_defer (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: _pthread_cleanup_pop_restore (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.0 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.1 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.2 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.3 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.4 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.5 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.6 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.7 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.8 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.9 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.10 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.11 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.12 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.13 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.14 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.15 (fatal)
2854: /roms/ports/box64/box64/box64: error: symbol lookup error: undefined symbol: pthread_kill, version GLIBC_2.16 (fatal)
Counted 25 Env var
BOX64 LIB PATH: /roms/ports/box64/box64/native/:/usr/lib/:/usr/lib/aarch64-linux-gnu/:/roms/ports/box64/libs/:/usr/lib/:/usr/lib/pulseaudio/:/usr/lib32/:/roms/ports/box64/box64/x64/:/roms/ports/box64/box64/native/:/roms/ports/box64/libs/x64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/usr/bin/:/usr/sbin/:/usr/local/bin/:/usr/bin/:/storage/bin/
Looking for ./sdl2_test64
Rename process to "sdl2_test64"
2854: find library=libSDL2-2.0.so.0 [0]; searching
2854: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2854: trying file=/roms/ports/box64/box64/native/libSDL2-2.0.so.0
2854: search path=/usr/lib (system search path)
2854: trying file=/usr/lib/libSDL2-2.0.so.0
2854:
2854: find library=libasound.so.2 [0]; searching
2854: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2854: trying file=/roms/ports/box64/box64/native/libasound.so.2
2854: search path=/usr/lib (system search path)
2854: trying file=/usr/lib/libasound.so.2
2854:
2854:
2854: calling init: /usr/lib/libasound.so.2
2854:
2854:
2854: calling init: /usr/lib/libSDL2-2.0.so.0
2854:
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickNintendoSwitchPro (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickPS4 (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickSteamController (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickXbox360 (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickXboxOne (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickHIDAPI (fatal)
2854: /usr/lib/libSDL2-2.0.so.0: error: symbol lookup error: undefined symbol: SDL_IsJoystickXInput (fatal)
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) librt.so.1
Using native(wrapped) libpthread.so.0
Error loading needed lib libGLESv2.so.2
Using emulated /roms/ports/box64/box64/x64/libstdc++.so.6
2854: ./sdl2_test64: error: symbol lookup error: undefined symbol: _ITM_addUserCommitAction (fatal)
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
2854: find library=libutil.so.1 [0]; searching
2854: search path=/roms/ports/box64/box64/native (LD_LIBRARY_PATH)
2854: trying file=/roms/ports/box64/box64/native/libutil.so.1
2854: search path=/usr/lib (system search path)
2854: trying file=/usr/lib/libutil.so.1
2854:
2854:
2854: calling init: /usr/lib/libutil.so.1
2854:
Using native(wrapped) libutil.so.1
Using native(wrapped) libbsd.so.0
Error loading one of needed lib
Error: Loading needed libs in elf /storage/roms/ports/box64/sdl2_test64
Okay so we only have wrappers for libGL and libGLX and not libGLESv2. Makes sense that it would not work and most desktop apps don't use libGLESv2 directly. I will try with opengl2 apps in combination with gl4es.
Hey ptitseb!
I'm testing box64 on my rk3326 chipset on AmberELEC after good results i had with box86. I previously did some tests with box64 on world of goo where both the i386 aswell as the amd64 binaries were present. But could not get it to run then. Now i tried this one. Maybe you have an idea what's going on.
Box64 and gl4es built from latest commit.
GL4ES via -DNOX11=ON -DGLX_STUBS=ON -DEGL_WRAPPER=ON -DGBM=ON Box64 via -DARM64=ON -DARM_DYNAREC=ON
Game run via
LDD of the binary
Log:
And log without any libGL.so.1 On the rk3326 we don't have opengl everywhere so only opengles up to 3