summaryrefslogtreecommitdiffstats
path: root/third_party/talloc/libreplace/dlfcn.c
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 22:47:51 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 22:47:51 +0000
commit1a7f66eb16724be2fe195ed62141b86dd63168b1 (patch)
tree8aaeced09377f3633977787a63f7f1998100bbb8 /third_party/talloc/libreplace/dlfcn.c
parent86a5293ac4571cffb0c7bb7f2da50f91ce6db829 (diff)
downloadchromium_src-1a7f66eb16724be2fe195ed62141b86dd63168b1.zip
chromium_src-1a7f66eb16724be2fe195ed62141b86dd63168b1.tar.gz
chromium_src-1a7f66eb16724be2fe195ed62141b86dd63168b1.tar.bz2
Upgraded Mesa to 7.9 from 7.7 in order to pick up bug fixes to the
shader compiler which were causing WebGL test timeouts per https://bugs.webkit.org/show_bug.cgi?id=47243 . Version 7.8.2 was too buggy to use. This upgrade required the incorporation of the talloc library, which is only compiled in to the OSMesa shared object produced by third_party/mesa/mesa.gyp and not into the rest of Chromium. Upgraded mesa.gyp for the new source directories and files in Mesa 7.9. Applied the changes originally documented in third_party/mesa/README.chromium to the 7.9 sources. Made other necessary changes to Mesa and talloc to be able to build and run them on Windows and Mac OS X. Created chromium.patch files for both Mesa and talloc. Fixed chrome/gpu/gpu_main.cc to honor the --use-gl command line option on Linux. Tested on Linux in Chromium with CSS 3D content and --use-gl=osmesa as well as in DumpRenderTree and verified that the affected WebGL tests no longer hang. Tested on Windows in Chromium with WebGL content and --use-gl=osmesa. Tested on Mac OS X in test_shell with WebGL content. This job was explicitly not sent to the try bots because it would probably kill them. The files in this CL are a small subset of the files being committed. The patch is too large to upload to Rietveld. BUG=none TEST=none Review URL: http://codereview.chromium.org/4107001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/talloc/libreplace/dlfcn.c')
-rw-r--r--third_party/talloc/libreplace/dlfcn.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/third_party/talloc/libreplace/dlfcn.c b/third_party/talloc/libreplace/dlfcn.c
new file mode 100644
index 0000000..88431ed
--- /dev/null
+++ b/third_party/talloc/libreplace/dlfcn.c
@@ -0,0 +1,76 @@
+/*
+ Unix SMB/CIFS implementation.
+ Samba system utilities
+ Copyright (C) Andrew Tridgell 1992-1998
+ Copyright (C) Jeremy Allison 1998-2002
+ Copyright (C) Jelmer Vernooij 2006
+
+ ** NOTE! The following LGPL license applies to the replace
+ ** library. This does NOT imply that all of Samba is released
+ ** under the LGPL
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+#ifdef HAVE_DL_H
+#include <dl.h>
+#endif
+
+#ifndef HAVE_DLOPEN
+#ifdef DLOPEN_TAKES_UNSIGNED_FLAGS
+void *rep_dlopen(const char *name, unsigned int flags)
+#else
+void *rep_dlopen(const char *name, int flags)
+#endif
+{
+#ifdef HAVE_SHL_LOAD
+ if (name == NULL)
+ return PROG_HANDLE;
+ return (void *)shl_load(name, flags, 0);
+#else
+ return NULL;
+#endif
+}
+#endif
+
+#ifndef HAVE_DLSYM
+void *rep_dlsym(void *handle, const char *symbol)
+{
+#ifdef HAVE_SHL_FINDSYM
+ void *sym_addr;
+ if (!shl_findsym((shl_t *)&handle, symbol, TYPE_UNDEFINED, &sym_addr))
+ return sym_addr;
+#endif
+ return NULL;
+}
+#endif
+
+#ifndef HAVE_DLERROR
+char *rep_dlerror(void)
+{
+ return "dynamic loading of objects not supported on this platform";
+}
+#endif
+
+#ifndef HAVE_DLCLOSE
+int rep_dlclose(void *handle)
+{
+#ifdef HAVE_SHL_CLOSE
+ return shl_unload((shl_t)handle);
+#else
+ return 0;
+#endif
+}
+#endif