Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1617:9ee657789f0e
Date: 2015-01-02 18:30 +0100
http://bitbucket.org/cffi/cffi/changeset/9ee657789f0e/

Log:    Issue #141: if compiling with __thread fails, try to compile without
        __thread, and if that fails too, we know there is some other problem
        with the compiler.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,15 @@
             #
             resultlist[:] = res
 
+def no_working_compiler_found():
+    sys.stderr.write("""
+    No working compiler found, or bogus compiler options
+    passed to the compiler from Python's distutils module.
+    See the error messages above.
+    (If they are about -mno-fused-madd and you are on OS/X 10.8,
+    see http://stackoverflow.com/questions/22313407/ .)\n""")
+    sys.exit(1)
+
 def ask_supports_thread():
     from distutils.core import Distribution
     from distutils.sysconfig import get_config_vars
@@ -50,6 +59,9 @@
     if ok:
         define_macros.append(('USE__THREAD', None))
     else:
+        ok1 = config.try_compile('int some_regular_variable_42;')
+        if not ok1:
+            no_working_compiler_found()
         sys.stderr.write("Note: will not use '__thread' in the C code\n")
         sys.stderr.write("The above error message can be safely ignored\n")
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to