[pypy-commit] pypy default: Linux: linking openssl into portable binaries is **A SERIOUS MESS** and I'm

arigo noreply at buildbot.pypy.org
Mon Apr 16 15:11:43 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r54411:b777f530457f
Date: 2012-04-16 15:09 +0200
http://bitbucket.org/pypy/pypy/changeset/b777f530457f/

Log:	Linux: linking openssl into portable binaries is **A SERIOUS MESS**
	and I'm carefully choosing my words. Give up and use static
	linking.

diff --git a/pypy/rlib/ropenssl.py b/pypy/rlib/ropenssl.py
--- a/pypy/rlib/ropenssl.py
+++ b/pypy/rlib/ropenssl.py
@@ -3,8 +3,9 @@
 from pypy.translator.platform import platform
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 
-import sys
+import sys, os
 
+link_files = []
 if sys.platform == 'win32' and platform.name != 'mingw32':
     libraries = ['libeay32', 'ssleay32',
                  'user32', 'advapi32', 'gdi32', 'msvcrt', 'ws2_32']
@@ -17,8 +18,17 @@
         # so that openssl/ssl.h can repair this nonsense.
         'wincrypt.h']
 else:
-    libraries = ['ssl', 'crypto']
+    libraries = ['z']
     includes = []
+    if (sys.platform.startswith('linux') and
+        os.path.exists('/usr/lib/libssl.a') and
+        os.path.exists('/usr/lib/libcrypto.a')):
+        # use static linking to avoid the infinite
+        # amount of troubles due to symbol versions
+        # and 0.9.8/1.0.0
+        link_files += ['/usr/lib/libssl.a', '/usr/lib/libcrypto.a']
+    else:
+        libraries += ['ssl', 'crypto']
 
 includes += [
     'openssl/ssl.h', 
@@ -30,6 +40,7 @@
 
 eci = ExternalCompilationInfo(
     libraries = libraries,
+    link_files = link_files,
     includes = includes,
     export_symbols = [],
     post_include_bits = [


More information about the pypy-commit mailing list