http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52179
Patrick Marlier <patrick.marlier at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |patrick.marlier at gmail
| |dot com
--- Comment #8 from Patrick Marlier <patrick.marlier at gmail dot com>
2012-02-22 22:30:52 UTC ---
As discussed in https://github.com/ivmai/bdwgc/issues/13, this was fixed in
boehm-gc but due to the stage 4, I don't expect to the boehm-gc version be
upgraded. Does a workaround should be proposed?
You can try that but 1) this is untested (and probably is not enough), 2)
NO_PTHREAD_GET_STACKADDR_NP macro does not exists in current boehm-gc so
probably it will create problems too.
Index: os_dep.c
===================================================================
--- os_dep.c (revision 184398)
+++ os_dep.c (working copy)
@@ -1011,6 +1011,14 @@ ptr_t GC_get_stack_base()
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
&& !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS)
+# if defined(DARWIN)
+ /* We could use pthread_get_stackaddr_np even in case of a */
+ /* single-threaded gclib (there is no -lpthread on Darwin). */
+# include <pthread.h>
+# undef STACKBOTTOM
+# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self())
+# endif /* defined(DARWIN) */
+
ptr_t GC_get_stack_base()
{
# if defined(HEURISTIC1) || defined(HEURISTIC2) || \