From 7fe69244af791a1d452d64b40efd92a45dac7570 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 17 Jul 2015 18:33:19 -0700 Subject: [PATCH] mesa: Fix dlopen patch --- .../libraries/mesa/dlopen-absolute-paths.diff | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff index 2b239e760ba3..251272f5ce84 100644 --- a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff +++ b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff @@ -1,13 +1,28 @@ diff --git a/src/loader/loader.c b/src/loader/loader.c -index 666d015..4d7a9be 100644 +index 4fdf3c2..0cd62b5 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c -@@ -101,7 +101,7 @@ static void * +@@ -112,7 +112,6 @@ static void *udev_handle = NULL; + static void * udev_dlopen_handle(void) { - if (!udev_handle) { -- udev_handle = dlopen("libudev.so.1", RTLD_LOCAL | RTLD_LAZY); -+ udev_handle = dlopen("@udev@/lib/libudev.so.1", RTLD_LOCAL | RTLD_LAZY); +- char name[80]; + unsigned flags = RTLD_NOLOAD | RTLD_LOCAL | RTLD_LAZY; + int version; - if (!udev_handle) { - /* libudev.so.1 changed the return types of the two unref functions +@@ -125,12 +124,9 @@ udev_dlopen_handle(void) + + /* First try opening an already linked libudev, then try loading one */ + do { +- for (version = 1; version >= 0; version--) { +- snprintf(name, sizeof(name), "libudev.so.%d", version); +- udev_handle = dlopen(name, flags); +- if (udev_handle) +- return udev_handle; +- } ++ udev_handle = dlopen("@udev@/lib/libudev.so", flags); ++ if (udev_handle) ++ return udev_handle; + + if ((flags & RTLD_NOLOAD) == 0) + break;