summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-06-03 02:07:36 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2006-06-03 02:07:36 +0000
commit4f6d8cc800fc8a48fa5b8bbe728dd109c3b23fb2 (patch)
tree7db99eb5a7164070b8702b056eadc9042dc95f03 /gcc
parent347b9c46e1653b9bdad22a394005b2c74abae764 (diff)
downloadgcc-4f6d8cc800fc8a48fa5b8bbe728dd109c3b23fb2.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. From-SVN: r114339
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config.in13
-rw-r--r--gcc/config/rs6000/host-darwin.c15
-rwxr-xr-xgcc/configure138
-rw-r--r--gcc/configure.ac22
5 files changed, 197 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c52e0e916fd..34d6f17fe18 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
2006-06-03 J"orn Rennecke <joern.rennecke@st.com>
PR other/27850
diff --git a/gcc/config.in b/gcc/config.in
index 98e34388dff..d5f854ef959 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -148,6 +148,12 @@
#endif
+/* mcontext_t fields start with __ */
+#ifndef USED_FOR_TARGET
+#undef HAS_MCONTEXT_T_UNDERSCORES
+#endif
+
+
/* Define to 1 if you have the `alphasort' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_ALPHASORT
@@ -568,6 +574,13 @@
#endif
+/* Define to 1 if we found a declaration for 'sigaltstack', otherwise define
+ to 0. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_DECL_SIGALTSTACK
+#endif
+
+
/* Define to 1 if we found a declaration for 'snprintf', otherwise define to
0. */
#ifndef USED_FOR_TARGET
diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c
index 75c92a2a25b..b0fc7c68326 100644
--- a/gcc/config/rs6000/host-darwin.c
+++ b/gcc/config/rs6000/host-darwin.c
@@ -33,9 +33,19 @@ static void segv_crash_handler (int);
static void segv_handler (int, siginfo_t *, void *);
static void darwin_rs6000_extra_signals (void);
+#ifndef HAVE_DECL_SIGALTSTACK
/* This doesn't have a prototype in signal.h in 10.2.x and earlier,
fixed in later releases. */
extern int sigaltstack(const struct sigaltstack *, struct sigaltstack *);
+#endif
+
+/* The fields of the mcontext_t type have acquired underscores in later
+ OS versions. */
+#ifdef HAS_MCONTEXT_T_UNDERSCORES
+#define MC_FLD(x) __ ## x
+#else
+#define MC_FLD(x) x
+#endif
#undef HOST_HOOKS_EXTRA_SIGNALS
#define HOST_HOOKS_EXTRA_SIGNALS darwin_rs6000_extra_signals
@@ -68,7 +78,7 @@ segv_handler (int sig ATTRIBUTE_UNUSED,
sigaddset (&sigset, SIGSEGV);
sigprocmask (SIG_UNBLOCK, &sigset, NULL);
- faulting_insn = *(unsigned *)uc->uc_mcontext->ss.srr0;
+ faulting_insn = *(unsigned *)uc->uc_mcontext->MC_FLD(ss).MC_FLD(srr0);
/* Note that this only has to work for GCC, so we don't have to deal
with all the possible cases (GCC has no AltiVec code, for
@@ -117,7 +127,8 @@ segv_handler (int sig ATTRIBUTE_UNUSED,
}
fprintf (stderr, "[address=%08lx pc=%08x]\n",
- uc->uc_mcontext->es.dar, uc->uc_mcontext->ss.srr0);
+ uc->uc_mcontext->MC_FLD(es).MC_FLD(dar),
+ uc->uc_mcontext->MC_FLD(ss).MC_FLD(srr0));
internal_error ("Segmentation Fault");
exit (FATAL_EXIT_CODE);
}
diff --git a/gcc/configure b/gcc/configure
index 827d139c88d..60e753020f7 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -11756,6 +11756,88 @@ fi
done
+
+for ac_func in sigaltstack
+do
+ ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
+echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
+echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6
+if eval "test \"\${gcc_cv_have_decl_$ac_func+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. */
+#undef $ac_tr_decl
+#define $ac_tr_decl 1
+
+#include "ansidecl.h"
+#include "system.h"
+#include <signal.h>
+
+
+int
+main ()
+{
+#ifndef $ac_func
+char *(*pfn) = (char *(*)) $ac_func ;
+#endif
+ ;
+ 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
+ eval "gcc_cv_have_decl_$ac_func=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "gcc_cv_have_decl_$ac_func=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF
+#define $ac_tr_decl 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF
+#define $ac_tr_decl 0
+_ACEOF
+
+fi
+
+done
+
+
# More time-related stuff.
echo "$as_me:$LINENO: checking for struct tms" >&5
echo $ECHO_N "checking for struct tms... $ECHO_C" >&6
@@ -12195,6 +12277,62 @@ if test "$host_xm_file" != "$build_xm_file"; then
fi
fi
+case ${host} in
+ powerpc-*-darwin*)
+ echo "$as_me:$LINENO: checking whether mcontext_t fields have underscores" >&5
+echo $ECHO_N "checking whether mcontext_t fields have underscores... $ECHO_C" >&6
+if test "${gcc_cv_mcontext_underscores+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+
+#include <ucontext.h>
+int main() { mcontext_t m; if (m->ss.srr0) 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
+ gcc_cv_mcontext_underscores=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_mcontext_underscores=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_mcontext_underscores" >&5
+echo "${ECHO_T}$gcc_cv_mcontext_underscores" >&6
+ if test $gcc_cv_mcontext_underscores = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_MCONTEXT_T_UNDERSCORES
+_ACEOF
+
+ fi
+ ;;
+esac
+
# ---------
# Threading
# ---------
diff --git a/gcc/configure.ac b/gcc/configure.ac
index a055581a451..d4d09f5dffd 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1154,6 +1154,12 @@ gcc_AC_CHECK_DECLS(times, , ,[
#endif
])
+gcc_AC_CHECK_DECLS(sigaltstack, , ,[
+#include "ansidecl.h"
+#include "system.h"
+#include <signal.h>
+])
+
# More time-related stuff.
AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -1337,6 +1343,22 @@ if test "$host_xm_file" != "$build_xm_file"; then
fi
fi
+case ${host} in
+ powerpc-*-darwin*)
+ AC_CACHE_CHECK([whether mcontext_t fields have underscores],
+ gcc_cv_mcontext_underscores,
+ AC_COMPILE_IFELSE([
+#include <ucontext.h>
+int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; }
+],
+ gcc_cv_mcontext_underscores=no, gcc_cv_mcontext_underscores=yes))
+ if test $gcc_cv_mcontext_underscores = yes; then
+ AC_DEFINE(HAS_MCONTEXT_T_UNDERSCORES,,dnl
+ [mcontext_t fields start with __])
+ fi
+ ;;
+esac
+
# ---------
# Threading
# ---------