summaryrefslogtreecommitdiff
path: root/boehm-gc
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-03 02:07:36 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-03 02:07:36 +0000
commit168c58e0bbae3def1c0ee17e7a226c4e3d9081ff (patch)
tree7db99eb5a7164070b8702b056eadc9042dc95f03 /boehm-gc
parent920bea8ab8f3890ad0017c271986fdf710eed081 (diff)
downloadgcc-168c58e0bbae3def1c0ee17e7a226c4e3d9081ff.tar.gz
Index: gcc/ChangeLog
2006-06-02 Geoffrey Keating <geoffk@apple.com> * config/rs6000/host-darwin.c (sigaltstack): Protect prototype with HAVE_DECL_SIGALTSTACK. (MC_FLD): New. (segv_handler): Use MC_FLD. * configure.ac: Check for a sigaltstack declaration. Compute HAS_MCONTEXT_T_UNDERSCORES on Darwin. * configure: Regenerate. * config.in: Regenerate. Index: boehm-gc/ChangeLog 2006-06-02 Geoffrey Keating <geoffk@apple.com> * configure.ac: Define HAS_PPC_THREAD_STATE_R0, HAS_PPC_THREAD_STATE___R0, HAS_PPC_THREAD_STATE64_R0, HAS_PPC_THREAD_STATE64___R0, HAS_I386_THREAD_STATE_EAX, HAS_I386_THREAD_STATE___EAX. * configure: Regenerate. * include/gc_config.h.in: Regenerate. * darwin_stop_world.c (PPC_RED_ZONE_SIZE): Use standard Darwin macro names to determine value. (THREAD_STATE): New. (THREAD_FLD): New. (GC_push_all_stacks): Use THREAD_STATE and THREAD_FLD in both versions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114339 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc')
-rw-r--r--boehm-gc/ChangeLog14
-rwxr-xr-xboehm-gc/configure676
-rw-r--r--boehm-gc/configure.ac33
-rw-r--r--boehm-gc/darwin_stop_world.c221
-rw-r--r--boehm-gc/include/gc_config.h.in20
5 files changed, 866 insertions, 98 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 4bcd87cf440..cdb7f7c1d90 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,17 @@
+2006-06-02 Geoffrey Keating <geoffk@apple.com>
+
+ * configure.ac: Define HAS_PPC_THREAD_STATE_R0,
+ HAS_PPC_THREAD_STATE___R0, HAS_PPC_THREAD_STATE64_R0,
+ HAS_PPC_THREAD_STATE64___R0, HAS_I386_THREAD_STATE_EAX,
+ HAS_I386_THREAD_STATE___EAX.
+ * configure: Regenerate.
+ * include/gc_config.h.in: Regenerate.
+ * darwin_stop_world.c (PPC_RED_ZONE_SIZE): Use standard Darwin
+ macro names to determine value.
+ (THREAD_STATE): New.
+ (THREAD_FLD): New.
+ (GC_push_all_stacks): Use THREAD_STATE and THREAD_FLD in both versions.
+
2006-05-24 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.am: Add install-html target.
diff --git a/boehm-gc/configure b/boehm-gc/configure
index 65575a5d137..2b9d6f5f6e6 100755
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -5597,6 +5597,682 @@ else
fi
+# Darwin needs a few extra special tests to deal with variation in the
+# system headers.
+case "$host" in
+ powerpc*-*-darwin*)
+ echo "$as_me:$LINENO: checking for ppc_thread_state_t.r0" >&5
+echo $ECHO_N "checking for ppc_thread_state_t.r0... $ECHO_C" >&6
+if test "${ac_cv_member_ppc_thread_state_t_r0+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state_t ac_aggr;
+if (ac_aggr.r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state_t_r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state_t ac_aggr;
+if (sizeof ac_aggr.r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state_t_r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_ppc_thread_state_t_r0=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state_t_r0" >&5
+echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t_r0" >&6
+if test $ac_cv_member_ppc_thread_state_t_r0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_PPC_THREAD_STATE_R0
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for ppc_thread_state_t.__r0" >&5
+echo $ECHO_N "checking for ppc_thread_state_t.__r0... $ECHO_C" >&6
+if test "${ac_cv_member_ppc_thread_state_t___r0+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state_t ac_aggr;
+if (ac_aggr.__r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state_t___r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state_t ac_aggr;
+if (sizeof ac_aggr.__r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state_t___r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_ppc_thread_state_t___r0=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state_t___r0" >&5
+echo "${ECHO_T}$ac_cv_member_ppc_thread_state_t___r0" >&6
+if test $ac_cv_member_ppc_thread_state_t___r0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_PPC_THREAD_STATE___R0
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for ppc_thread_state64_t.r0" >&5
+echo $ECHO_N "checking for ppc_thread_state64_t.r0... $ECHO_C" >&6
+if test "${ac_cv_member_ppc_thread_state64_t_r0+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state64_t ac_aggr;
+if (ac_aggr.r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state64_t_r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state64_t ac_aggr;
+if (sizeof ac_aggr.r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state64_t_r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_ppc_thread_state64_t_r0=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state64_t_r0" >&5
+echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t_r0" >&6
+if test $ac_cv_member_ppc_thread_state64_t_r0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_PPC_THREAD_STATE64_R0
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for ppc_thread_state64_t.__r0" >&5
+echo $ECHO_N "checking for ppc_thread_state64_t.__r0... $ECHO_C" >&6
+if test "${ac_cv_member_ppc_thread_state64_t___r0+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state64_t ac_aggr;
+if (ac_aggr.__r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state64_t___r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static ppc_thread_state64_t ac_aggr;
+if (sizeof ac_aggr.__r0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_ppc_thread_state64_t___r0=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_ppc_thread_state64_t___r0=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_ppc_thread_state64_t___r0" >&5
+echo "${ECHO_T}$ac_cv_member_ppc_thread_state64_t___r0" >&6
+if test $ac_cv_member_ppc_thread_state64_t___r0 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_PPC_THREAD_STATE64___R0
+_ACEOF
+
+fi
+
+ ;;
+ i?86*-*-darwin*)
+ echo "$as_me:$LINENO: checking for i386_thread_state_t.eax" >&5
+echo $ECHO_N "checking for i386_thread_state_t.eax... $ECHO_C" >&6
+if test "${ac_cv_member_i386_thread_state_t_eax+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static i386_thread_state_t ac_aggr;
+if (ac_aggr.eax)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_i386_thread_state_t_eax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static i386_thread_state_t ac_aggr;
+if (sizeof ac_aggr.eax)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_i386_thread_state_t_eax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_i386_thread_state_t_eax=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t_eax" >&5
+echo "${ECHO_T}$ac_cv_member_i386_thread_state_t_eax" >&6
+if test $ac_cv_member_i386_thread_state_t_eax = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_I386_THREAD_STATE_EAX
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for i386_thread_state_t.__eax" >&5
+echo $ECHO_N "checking for i386_thread_state_t.__eax... $ECHO_C" >&6
+if test "${ac_cv_member_i386_thread_state_t___eax+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static i386_thread_state_t ac_aggr;
+if (ac_aggr.__eax)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_i386_thread_state_t___eax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mach/thread_status.h>
+
+int
+main ()
+{
+static i386_thread_state_t ac_aggr;
+if (sizeof ac_aggr.__eax)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_i386_thread_state_t___eax=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_i386_thread_state_t___eax=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t___eax" >&5
+echo "${ECHO_T}$ac_cv_member_i386_thread_state_t___eax" >&6
+if test $ac_cv_member_i386_thread_state_t___eax = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_I386_THREAD_STATE___EAX
+_ACEOF
+
+fi
+
+ ;;
+ *) ;;
+esac
+
# We never want libdl on darwin. It is a fake libdl that just ends up making
# dyld calls anyway
case "$host" in
diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac
index 69ad5cd3ab9..b1d53cf6a88 100644
--- a/boehm-gc/configure.ac
+++ b/boehm-gc/configure.ac
@@ -232,6 +232,39 @@ case "$host" in
esac
AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
+# Darwin needs a few extra special tests to deal with variation in the
+# system headers.
+case "$host" in
+ powerpc*-*-darwin*)
+ AC_CHECK_MEMBER(ppc_thread_state_t.r0,
+ AC_DEFINE(HAS_PPC_THREAD_STATE_R0,,[ppc_thread_state_t has field r0]),,
+ [#include <mach/thread_status.h>])
+ AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
+ AC_DEFINE(HAS_PPC_THREAD_STATE___R0,,dnl
+ [ppc_thread_state_t has field __r0]),,
+ [#include <mach/thread_status.h>])
+ AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
+ AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,,dnl
+ [ppc_thread_state64_t has field r0]),,
+ [#include <mach/thread_status.h>])
+ AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
+ AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,,dnl
+ [ppc_thread_state64_t has field __r0]),,
+ [#include <mach/thread_status.h>])
+ ;;
+ i?86*-*-darwin*)
+ AC_CHECK_MEMBER(i386_thread_state_t.eax,
+ AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl
+ [i386_thread_state_t has field eax]),,
+ [#include <mach/thread_status.h>])
+ AC_CHECK_MEMBER(i386_thread_state_t.__eax,
+ AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl
+ [i386_thread_state_t has field __eax]),,
+ [#include <mach/thread_status.h>])
+ ;;
+ *) ;;
+esac
+
# We never want libdl on darwin. It is a fake libdl that just ends up making
# dyld calls anyway
case "$host" in
diff --git a/boehm-gc/darwin_stop_world.c b/boehm-gc/darwin_stop_world.c
index c2a033d3cc4..895fdb61a64 100644
--- a/boehm-gc/darwin_stop_world.c
+++ b/boehm-gc/darwin_stop_world.c
@@ -14,12 +14,43 @@
Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
it must set up a stack frame just like routines that call other routines."
*/
-#ifdef POWERPC
-# if CPP_WORDSZ == 32
-# define PPC_RED_ZONE_SIZE 224
-# elif CPP_WORDSZ == 64
-# define PPC_RED_ZONE_SIZE 320
+#if defined(__ppc__)
+# define PPC_RED_ZONE_SIZE 224
+#elif defined(__ppc64__)
+# define PPC_RED_ZONE_SIZE 320
+#endif
+
+/* Try to work out the right way to access thread state structure members.
+ The structure has changed its definition in different Darwin versions. */
+#if defined(__ppc__)
+# define THREAD_STATE ppc_thread_state_t
+# if defined (HAS_PPC_THREAD_STATE_R0)
+# define THREAD_FLD(x) x
+# elif defined (HAS_PPC_THREAD_STATE___R0)
+# define THREAD_FLD(x) __ ## x
+# else
+# error can not work out how to access fields of ppc_thread_state_t
+# endif
+#elif defined(__ppc64__)
+# define THREAD_STATE ppc_thread_state64_t
+# if defined (HAS_PPC_THREAD_STATE64_R0)
+# define THREAD_FLD(x) x
+# elif defined (HAS_PPC_THREAD_STATE64___R0)
+# define THREAD_FLD(x) __ ## x
+# else
+# error can not work out how to access fields of ppc_thread_state64_t
# endif
+#elif defined(__i386__)
+# define THREAD_STATE i386_thread_state_t
+# if defined (HAS_I386_THREAD_STATE_EAX)
+# define THREAD_FLD(x) x
+# elif defined (HAS_I386_THREAD_STATE___EAX)
+# define THREAD_FLD(x) __ ## x
+# else
+# error can not work out how to access fields of i386_thread_state_t
+# endif
+#else
+# error unknown architecture
#endif
typedef struct StackFrame {
@@ -75,7 +106,7 @@ void GC_push_all_stacks() {
GC_thread p;
pthread_t me;
ptr_t lo, hi;
- ppc_thread_state_t state;
+ THREAD_STATE state;
mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
me = pthread_self();
@@ -95,39 +126,39 @@ void GC_push_all_stacks() {
&thread_state_count);
if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
- lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
+ lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
- GC_push_one(state.r0);
- GC_push_one(state.r2);
- GC_push_one(state.r3);
- GC_push_one(state.r4);
- GC_push_one(state.r5);
- GC_push_one(state.r6);
- GC_push_one(state.r7);
- GC_push_one(state.r8);
- GC_push_one(state.r9);
- GC_push_one(state.r10);
- GC_push_one(state.r11);
- GC_push_one(state.r12);
- GC_push_one(state.r13);
- GC_push_one(state.r14);
- GC_push_one(state.r15);
- GC_push_one(state.r16);
- GC_push_one(state.r17);
- GC_push_one(state.r18);
- GC_push_one(state.r19);
- GC_push_one(state.r20);
- GC_push_one(state.r21);
- GC_push_one(state.r22);
- GC_push_one(state.r23);
- GC_push_one(state.r24);
- GC_push_one(state.r25);
- GC_push_one(state.r26);
- GC_push_one(state.r27);
- GC_push_one(state.r28);
- GC_push_one(state.r29);
- GC_push_one(state.r30);
- GC_push_one(state.r31);
+ GC_push_one(state . THREAD_FLD (r0));
+ GC_push_one(state . THREAD_FLD (r2));
+ GC_push_one(state . THREAD_FLD (r3));
+ GC_push_one(state . THREAD_FLD (r4));
+ GC_push_one(state . THREAD_FLD (r5));
+ GC_push_one(state . THREAD_FLD (r6));
+ GC_push_one(state . THREAD_FLD (r7));
+ GC_push_one(state . THREAD_FLD (r8));
+ GC_push_one(state . THREAD_FLD (r9));
+ GC_push_one(state . THREAD_FLD (r10));
+ GC_push_one(state . THREAD_FLD (r11));
+ GC_push_one(state . THREAD_FLD (r12));
+ GC_push_one(state . THREAD_FLD (r13));
+ GC_push_one(state . THREAD_FLD (r14));
+ GC_push_one(state . THREAD_FLD (r15));
+ GC_push_one(state . THREAD_FLD (r16));
+ GC_push_one(state . THREAD_FLD (r17));
+ GC_push_one(state . THREAD_FLD (r18));
+ GC_push_one(state . THREAD_FLD (r19));
+ GC_push_one(state . THREAD_FLD (r20));
+ GC_push_one(state . THREAD_FLD (r21));
+ GC_push_one(state . THREAD_FLD (r22));
+ GC_push_one(state . THREAD_FLD (r23));
+ GC_push_one(state . THREAD_FLD (r24));
+ GC_push_one(state . THREAD_FLD (r25));
+ GC_push_one(state . THREAD_FLD (r26));
+ GC_push_one(state . THREAD_FLD (r27));
+ GC_push_one(state . THREAD_FLD (r28));
+ GC_push_one(state . THREAD_FLD (r29));
+ GC_push_one(state . THREAD_FLD (r30));
+ GC_push_one(state . THREAD_FLD (r31));
} /* p != me */
if(p->flags & MAIN_THREAD)
hi = GC_stackbottom;
@@ -166,78 +197,74 @@ void GC_push_all_stacks() {
lo = GC_approx_sp();
hi = (ptr_t)FindTopOfStack(0);
} else {
-# if defined(POWERPC)
-# if CPP_WORDSZ == 32
- ppc_thread_state_t info;
-# else
- ppc_thread_state64_t info;
-# endif
+# if defined(__ppc__) || defined(__ppc64__)
+ THREAD_STATE info;
mach_msg_type_number_t outCount = THREAD_STATE_MAX;
r = thread_get_state(thread, MACHINE_THREAD_STATE,
(natural_t *)&info, &outCount);
if(r != KERN_SUCCESS) ABORT("task_get_state failed");
- lo = (void*)(info.r1 - PPC_RED_ZONE_SIZE);
- hi = (ptr_t)FindTopOfStack(info.r1);
-
- GC_push_one(info.r0);
- GC_push_one(info.r2);
- GC_push_one(info.r3);
- GC_push_one(info.r4);
- GC_push_one(info.r5);
- GC_push_one(info.r6);
- GC_push_one(info.r7);
- GC_push_one(info.r8);
- GC_push_one(info.r9);
- GC_push_one(info.r10);
- GC_push_one(info.r11);
- GC_push_one(info.r12);
- GC_push_one(info.r13);
- GC_push_one(info.r14);
- GC_push_one(info.r15);
- GC_push_one(info.r16);
- GC_push_one(info.r17);
- GC_push_one(info.r18);
- GC_push_one(info.r19);
- GC_push_one(info.r20);
- GC_push_one(info.r21);
- GC_push_one(info.r22);
- GC_push_one(info.r23);
- GC_push_one(info.r24);
- GC_push_one(info.r25);
- GC_push_one(info.r26);
- GC_push_one(info.r27);
- GC_push_one(info.r28);
- GC_push_one(info.r29);
- GC_push_one(info.r30);
- GC_push_one(info.r31);
+ lo = (void*)(info . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
+ hi = (ptr_t)FindTopOfStack(info . THREAD_FLD (r1));
+
+ GC_push_one(info . THREAD_FLD (r0));
+ GC_push_one(info . THREAD_FLD (r2));
+ GC_push_one(info . THREAD_FLD (r3));
+ GC_push_one(info . THREAD_FLD (r4));
+ GC_push_one(info . THREAD_FLD (r5));
+ GC_push_one(info . THREAD_FLD (r6));
+ GC_push_one(info . THREAD_FLD (r7));
+ GC_push_one(info . THREAD_FLD (r8));
+ GC_push_one(info . THREAD_FLD (r9));
+ GC_push_one(info . THREAD_FLD (r10));
+ GC_push_one(info . THREAD_FLD (r11));
+ GC_push_one(info . THREAD_FLD (r12));
+ GC_push_one(info . THREAD_FLD (r13));
+ GC_push_one(info . THREAD_FLD (r14));
+ GC_push_one(info . THREAD_FLD (r15));
+ GC_push_one(info . THREAD_FLD (r16));
+ GC_push_one(info . THREAD_FLD (r17));
+ GC_push_one(info . THREAD_FLD (r18));
+ GC_push_one(info . THREAD_FLD (r19));
+ GC_push_one(info . THREAD_FLD (r20));
+ GC_push_one(info . THREAD_FLD (r21));
+ GC_push_one(info . THREAD_FLD (r22));
+ GC_push_one(info . THREAD_FLD (r23));
+ GC_push_one(info . THREAD_FLD (r24));
+ GC_push_one(info . THREAD_FLD (r25));
+ GC_push_one(info . THREAD_FLD (r26));
+ GC_push_one(info . THREAD_FLD (r27));
+ GC_push_one(info . THREAD_FLD (r28));
+ GC_push_one(info . THREAD_FLD (r29));
+ GC_push_one(info . THREAD_FLD (r30));
+ GC_push_one(info . THREAD_FLD (r31));
# else
/* FIXME: Remove after testing: */
WARN("This is completely untested and likely will not work\n", 0);
- i386_thread_state_t info;
+ THREAD_STATE info;
mach_msg_type_number_t outCount = THREAD_STATE_MAX;
r = thread_get_state(thread, MACHINE_THREAD_STATE,
(natural_t *)&info, &outCount);
if(r != KERN_SUCCESS) ABORT("task_get_state failed");
- lo = (void*)info.esp;
- hi = (ptr_t)FindTopOfStack(info.esp);
-
- GC_push_one(info.eax);
- GC_push_one(info.ebx);
- GC_push_one(info.ecx);
- GC_push_one(info.edx);
- GC_push_one(info.edi);
- GC_push_one(info.esi);
- /* GC_push_one(info.ebp); */
- /* GC_push_one(info.esp); */
- GC_push_one(info.ss);
- GC_push_one(info.eip);
- GC_push_one(info.cs);
- GC_push_one(info.ds);
- GC_push_one(info.es);
- GC_push_one(info.fs);
- GC_push_one(info.gs);
+ lo = (void*)info . THREAD_FLD (esp);
+ hi = (ptr_t)FindTopOfStack(info . THREAD_FLD (esp));
+
+ GC_push_one(info . THREAD_FLD (eax));
+ GC_push_one(info . THREAD_FLD (ebx));
+ GC_push_one(info . THREAD_FLD (ecx));
+ GC_push_one(info . THREAD_FLD (edx));
+ GC_push_one(info . THREAD_FLD (edi));
+ GC_push_one(info . THREAD_FLD (esi));
+ /* GC_push_one(info . THREAD_FLD (ebp)); */
+ /* GC_push_one(info . THREAD_FLD (esp)); */
+ GC_push_one(info . THREAD_FLD (ss));
+ GC_push_one(info . THREAD_FLD (eip));
+ GC_push_one(info . THREAD_FLD (cs));
+ GC_push_one(info . THREAD_FLD (ds));
+ GC_push_one(info . THREAD_FLD (es));
+ GC_push_one(info . THREAD_FLD (fs));
+ GC_push_one(info . THREAD_FLD (gs));
# endif /* !POWERPC */
}
# if DEBUG_THREADS
diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in
index cfaae9dd464..401de609ba6 100644
--- a/boehm-gc/include/gc_config.h.in
+++ b/boehm-gc/include/gc_config.h.in
@@ -57,6 +57,24 @@
/* support for win32 threads */
#undef GC_WIN32_THREADS
+/* i386_thread_state_t has field eax */
+#undef HAS_I386_THREAD_STATE_EAX
+
+/* i386_thread_state_t has field __eax */
+#undef HAS_I386_THREAD_STATE___EAX
+
+/* ppc_thread_state64_t has field r0 */
+#undef HAS_PPC_THREAD_STATE64_R0
+
+/* ppc_thread_state64_t has field __r0 */
+#undef HAS_PPC_THREAD_STATE64___R0
+
+/* ppc_thread_state_t has field r0 */
+#undef HAS_PPC_THREAD_STATE_R0
+
+/* ppc_thread_state_t has field __r0 */
+#undef HAS_PPC_THREAD_STATE___R0
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -154,5 +172,5 @@
/* POSIX version of C Source */
#undef _POSIX_C_SOURCE
-/* Use reentrant code */
+/* Required define if using POSIX threads */
#undef _REENTRANT