Commits

Armin Rigo committed 3462974

Fix: seems that thread.c is also compiled early when running "rpython".

  • Participants
  • Parent commits 329ece4
  • Branches fast-gil

Comments (0)

Files changed (2)

File rpython/rlib/rthread.py

 @specialize.memo()
 def _fetch_fastgil(rpy_fastgil_value):
     eci = ExternalCompilationInfo(
-        pre_include_bits = ['#define RPY_FASTGIL %d' % rpy_fastgil_value])
+        compile_extra = ['-DRPY_FASTGIL=%d' % rpy_fastgil_value])
     return rffi.llexternal('RPyFetchFastGil', [], lltype.Signed,
                            compilation_info=eci, sandboxsafe=True)
 

File rpython/translator/c/src/thread.c

 /* Thread implementation */
 #include "src/thread.h"
 
+#ifdef PYPY_USING_BOEHM_GC
 /* The following include is required by the Boehm GC, which apparently
  * crashes when pthread_create_thread() is not redefined to call a
  * Boehm wrapper function instead.  Ugly.
- *
- * It is also needed to see the definition of RPY_FASTGIL, if there is one.
  */
 #include "common_header.h"
+#endif
+
 
 /* More ugliness follows... */
 #ifdef RPY_FASTGIL
 # if RPY_FASTGIL == 42    /* special value to mean "asmgcc" */
+#  include "common_header.h"
 #  include "structdef.h"
 #  include "forwarddecl.h"
 # endif