Date: Tue, 06 Mar 2018 20:14:14 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 226403] [PATCH] Fix for not being able to link against just "libGL.so" with x11/nvidia-driver Message-ID: <bug-226403-13@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226403 Bug ID: 226403 Summary: [PATCH] Fix for not being able to link against just "libGL.so" with x11/nvidia-driver Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Keywords: easy, patch Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: danfe@FreeBSD.org Reporter: tatu.kilappa@iki.fi Assignee: danfe@FreeBSD.org Flags: maintainer-feedback?(danfe@FreeBSD.org) Created attachment 191260 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D191260&action= =3Dedit x11/nvidia-driver/Makefile - libGL.so, libEGL.so, libGLESv2.so rename fix I have found a problem in the Makefile of the nvidia-driver package. At the end of processing, the files are renamed as follows: ${MV} -f ${STAGEDIR}${PREFIX}/lib/libGL.so \ ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so Ok, no name conflicts. That's nice. However, we also have a libmap setting that looks like this: libGL.so libGL-NVIDIA.so libGL.so.1 libGL-NVIDIA.so.1 Which means that anyone accessing libGL,so actually accesses libGL-NVIDIA.so. However, since the directive in the makefile was a move, libGL-NVIDIA.so, which is a symbolic link, will remain pointing at libGL.so.1. Now, libmap only does simple translation (see libmap.c under src/libexec/rtld-elf) and does not follow any symbolic link paths in the filesystem because at the time of translation, only the name of the library - not its actual location - is known. Unfortunately this means any program linking to libGL.so directly will try to load libGL-NVIDIA.so, and then follow the symbolic link to libGL.so.1 and then that symbolic link to libGL.so.1.2.0. Thus, any program linking against libGL.so as opposed to libGL.so.1 will not work since Nvidia and Mesa GL implementations obviously do not mix. I propose changing the directive in the makefile to: ${LN} -sf libGL-NVIDIA.so.1 \ ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so This will mean that libGL-NVIDIA.so remains pointing at the same library it was supposed to point at before the rename. I have attached a patch that does this change, and then similar change to libEGL-NVIDIA.so and libGLESv2.so, so everything will work. NOTE: Most (almost all) GL programs work because they explicitly link against libGL.so.1. However, I feel also the few that use libGL.so without that extra .1 should also work. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-226403-13>