From f390baacae079aaa4f02172c58de5032d7795f31 Mon Sep 17 00:00:00 2001 From: mrs Date: Fri, 8 Dec 2006 23:54:21 +0000 Subject: [PATCH] * configure.ac: Fix x86 darwin builds. * darwin_stop_world.c: Likewise. * include/private/gcconfig.h: Likewise. * connfigure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119670 138bc75d-0d04-0410-961f-82ee72b054a4 --- boehm-gc/ChangeLog | 7 +++++++ boehm-gc/configure | 7 ++++++- boehm-gc/configure.ac | 6 ++++-- boehm-gc/darwin_stop_world.c | 27 ++++++++++++++++++--------- boehm-gc/include/private/gcconfig.h | 4 ++-- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index b8183a56989..2739c38c58f 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2006-12-08 Mike Stump + + * configure.ac: Fix x86 darwin builds. + * darwin_stop_world.c: Likewise. + * include/private/gcconfig.h: Likewise. + * connfigure: Regenerate. + 2006-09-26 Jack Howarth PR target/29180 diff --git a/boehm-gc/configure b/boehm-gc/configure index 00b14305f95..f509b349937 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -5465,7 +5465,8 @@ _ACEOF #define THREAD_LOCAL_ALLOC 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define USE_COMPILER_TLS 1 _ACEOF @@ -6084,6 +6085,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include #include int @@ -6129,6 +6131,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include #include int @@ -6195,6 +6198,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include #include int @@ -6240,6 +6244,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include #include int diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac index 45937dcf9b9..84dd7ec8d66 100644 --- a/boehm-gc/configure.ac +++ b/boehm-gc/configure.ac @@ -267,11 +267,13 @@ case "$host" in AC_CHECK_MEMBER(i386_thread_state_t.eax, AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl [i386_thread_state_t has field eax]),, - [#include ]) + [#include +#include ]) AC_CHECK_MEMBER(i386_thread_state_t.__eax, AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl [i386_thread_state_t has field __eax]),, - [#include ]) + [#include +#include ]) ;; *) ;; esac diff --git a/boehm-gc/darwin_stop_world.c b/boehm-gc/darwin_stop_world.c index 29845923bb5..bdd6f3a0730 100644 --- a/boehm-gc/darwin_stop_world.c +++ b/boehm-gc/darwin_stop_world.c @@ -49,6 +49,15 @@ # else # error can not work out how to access fields of i386_thread_state_t # endif +#elif defined(__x86_64__) +# 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 @@ -127,15 +136,15 @@ void GC_push_all_stacks() { if(r != KERN_SUCCESS) ABORT("thread_get_state failed"); #if defined(I386) - lo = state.esp; - - GC_push_one(state.eax); - GC_push_one(state.ebx); - GC_push_one(state.ecx); - GC_push_one(state.edx); - GC_push_one(state.edi); - GC_push_one(state.esi); - GC_push_one(state.ebp); + lo = (void*)state . THREAD_FLD (esp); + + GC_push_one(state . THREAD_FLD (eax)); + GC_push_one(state . THREAD_FLD (ebx)); + GC_push_one(state . THREAD_FLD (ecx)); + GC_push_one(state . THREAD_FLD (edx)); + GC_push_one(state . THREAD_FLD (edi)); + GC_push_one(state . THREAD_FLD (esi)); + GC_push_one(state . THREAD_FLD (ebp)); #elif defined(POWERPC) lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE); diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index 26db82ee537..e06a7565609 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -302,7 +302,7 @@ # if defined(__ppc__) || defined(__ppc64__) # define POWERPC # define mach_type_known -# elif defined(__i386__) +# elif defined(__i386__) || defined(__x86_64) # define I386 # define mach_type_known # endif @@ -787,7 +787,7 @@ # define DATAEND (_end) # endif # ifdef DARWIN -# ifdef __ppc64__ +# if defined(__ppc64__) || defined(__x86_64) # define ALIGNMENT 8 # define CPP_WORDSZ 64 # else -- 2.11.0