Commits

Christian Tismer  committed 5ea3649

got continuelets ready for windows.

There were two things where I stumbled quite a while.

1) _compile_c_file was sloppy with the defined order of arguments, where masm had different behavior.

2) it was needed to add external definitions, but it was not clear to me that this already works and nothing than an entry in export_symbols was needed.
(transplanted from b64cba156148599f77c3e1b6c5f7d5764609463d)

  • Participants
  • Parent commits ad95d5c
  • Branches release-1.7.x

Comments (0)

Files changed (2)

File pypy/rlib/_rffi_stacklet.py

 
 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
 )
+if sys.platform == 'win32':
+    eci.separate_module_files += (cdir / "src/stacklet/switch_x86_msvc.asm", )
+    eci.export_symbols += (
+        'stacklet_newthread',
+        'stacklet_deletethread',
+        'stacklet_new',
+        'stacklet_switch',
+        'stacklet_destroy',
+        '_stacklet_translate_pointer',
+        )
 
 rffi_platform.verify_eci(eci.convert_sources_to_files())
 

File pypy/translator/platform/windows.py

 
     def _compile_c_file(self, cc, cfile, compile_args):
         oname = cfile.new(ext='obj')
+        # notabene: (tismer)
+        # This function may be called for .c but also .asm files.
+        # The c compiler accepts any order of arguments, while
+        # the assembler still has the old behavior that all options
+        # must come first, and after the file name all options are ignored.
+        # So please be careful with the oder of parameters! ;-)
         args = ['/nologo', '/c'] + compile_args + ['/Fo%s' % (oname,), str(cfile)]
         self._execute_c_compiler(cc, args, oname)
         return oname