Mesa (master): dri: Also support the loader with libudev.so.0.

Eric Anholt anholt at kemper.freedesktop.org
Sat Feb 1 20:44:08 UTC 2014


Module: Mesa
Branch: master
Commit: 63546b8e3d217d81a67f6f291fab48b3f381a9ca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=63546b8e3d217d81a67f6f291fab48b3f381a9ca

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 30 10:30:57 2014 -0800

dri: Also support the loader with libudev.so.0.

As far as I know, this should be safe.  If not, we have to decide whether
to have variable lookup of the functions, or just drop support for .so.0
(which is a year and a half old it looks like)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74127
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/loader/loader.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 626046a..5d25899 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -102,6 +102,16 @@ udev_dlopen_handle(void)
 {
    if (!udev_handle) {
       udev_handle = dlopen("libudev.so.1", RTLD_LOCAL | RTLD_LAZY);
+
+      if (!udev_handle) {
+         /* libudev.so.1 changed the return types of the two unref functions
+          * from voids to pointers.  We don't use those return values, and the
+          * only ABI I've heard that cares about this kind of change (calling
+          * a function with a void * return that actually only returns void)
+          * might be ia64.
+          */
+         udev_handle = dlopen("libudev.so.0", RTLD_LOCAL | RTLD_LAZY);
+      }
    }
 
    return udev_handle;




More information about the mesa-commit mailing list