[Mesa-dev] Scons/GLES: shared_glapi and osmesa link failure

Jose Fonseca jfonseca at vmware.com
Thu Oct 18 21:33:17 UTC 2018


I still can't make much sense of that github issue thread.

Applications on Windows use opengl32.dll for acceleration, not 
libEGL/libGLESv1/libGLESv2 as these are not provided by the OS.  The 
only place you see these DLLs are things like GLES -> D3D11/GL 
translators like Angle.

So the "missing glapi.dll" is a red herring IMO: the solution is not to 
somehow the build the glapi.dll but rather build mesa so it's never 
needed.  Which is what scons does by default.

What Meson does or not by default I don't know.  It might provide all 
those DLLs, but that doesn't change the fact that windows applications 
will target opengl32.dll for accelleration.


Jose

On 18/10/18 15:46, Liviu Prodea wrote:
> Well, all this started in that Github issue thread. That guy @elkhalafy 
> was using llvmpipe to get Blender 2.80 to work on his system with 
> unsupported (too old) iGPU. I don't know what he did but it resulted in 
> Blender failing with missing libglapi.dll. So I researched about how to 
> build it and it led me to this build variable gles of type boolean. When 
> set to true it builds glapi as a shared library named libglapi.dll. It 
> is also a requirement to build libGLESv1_CM.dll and libGLESv2.dll which 
> only get build when selecting all build targets or probably I wasn't 
> able to find the right target(s).
> 
> A Meson build approximation is -Dgles1=true -Dgles2=true which builds 
> all 3 DLLs and it is default unlike in Scons case,
> 
> On Thursday, October 18, 2018, 3:08:11 PM GMT+3, Jose Fonseca 
> <jfonseca at vmware.com> wrote:
> 
> 
> I don't know what gles=y entails anymore, but if it's broken we should
> simply remove it.
> 
> That said, our WGL GLES contexts, via WGL_EXT_create_context_es2_profile
> extension, even without gles=y option.
> 
> So what exactly are you looking for here?
> 
> Jose
> 
> On 18/10/18 13:02, Liviu Prodea wrote:
>  > scons build=release platform=windows machine=x86 gles=y libgl-gdi osmesa
>  >
>  > Creating library build\windows-x86\mesa\drivers\osmesa\osmesa.lib and
>  > object build\windows-x86\mesa\drivers\osmesa\osmesa.exp
>  > osmesa.obj : error LNK2001: unresolved external symbol
>  > __imp___glapi_check_multithread
>  > osmesa.obj : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_proc_address
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_set_context
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_set_dispatch
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_set_nop_handler
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_new_nop_table
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_Context
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_dispatch_table_size
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_context
>  > mesa.lib(remap.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_add_dispatch
>  > mesa.lib(api_loopback.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_dispatch
>  > mesa.lib(api_loopback.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_Dispatch
>  > build\windows-x86\mesa\drivers\osmesa\osmesa.dll : fatal error LNK1120:
>  > 12 unresolved externals
>  > scons: *** [build\windows-x86\mesa\drivers\osmesa\osmesa.dll] Error 1120
>  > st_osmesa.lib(osmesa.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_proc_address
>  > mesa.lib(st_manager.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_check_multithread
>  > mesa.lib(vbo_exec_api.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_set_dispatch
>  > mesa.lib(glthread.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_set_context
>  > mesa.lib(context.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_get_dispatch_table_size
>  > mesa.lib(remap.obj) : error LNK2001: unresolved external symbol
>  > __imp___glapi_add_dispatch
>  > build\windows-x86\gallium\targets\osmesa\osmesa.dll : fatal error
>  > LNK1120: 6 unresolved externals
>  > scons: *** [build\windows-x86\gallium\targets\osmesa\osmesa.dll] 
> Error 1120
>  > scons: building terminated because of errors.
>  >
>  > This is a long standing issue. First reported here:
>  >
>  > 
> https://lists.freedesktop.org/archives/mesa-users/2012-May/000431.html 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2012-May%2F000431.html&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317413432&sdata=J3QPOUwBYNd87u%2F5MZrYtT6BTz2Pdyyj6NKAsj%2BCkxw%3D&reserved=0%20>
>  > 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2012-May%2F000431.html&data=02%7C01%7Cjfonseca%40vmware.com%7C6abda784079c42d71b3408d634f19a8a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754609623099529&sdata=%2BVbAVSllQsctFyx%2FaDxlLT3r4bxUNU1Ee%2BC%2FpV6A65A%3D&reserved=0 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2012-May%2F000431.html&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317413432&sdata=J3QPOUwBYNd87u%2F5MZrYtT6BTz2Pdyyj6NKAsj%2BCkxw%3D&reserved=0>>
>  >
>  > Encountered again in 2016:
>  >
>  > 
> https://lists.freedesktop.org/archives/mesa-users/2016-March/001142.html 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2016-March%2F001142.html&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317423437&sdata=0hrE0dIogy1CL8HI6abARqZ5M3f3770YUSsFoL7c3tQ%3D&reserved=0%20>
>  > 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2016-March%2F001142.html&data=02%7C01%7Cjfonseca%40vmware.com%7C6abda784079c42d71b3408d634f19a8a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754609623099529&sdata=F0LF4N3y9Z4WkpESF816hPBeFgisVhYmKqSOI57hZDo%3D&reserved=0 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fmesa-users%2F2016-March%2F001142.html&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317423437&sdata=0hrE0dIogy1CL8HI6abARqZ5M3f3770YUSsFoL7c3tQ%3D&reserved=0>>
>  >
>  > and finally by myself in early 2018:
>  >
>  > https://bugs.freedesktop.org/show_bug.cgi?id=106843 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D106843&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317423437&sdata=4FFo8IflUJPfzjV3VPEtPgGkF%2BTOryOwi9Xok19Q0a0%3D&reserved=0%20>
>  > 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D106843&data=02%7C01%7Cjfonseca%40vmware.com%7C6abda784079c42d71b3408d634f19a8a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754609623109534&sdata=%2BaoNGi49NqOqTduaS9GUh69nV8hxWI7bLp%2F7ikcAk2M%3D&reserved=0 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D106843&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317433446&sdata=xZ%2Fsc5QL0yvAjOifDWydxYNnwjI%2BIT18Z8JsSNXOKfM%3D&reserved=0>>
>  >
>  > Eric Engestrom suggested me to try the work in progress Meson build for
>  > Windows. Unfortunately it has other issues which prevents it from being
>  > ready for prime time as I reported here:
>  >
>  > https://gitlab.freedesktop.org/dbaker/mesa/issues/2 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdbaker%2Fmesa%2Fissues%2F2&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317433446&sdata=9VVaW%2BCjhDo2efTdls3A%2B1iLebh%2FYcEM7a3khwAdUag%3D&reserved=0%20>
>  > 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdbaker%2Fmesa%2Fissues%2F2&data=02%7C01%7Cjfonseca%40vmware.com%7C6abda784079c42d71b3408d634f19a8a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754609623109534&sdata=vfn2nFWXV4dcKX7jwJRM721sV40Mu6YWb64MvG7%2BBms%3D&reserved=0 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdbaker%2Fmesa%2Fissues%2F2&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317433446&sdata=9VVaW%2BCjhDo2efTdls3A%2B1iLebh%2FYcEM7a3khwAdUag%3D&reserved=0>>
>  >
>  > I stumbled upon this issue when dealing with this feature request:
>  >
>  > https://github.com/pal1000/mesa-dist-win/issues/8 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpal1000%2Fmesa-dist-win%2Fissues%2F8&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317443451&sdata=yFPM3P4GPWpnqPCnnmV1YrimMsLm5Y8V74tWHJNSz0I%3D&reserved=0%20>
>  > 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpal1000%2Fmesa-dist-win%2Fissues%2F8&data=02%7C01%7Cjfonseca%40vmware.com%7C6abda784079c42d71b3408d634f19a8a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754609623119539&sdata=NgWDQFRSrOAkp%2Baut%2FCQDeQJX2lxIm5%2FiaOxPdiOed8%3D&reserved=0 
> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpal1000%2Fmesa-dist-win%2Fissues%2F8&data=02%7C01%7Cjfonseca%40vmware.com%7Cf70f01ecc5524d6dbbcb08d635089556%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636754708317443451&sdata=yFPM3P4GPWpnqPCnnmV1YrimMsLm5Y8V74tWHJNSz0I%3D&reserved=0>>
> 
>  >
>  > I was able to get that feature done but with a terribly ugly hack which
>  > should not even be mentioned.
>  >
>  > This issue affects the linking between osmesa and shared_glapi so the
>  > build command that triggers it can be as short as:
>  >
>  > scons gles=y
>  >
>  > or
>  >
>  > scons gles=y osmesa
>  >
>  > to get to the linking failure as quickly as possible stripping targets
>  > that build successfully.
>  >
>  > I tried to make a proper fix but it is beyond my skill level, despite
>  > having the gut feeling the fix could be something surprisingly simple.
>  >
> 



More information about the mesa-dev mailing list