When [primus_vk](https://github.com/felixdoerre/primus_vk), which uses primus as backend, is built from source and "pvkrun vkcube" is run, this ends with a segfault.
After some [debugging](https://github.com/felixdoerre/primus_vk/issues/88) together with the owner of primus_vk, it turned out that on systems with GLVND enabled, applications should always use the libglvnd-provided libGL.so.1 library which then determines the correct vendor-specifig libGL. The vendor-specific GLVND-compatible libGLs are apparently not required to export all the GL-related symbols.
Therefore, we considered the injection of the primus-0.2-r2.ebuild of
into primusrun when libglvnd is considered active to be a bug, especially due to the fact that the segfault problens disappear when primusrun is modified to contain
Please refer to the original [bug report](https://github.com/felixdoerre/primus_vk/issues/88) for details.
Steps to Reproduce:
1. Install [primus_vk](https://github.com/felixdoerre/primus_vk) from source - you will have to patch the libdir in the Makefile as well as one include in primus_vp.cpp.
2. Run "pvkrun vkcube"
vkcube segfaults in /usr/lib64/libGLX_nvidia.so.0
vkcube runs on the dedicated GPU
Refer to https://github.com/felixdoerre/primus_vk/issues/88 for details on how to reproduce the bug, on how we tracked it down and on some background information of how glvnd is supposed to work with references to its specifications.
There's also a suggestion of primus_vk's author in https://github.com/felixdoerre/primus_vk/issues/88 to avoid all this "export PRIMUS_libGL..." for finding the correct libraries in primus and configure it correctly in bumblebee.conf, because primus seems to fetch it from optirun when it has no own values set - so this would be the general solution.
Does it make more sense to fix it step by step (first export the correct libraries for primusrun, then fix bumblebee, then remove exports from primusrun again) or should this better be a combined effort where both packages are updated at once?