[pypy-commit] pypy default: made the assembler sources compile so far

ctismer noreply at buildbot.pypy.org
Fri Nov 18 23:13:31 CET 2011


Author: Christian Tismer <tismer at stackless.com>
Branch: 
Changeset: r49539:7d9e78a91dce
Date: 2011-11-18 23:12 +0100
http://bitbucket.org/pypy/pypy/changeset/7d9e78a91dce/

Log:	made the assembler sources compile so far

diff --git a/pypy/rlib/_rffi_stacklet.py b/pypy/rlib/_rffi_stacklet.py
--- a/pypy/rlib/_rffi_stacklet.py
+++ b/pypy/rlib/_rffi_stacklet.py
@@ -3,16 +3,22 @@
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.rpython.tool import rffi_platform
+import sys
 
 
 cdir = py.path.local(pypydir) / 'translator' / 'c'
 
-
+_sep_mods = []
+if sys.platform == 'win32':
+    _sep_mods = [cdir / "src/stacklet/switch_x86_msvc.asm"]
+    
 eci = ExternalCompilationInfo(
     include_dirs = [cdir],
     includes = ['src/stacklet/stacklet.h'],
     separate_module_sources = ['#include "src/stacklet/stacklet.c"\n'],
+    separate_module_files = _sep_mods
 )
+
 rffi_platform.verify_eci(eci.convert_sources_to_files())
 
 def llexternal(name, args, result, **kwds):
diff --git a/pypy/translator/platform/__init__.py b/pypy/translator/platform/__init__.py
--- a/pypy/translator/platform/__init__.py
+++ b/pypy/translator/platform/__init__.py
@@ -59,7 +59,11 @@
         compile_args = self._compile_args_from_eci(eci, standalone)
         ofiles = []
         for cfile in cfiles:
-            ofiles.append(self._compile_c_file(self.cc, cfile, compile_args))
+            # Windows hack: use masm for files ending in .asm
+            if str(cfile).lower().endswith('.asm'):
+                ofiles.append(self._compile_c_file(self.masm, cfile, []))
+            else:
+                ofiles.append(self._compile_c_file(self.cc, cfile, compile_args))
         return ofiles
 
     def execute(self, executable, args=None, env=None, compilation_info=None):
diff --git a/pypy/translator/platform/windows.py b/pypy/translator/platform/windows.py
--- a/pypy/translator/platform/windows.py
+++ b/pypy/translator/platform/windows.py
@@ -165,7 +165,7 @@
 
     def _compile_c_file(self, cc, cfile, compile_args):
         oname = cfile.new(ext='obj')
-        args = ['/nologo', '/c'] + compile_args + [str(cfile), '/Fo%s' % (oname,)]
+        args = ['/nologo', '/c'] + compile_args + ['/Fo%s' % (oname,), str(cfile)]
         self._execute_c_compiler(cc, args, oname)
         return oname
 


More information about the pypy-commit mailing list