[pypy-commit] pypy default: partial fix for rpath with clang (darwin), broken by a5c8f6daa2f8

mattip noreply at buildbot.pypy.org
Thu Mar 19 22:09:47 CET 2015


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r76480:4d66c739aa16
Date: 2015-03-19 23:11 +0200
http://bitbucket.org/pypy/pypy/changeset/4d66c739aa16/

Log:	partial fix for rpath with clang (darwin), broken by a5c8f6daa2f8

diff --git a/rpython/translator/platform/darwin.py b/rpython/translator/platform/darwin.py
--- a/rpython/translator/platform/darwin.py
+++ b/rpython/translator/platform/darwin.py
@@ -12,6 +12,11 @@
     DEFAULT_CC = 'clang'
     rpath_flags = ['-Wl,-rpath', '-Wl, at executable_path/']
 
+    def get_rpath_flags(self, rel_libdirs):
+        # needed for cross compiling on ARM, needs fixing if relevant for darwin
+        assert len(rel_libdirs) < 1
+        return self.rpath_flags 
+
     def _args_for_shared(self, args):
         return (list(self.shared_only)
                 + ['-dynamiclib', '-install_name', '@rpath/$(TARGET)', '-undefined', 'dynamic_lookup']
diff --git a/rpython/translator/platform/posix.py b/rpython/translator/platform/posix.py
--- a/rpython/translator/platform/posix.py
+++ b/rpython/translator/platform/posix.py
@@ -89,6 +89,11 @@
                 raise ValueError(msg)
         return result
 
+    def get_rpath_flags(self, rel_libdirs):
+        # needed for cross-compilation i.e. ARM
+        return self.rpath_flags + ['-Wl,-rpath-link=\'%s\'' % ldir
+                                    for ldir in rel_libdirs]
+
     def get_shared_only_compile_flags(self):
         return tuple(self.shared_only) + ('-fvisibility=hidden',)
 
@@ -167,8 +172,7 @@
             ('CC', self.cc),
             ('CC_LINK', eci.use_cpp_linker and 'g++' or '$(CC)'),
             ('LINKFILES', eci.link_files),
-            ('RPATH_FLAGS', self.rpath_flags + ['-Wl,-rpath-link=\'%s\'' % ldir
-                                                for ldir in rel_libdirs]),
+            ('RPATH_FLAGS', self.get_rpath_flags(rel_libdirs)),
             ]
         for args in definitions:
             m.definition(*args)


More information about the pypy-commit mailing list