[pypy-commit] pypy kill-exported-symbols-list: meh
arigo
noreply at buildbot.pypy.org
Thu Oct 23 16:38:28 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: kill-exported-symbols-list
Changeset: r74138:a88dfbbe8d53
Date: 2014-10-23 16:37 +0200
http://bitbucket.org/pypy/pypy/changeset/a88dfbbe8d53/
Log: meh
diff --git a/rpython/translator/c/dlltool.py b/rpython/translator/c/dlltool.py
--- a/rpython/translator/c/dlltool.py
+++ b/rpython/translator/c/dlltool.py
@@ -26,9 +26,7 @@
pass # XXX finish
def compile(self):
- export_symbols = ([self.db.get(ep) for ep in self.getentrypointptr()] +
- ['RPython_StartupCode'])
- extsymeci = ExternalCompilationInfo(export_symbols=export_symbols)
+ extsymeci = ExternalCompilationInfo() # empty
self.eci = self.eci.merge(extsymeci)
files = [self.c_source_filename] + self.extrafiles
files += self.eventually_copy(self.eci.separate_module_files)
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
@@ -258,8 +258,6 @@
defines['USE___THREAD'] = 1
if self.config.translation.shared:
defines['PYPY_MAIN_FUNCTION'] = "pypy_main_startup"
- self.eci = self.eci.merge(ExternalCompilationInfo(
- export_symbols=["pypy_main_startup", "pypy_debug_file"]))
self.eci, cfile, extra, headers_to_precompile = \
gen_source(db, modulename, targetdir,
self.eci, defines=defines, split=self.split)
diff --git a/rpython/translator/c/node.py b/rpython/translator/c/node.py
--- a/rpython/translator/c/node.py
+++ b/rpython/translator/c/node.py
@@ -462,7 +462,7 @@
parent, parentindex = parentlink(obj)
if obj in exports.EXPORTS_obj2name:
self.name = exports.EXPORTS_obj2name[obj]
- self.globalcontainer = True
+ self.globalcontainer = 2 # meh
elif parent is None:
self.name = db.namespace.uniquename('g_' + self.basename())
self.globalcontainer = True
@@ -486,6 +486,9 @@
T = self.getTYPE()
return hasattr(T, "_hints") and T._hints.get('thread_local')
+ def is_exported(self):
+ return self.globalcontainer == 2 # meh
+
def compilation_info(self):
return getattr(self.obj, self.eci_name, None)
@@ -505,7 +508,8 @@
type, name = self.get_declaration()
yield '%s;' % (
forward_cdecl(type, name, self.db.standalone,
- self.is_thread_local()))
+ is_thread_local=self.is_thread_local(),
+ is_exported=self.is_exported()))
def implementation(self):
if llgroup.member_of_group(self.obj):
diff --git a/rpython/translator/c/src/debug_print.h b/rpython/translator/c/src/debug_print.h
--- a/rpython/translator/c/src/debug_print.h
+++ b/rpython/translator/c/src/debug_print.h
@@ -44,7 +44,7 @@
void pypy_debug_forked(long original_offset);
extern long pypy_have_debug_prints;
-extern FILE *pypy_debug_file;
+extern RPY_EXPORTED FILE *pypy_debug_file;
#define OP_LL_READ_TIMESTAMP(val) READ_TIMESTAMP(val)
diff --git a/rpython/translator/c/test/test_genc.py b/rpython/translator/c/test/test_genc.py
--- a/rpython/translator/c/test/test_genc.py
+++ b/rpython/translator/c/test/test_genc.py
@@ -512,9 +512,6 @@
FOO = Struct("FOO", ("field1", Signed))
foo = malloc(FOO, flavor="raw")
foo.field1 = 43
- # maybe export_struct should add the struct name to eci automatically?
- # https://bugs.pypy.org/issue1361
- foo._obj._compilation_info = ExternalCompilationInfo(export_symbols=['BarStruct'])
export_struct("BarStruct", foo._obj)
t = Translation(f, [], backend="c")
t.annotate()
More information about the pypy-commit
mailing list