ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
704 stars 159 forks source link

Hidden symbol referenced by DSO #473

Open raziel- opened 1 month ago

raziel- commented 1 month ago

Hi ptitseb,

sorry for stealing your time, maybe (most surely) i'm completely wrong here anyways...

According to this article: https://stackoverflow.com/questions/23696585/what-does-exactly-the-warning-mean-about-hidden-symbol-being-referenced-by-dso

a global symbol that is hidden from DSO usage will lead to a linker error. Which is exactly what i'm getting when trying to link an SDL2 app with libSDL2_gl4es.so

LINK scummvm Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: scummvm: hidden symbol `aglSetParams2' in /SDK/local/newlib/lib/libgl4es.a(agl.c.obj) is referenced by DSO Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: final link failed: Bad value gmake: *** [scummvm] Error 1

I did an objdump of libgl4es.a and found the exact same case as in the article.

aglsSetParams2 is inside the list two times, where the first one is unknown by me, but the second one is exactly what the article described

00000000 UND 00000000 aglSetParams2

00000634 g F .text 00000064 .hidden aglSetParams2

It's marked as global (g) and as thus seen by the linker, but hidden (.hidden) for shared usage, iiuc) and what i understand from that article that shouldn't be the case?

Now my question...is this intended to be hidden? Is it a problem of the main (this tree) library or do i have to "fix" it in the AmigaOS4 target of libgl4es.a?

Thanks you very much

ptitSeb commented 1 month ago

those symbol (like most of OpenGL symbols) are supposed to be dynamic and fetched using aglGetProcAddress("glSetParams2") for example.

This is the regular way to use OpenGL. Only 1.x API is exposed directly, all the other API is optionnal and so behind a "GetProcAddress" function (like glXGetProcAddress on Linux/X11, wglGetProcAddress on Windows or aglGetProcAddress on Amiga).

raziel- commented 1 month ago

Thank you for the quick answer.

so, the problem lies on my platforms way of getting the process? sorry, noob here

ptitSeb commented 1 month ago

Yeah, you should ask for help on some AmigaOS board, I don't own an Amiga myself.

raziel- commented 1 month ago

thank you very much