From 4c1dc453b3a2c1f6ab8d3ea72f1185532041ddd7 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 25 Oct 2011 08:48:39 -0400 Subject: [PATCH] Bug 687320 - On OpenBSD, libGL.so.1 doesn't exist - r=bjacob Opening libGL.so will work regardless of the version, which changes over time. --- gfx/thebes/GLContextProviderGLX.cpp | 4 ++++ toolkit/xre/glxtest.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gfx/thebes/GLContextProviderGLX.cpp b/gfx/thebes/GLContextProviderGLX.cpp index cede02b5644..64a58edf916 100644 --- a/gfx/thebes/GLContextProviderGLX.cpp +++ b/gfx/thebes/GLContextProviderGLX.cpp @@ -102,7 +102,11 @@ GLXLibrary::EnsureInitialized() // see e.g. bug 608526: it is intrinsically interesting to know whether we have dynamically linked to libGL.so.1 // because at least the NVIDIA implementation requires an executable stack, which causes mprotect calls, // which trigger glibc bug http://sourceware.org/bugzilla/show_bug.cgi?id=12225 +#ifdef __OpenBSD__ + const char *libGLfilename = "libGL.so"; +#else const char *libGLfilename = "libGL.so.1"; +#endif ScopedGfxFeatureReporter reporter(libGLfilename); mOGLLibrary = PR_LoadLibrary(libGLfilename); if (!mOGLLibrary) { diff --git a/toolkit/xre/glxtest.cpp b/toolkit/xre/glxtest.cpp index d82b05efaca..de9e1776018 100644 --- a/toolkit/xre/glxtest.cpp +++ b/toolkit/xre/glxtest.cpp @@ -111,7 +111,11 @@ x_error_handler(Display *, XErrorEvent *ev) static void glxtest() { ///// Open libGL and load needed symbols ///// +#ifdef __OpenBSD__ + void *libgl = dlopen("libGL.so", RTLD_LAZY); +#else void *libgl = dlopen("libGL.so.1", RTLD_LAZY); +#endif if (!libgl) fatal_error("Unable to load libGL.so.1");