[pypy-commit] pypy default: proper fix
arigo
pypy.commits at gmail.com
Thu Mar 9 03:17:31 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r90602:98bd8eef9a25
Date: 2017-03-09 09:16 +0100
http://bitbucket.org/pypy/pypy/changeset/98bd8eef9a25/
Log: proper fix
diff --git a/rpython/translator/platform/bsd.py b/rpython/translator/platform/bsd.py
--- a/rpython/translator/platform/bsd.py
+++ b/rpython/translator/platform/bsd.py
@@ -11,7 +11,7 @@
standalone_only = []
shared_only = []
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['-shared'] + args
def _include_dirs_for_libffi(self):
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
@@ -27,7 +27,7 @@
so_ext = 'dll'
exe_ext = 'exe'
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['-shared'] + args
def _include_dirs_for_libffi(self):
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
@@ -30,13 +30,16 @@
print 'in get_rpath_flags, rel_libdirs is not fixed up',rel_libdirs
return self.rpath_flags
- def _args_for_shared(self, args):
- if hasattr(self, '_exe_name'):
- target = os.path.basename(self._exe_name)
+ def _args_for_shared(self, args, **kwds):
+ if 'exe_name' in kwds:
+ target_basename = kwds['exe_name'].basename
else:
- target = '$(TARGET)' # inside a Makefile
+ target_basename = '$(TARGET)'
+ # The default '$(TARGET)' is used inside a Makefile. Otherwise
+ # we get the basename of the executable we're trying to build.
return (list(self.shared_only)
- + ['-dynamiclib', '-install_name', '@rpath/' + target, '-undefined', 'dynamic_lookup', '-flat_namespace']
+ + ['-dynamiclib', '-install_name', '@rpath/' + target_basename,
+ '-undefined', 'dynamic_lookup', '-flat_namespace']
+ args)
def _include_dirs_for_libffi(self):
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
@@ -24,7 +24,7 @@
from rpython.translator.platform.arch import s390x
cflags = s390x.update_cflags(cflags)
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['-shared'] + args
def _include_dirs_for_libffi(self):
diff --git a/rpython/translator/platform/netbsd.py b/rpython/translator/platform/netbsd.py
--- a/rpython/translator/platform/netbsd.py
+++ b/rpython/translator/platform/netbsd.py
@@ -34,7 +34,7 @@
cc = get_env("CC", "gcc")
super(Netbsd, self).__init__(cc)
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['-shared'] + args
def _preprocess_include_dirs(self, include_dirs):
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
@@ -54,9 +54,7 @@
args = [str(ofile) for ofile in ofiles] + link_args
args += ['-o', str(exe_name)]
if not standalone:
- self._exe_name = str(exe_name)
- args = self._args_for_shared(args)
- del self._exe_name # remove, otherwise __eq__() fails
+ args = self._args_for_shared(args, exe_name=exe_name)
self._execute_c_compiler(cc, args, exe_name,
cwd=str(exe_name.dirpath()))
return exe_name
diff --git a/rpython/translator/platform/windows.py b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -200,7 +200,7 @@
def _linkfiles(self, link_files):
return list(link_files)
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['/dll'] + args
def check___thread(self):
@@ -555,7 +555,7 @@
cc = 'gcc'
Platform.__init__(self, cc)
- def _args_for_shared(self, args):
+ def _args_for_shared(self, args, **kwds):
return ['-shared'] + args
def _include_dirs_for_libffi(self):
More information about the pypy-commit
mailing list