I have read bug report #208198 and am somewhat confused. It has become a combinatorical problem, and my head smokes. But there seems to be an easy way out: libGL.so.1 is linked to different files whether Mesa or nVidia libs are used:
libGL.so.1 -> libGL.so.1.2 (Mesa SW only driver)
or
libGL.so.1 -> libGL.so.1.0.7676 (nVidia 76.76 driver)
You create a symlink:
libGL.so -> libGL.so.1.2
which assumes too much. Either it is diverted as well, which adds complexity for every new driver, or:
Simply change the symlink to
,,,,,,,,,,,,,,,,,,,,,,
libGL.so -> libGL.so.1
^^^^^^^^^^^^^^^^^^^^^^
This works for both Mesa and nVidia without complex and error prone scripting. I do not know if ldconfig optimizes such symlink chains, but I think startup time is not hampered too much by that. If it were, I would rather file a bug against ldconfig to add optimization there, because having variants is not confined to OpenGL, but result of competition.