Commits

Christian Tismer committed 7d9e78a

made the assembler sources compile so far

  • Participants
  • Parent commits dcc3342

Comments (0)

Files changed (3)

File pypy/rlib/_rffi_stacklet.py

 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):

File pypy/translator/platform/__init__.py

         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):

File pypy/translator/platform/windows.py

 
     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