[pypy-commit] pypy stmgc-c7: Workaround: some Linux systems start processes with a non-null %gs
arigo
noreply at buildbot.pypy.org
Mon Jul 7 12:57:40 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r72378:dd3c06b77a11
Date: 2014-07-07 12:57 +0200
http://bitbucket.org/pypy/pypy/changeset/dd3c06b77a11/
Log: Workaround: some Linux systems start processes with a non-null %gs
content. It seems that forcing %gs to be 0 here solves problems in
case we have some 'late_initializations'.
diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -795,6 +795,10 @@
print >> f, 'char *RPython_StartupCode(void) {'
print >> f, '\tchar *error = NULL;'
+ if database.with_stm:
+ print >> f, '\t/* XXX temporary workaround for late_initializations */'
+ print >> f, '\tsyscall(SYS_arch_prctl, ARCH_SET_GS, (uint64_t)0);'
+
# put float infinities in global constants, we should not have so many of them for now to make
# a table+loop preferable
for dest, value in database.late_initializations:
@@ -896,6 +900,14 @@
filename = targetdir.join(modulename + '.c')
f = filename.open('w')
+ if database.with_stm:
+ print >> f, '/* XXX temporary, for SYS_arch_prctl below */'
+ print >> f, '#define _GNU_SOURCE'
+ print >> f, '#include <unistd.h>'
+ print >> f, '#include <sys/syscall.h>'
+ print >> f, '#include <sys/prctl.h>'
+ print >> f, '#include <asm/prctl.h>'
+ print >> f
incfilename = targetdir.join('common_header.h')
fi = incfilename.open('w')
fi.write('#ifndef _PY_COMMON_HEADER_H\n#define _PY_COMMON_HEADER_H\n')
More information about the pypy-commit
mailing list