Author: Christian Tismer <tis...@stackless.com> Branch: Changeset: r49556:b64cba156148 Date: 2011-11-19 22:33 +0100 http://bitbucket.org/pypy/pypy/changeset/b64cba156148/
Log: 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. 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 @@ -8,16 +8,21 @@ 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()) 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 @@ -172,6 +172,12 @@ 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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit