[pypy-commit] pypy default: we *must* specify RTLD_NOW.

fijal noreply at buildbot.pypy.org
Wed Dec 7 21:31:27 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r50291:e37e4e6e97b8
Date: 2011-12-07 22:30 +0200
http://bitbucket.org/pypy/pypy/changeset/e37e4e6e97b8/

Log:	we *must* specify RTLD_NOW.

diff --git a/lib-python/modified-2.7/ctypes/__init__.py b/lib-python/modified-2.7/ctypes/__init__.py
--- a/lib-python/modified-2.7/ctypes/__init__.py
+++ b/lib-python/modified-2.7/ctypes/__init__.py
@@ -351,7 +351,7 @@
         self._FuncPtr = _FuncPtr
 
         if handle is None:
-            self._handle = _ffi.CDLL(name)
+            self._handle = _ffi.CDLL(name, mode)
         else:
             self._handle = handle
 
diff --git a/pypy/rlib/rdynload.py b/pypy/rlib/rdynload.py
--- a/pypy/rlib/rdynload.py
+++ b/pypy/rlib/rdynload.py
@@ -87,9 +87,10 @@
         """
         if mode == -1:
             if RTLD_LOCAL is not None:
-                mode = RTLD_LOCAL | RTLD_NOW
+                mode = RTLD_LOCAL
             else:
-                mode = RTLD_NOW
+                mode = 0
+        mode |= RTLD_NOW
         res = c_dlopen(name, rffi.cast(rffi.INT, mode))
         if not res:
             err = dlerror()


More information about the pypy-commit mailing list