aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulano <nulano@nulano.eu>2020-08-10 02:39:21 +0200
committernulano <nulano@nulano.eu>2020-08-10 02:39:21 +0200
commitd0d85bf5cb838e3d87a562f0d73e38369bb89ccb (patch)
treeb7a541f9823984b09f1970b2e6de3f4e445ce7ac /rpython/translator
parentfix rffi.LONG / rffi.ULONG vs rffi.SIGNED / rffi.UNSIGNED in _pypyjson module (diff)
parentupdate contributors list, 8 new names (diff)
downloadpypy-d0d85bf5cb838e3d87a562f0d73e38369bb89ccb.tar.gz
pypy-d0d85bf5cb838e3d87a562f0d73e38369bb89ccb.tar.bz2
pypy-d0d85bf5cb838e3d87a562f0d73e38369bb89ccb.zip
Merge default
Diffstat (limited to 'rpython/translator')
-rw-r--r--rpython/translator/c/src/signals.c10
-rw-r--r--rpython/translator/c/src/stack.h2
-rw-r--r--rpython/translator/platform/windows.py37
3 files changed, 20 insertions, 29 deletions
diff --git a/rpython/translator/c/src/signals.c b/rpython/translator/c/src/signals.c
index ec0911accd..1dbd0f3786 100644
--- a/rpython/translator/c/src/signals.c
+++ b/rpython/translator/c/src/signals.c
@@ -116,6 +116,11 @@ static void write_str(int fd, const char *p)
res = write(fd, p, i);
}
+#ifdef _WIN32
+/* this is set manually from pypy3's module/time/interp_time */
+HANDLE pypy_sigint_interrupt_event = NULL;
+#endif
+
static void signal_setflag_handler(int signum)
{
pypysig_pushback(signum);
@@ -154,6 +159,11 @@ static void signal_setflag_handler(int signum)
}
errno = old_errno;
}
+
+#ifdef _WIN32
+ if (signum == SIGINT && pypy_sigint_interrupt_event)
+ SetEvent(pypy_sigint_interrupt_event);
+#endif
}
void pypysig_setflag(int signum)
diff --git a/rpython/translator/c/src/stack.h b/rpython/translator/c/src/stack.h
index 52cfc9a35b..0af1eaa47c 100644
--- a/rpython/translator/c/src/stack.h
+++ b/rpython/translator/c/src/stack.h
@@ -45,6 +45,8 @@ void LL_stack_set_length_fraction(double);
#ifdef __GNUC__
# define PYPY_INHIBIT_TAIL_CALL() asm("/* inhibit_tail_call */")
+#elif defined(_MSC_VER )
+# define PYPY_INHIBIT_TAIL_CALL() __asm NOP /* inhibit_tail_call */
#else
# define PYPY_INHIBIT_TAIL_CALL() /* add hints for other compilers here */
#endif
diff --git a/rpython/translator/platform/windows.py b/rpython/translator/platform/windows.py
index e48e174367..6b4218fe62 100644
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -189,6 +189,7 @@ class MsvcPlatform(Platform):
Platform.__init__(self, 'cl.exe')
if msvc_compiler_environ:
self.c_environ.update(msvc_compiler_environ)
+ self.version = "MSVC %s" % str(self.vsver)
if x64:
self.externals_branch = 'win64_%d' % self.vsver
else:
@@ -196,22 +197,6 @@ class MsvcPlatform(Platform):
else:
self.cc = cc
- # detect version of current compiler
- try:
- returncode, stdout, stderr = _run_subprocess(self.cc, [],
- env=self.c_environ)
- except EnvironmentError:
- log.msg('Could not run %s using PATH=\n%s' %(self.cc,
- '\n'.join(self.c_environ['PATH'].split(';'))))
- raise
- r = re.search(r'Microsoft.+C/C\+\+.+\s([0-9]+)\.([0-9]+).*', stderr)
- if r is not None:
- log.msg('compiler %s' % stderr)
- self.version = int(''.join(r.groups())) / 10 - 60
- else:
- # Probably not a msvc compiler...
- self.version = 0
-
# Try to find a masm assembler
returncode, stdout, stderr = _run_subprocess('ml.exe' if not x64 else 'ml64.exe', [],
env=self.c_environ)
@@ -463,7 +448,7 @@ class MsvcPlatform(Platform):
for rule in rules:
m.rule(*rule)
- if len(headers_to_precompile)>0 and self.version >= 80:
+ if len(headers_to_precompile) > 0:
# at least from VS2013 onwards we need to include PCH
# objects in the final link command
linkobjs = 'stdafx.obj '
@@ -478,18 +463,12 @@ class MsvcPlatform(Platform):
if icon and not shared:
extra_deps.append('icon.res')
linkobjs = 'icon.res ' + linkobjs
- if self.version < 80:
- m.rule('$(TARGET)', ['$(OBJECTS)'] + extra_deps,
- [ '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA) /out:$@' +\
- ' $(LIBDIRS) $(LIBS) ' + linkobjs,
- ])
- else:
- m.rule('$(TARGET)', ['$(OBJECTS)'] + extra_deps,
- [ '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA)' + \
- ' $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS) /MANIFEST' + \
- ' /MANIFESTFILE:$*.manifest ' + linkobjs,
- 'mt.exe -nologo -manifest $*.manifest -outputresource:$@;1',
- ])
+ m.rule('$(TARGET)', ['$(OBJECTS)'] + extra_deps,
+ [ '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA)' + \
+ ' $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS) /MANIFEST' + \
+ ' /MANIFESTFILE:$*.manifest ' + linkobjs,
+ 'mt.exe -nologo -manifest $*.manifest -outputresource:$@;1',
+ ])
m.rule('debugmode_$(TARGET)', ['$(OBJECTS)'] + extra_deps,
[ '$(CC_LINK) /nologo /DEBUG $(LDFLAGS) $(LDFLAGSEXTRA)' + \
' $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS) ' + linkobjs,