Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r63937:a29436d16da7
Date: 2013-05-09 10:54 +0200
http://bitbucket.org/pypy/pypy/changeset/a29436d16da7/

Log:    kill static linking

diff --git a/rpython/rlib/clibffi.py b/rpython/rlib/clibffi.py
--- a/rpython/rlib/clibffi.py
+++ b/rpython/rlib/clibffi.py
@@ -78,34 +78,8 @@
     else:
         pre_include_bits = []
 
-    def setup_after_config(config):
-        # a crude hack - libffi.a might be compiled without -fPIC on certain
-        # platforms, just disable it when we've passed --shared
-        if config.translation.shared:
-            eci.link_files = ()
-            eci.libraries = ('ffi',)
-
-    def find_libffi_a():
-        dirlist = platform.library_dirs_for_libffi_a()
-        for dir in dirlist:
-            result = os.path.join(dir, 'libffi.a')
-            if os.path.exists(result):
-                return result
-        log.WARNING("'libffi.a' not found in %s" % (dirlist,))
-        log.WARNING("trying to use the dynamic library instead...")
-        return None
-
-    path_libffi_a = None
-    if hasattr(platform, 'library_dirs_for_libffi_a'):
-        path_libffi_a = find_libffi_a()
-    if path_libffi_a is not None:
-        # platforms on which we want static linking
-        libraries = []
-        link_files = [path_libffi_a]
-    else:
-        # platforms on which we want dynamic linking
-        libraries = ['ffi']
-        link_files = []
+    libraries = ['ffi']
+    link_files = []
 
     eci = ExternalCompilationInfo(
         pre_include_bits = pre_include_bits,
diff --git a/rpython/rlib/ropenssl.py b/rpython/rlib/ropenssl.py
--- a/rpython/rlib/ropenssl.py
+++ b/rpython/rlib/ropenssl.py
@@ -7,7 +7,6 @@
 import sys, os
 
 link_files = []
-testonly_libraries = []
 include_dirs = []
 if sys.platform == 'win32' and platform.name != 'mingw32':
     libraries = ['libeay32', 'ssleay32',
@@ -21,27 +20,8 @@
         # so that openssl/ssl.h can repair this nonsense.
         'wincrypt.h']
 else:
-    libraries = ['z']
+    libraries = ['z', 'ssl', 'crypto']
     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']
-        testonly_libraries += ['ssl', 'crypto']
-    elif (sys.platform.startswith('linux') and
-        os.path.exists('/usr/local/ssl/lib/libssl.a') and
-        os.path.exists('/usr/local/ssl/lib/libcrypto.a')):
-        # use static linking, 2nd version
-        include_dirs += ['/usr/local/ssl/include']
-        link_files += ['/usr/local/ssl/lib/libssl.a',
-                       '/usr/local/ssl/lib/libcrypto.a',
-                       '-ldl']
-        testonly_libraries += ['ssl', 'crypto']
-    else:
-        libraries += ['ssl', 'crypto']
 
 includes += [
     'openssl/ssl.h', 
@@ -54,7 +34,6 @@
 eci = ExternalCompilationInfo(
     libraries = libraries,
     link_files = link_files,
-    testonly_libraries = testonly_libraries,
     includes = includes,
     include_dirs = include_dirs,
     export_symbols = [],
diff --git a/rpython/translator/goal/translate.py 
b/rpython/translator/goal/translate.py
--- a/rpython/translator/goal/translate.py
+++ b/rpython/translator/goal/translate.py
@@ -183,13 +183,6 @@
     # perform checks (if any) on the final config
     final_check_config(config)
 
-    try:
-        from rpython.rlib import clibffi
-    except ImportError:
-        pass # too bad
-    else:
-        clibffi.setup_after_config(config)
-
     return targetspec_dic, translateconfig, config, args
 
 def show_help(translateconfig, opt_parser, targetspec_dic, config):
diff --git a/rpython/translator/platform/cygwin.py 
b/rpython/translator/platform/cygwin.py
--- a/rpython/translator/platform/cygwin.py
+++ b/rpython/translator/platform/cygwin.py
@@ -39,14 +39,6 @@
         return self._pkg_config("libffi", "--libs-only-L",
                                 ['/usr/lib/libffi'])
 
-    def library_dirs_for_libffi_a(self):
-        # places where we need to look for libffi.a
-        # XXX obscuuure!  only look for libffi.a if run with translate.py
-        if 'translate' in sys.modules:
-            return self.library_dirs_for_libffi() + ['/usr/lib']
-        else:
-            return []
-
 
 class Cygwin(BaseCygwin):
     shared_only = ()    # it seems that on 32-bit linux, compiling with -fPIC
diff --git a/rpython/translator/platform/linux.py 
b/rpython/translator/platform/linux.py
--- a/rpython/translator/platform/linux.py
+++ b/rpython/translator/platform/linux.py
@@ -7,7 +7,7 @@
 
 class BaseLinux(BasePosix):
     name = "linux"
-    
+
     link_flags = tuple(
                  ['-pthread',]
                  + os.environ.get('LDFLAGS', '').split())
@@ -20,7 +20,7 @@
     shared_only = ('-fPIC',)
     so_ext = 'so'
     so_prefixes = ('lib', '')
-    
+
     def _args_for_shared(self, args):
         return ['-shared'] + args
 
@@ -32,20 +32,6 @@
         return self._pkg_config("libffi", "--libs-only-L",
                                 ['/usr/lib/libffi'])
 
-    def library_dirs_for_libffi_a(self):
-        # places where we need to look for libffi.a
-        # XXX obscuuure!  only look for libffi.a if run with translate.py
-        if 'translate' in sys.modules:
-            if sys.maxint > 2**32:
-                host = 'x86_64'
-            else:
-                host = 'x86'
-            return self.library_dirs_for_libffi() + [
-                '/usr/lib',
-                '/usr/lib/%s-linux-gnu/' % host]
-        else:
-            return []
-
 
 class Linux(BaseLinux):
     if platform.machine().startswith('arm'):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to