Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r64001:6f295ae6bdfd
Date: 2013-05-12 13:09 +0200
http://bitbucket.org/pypy/pypy/changeset/6f295ae6bdfd/

Log:    fix test_standalone and provide -fPIC to DEBUGFLAGS

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
@@ -427,7 +427,10 @@
             if sys.platform == 'win32':
                 mk.definition('DEBUGFLAGS', '/MD /Zi')
             else:
-                mk.definition('DEBUGFLAGS', '-O2 -fomit-frame-pointer -g')
+                if self.config.translation.shared:
+                    mk.definition('DEBUGFLAGS', '-O2 -fomit-frame-pointer -g 
-fPIC')
+                else:
+                    mk.definition('DEBUGFLAGS', '-O2 -fomit-frame-pointer -g')
 
             if self.config.translation.shared:
                 mk.definition('PYPY_MAIN_FUNCTION', "pypy_main_startup")
diff --git a/rpython/translator/c/test/test_standalone.py 
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -25,7 +25,7 @@
         t = TranslationContext(self.config)
         ann = t.buildannotator()
         ann.build_types(entry_point, [s_list_of_strings])
-        if secondary_entrypoints is not None:
+        if entrypoints is not None:
             anns = {}
             for func, annotation in secondary_entrypoints['test']:
                 anns[func] = annotation
@@ -39,8 +39,11 @@
 
         t.config.translation.shared = shared
 
-        cbuilder = CStandaloneBuilder(t, entry_point, t.config,
-               secondary_entrypoints=[(i, None) for i in entrypoints])
+        if entrypoints is not None:
+            kwds = {'secondary_entrypoints': [(i, None) for i in entrypoints]}
+        else:
+            kwds = {}
+        cbuilder = CStandaloneBuilder(t, entry_point, t.config, **kwds)
         if debug:
             cbuilder.generate_source(defines=cbuilder.DEBUG_DEFINES)
         else:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to