diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-15 22:29:35 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-15 22:29:35 +0000 |
commit | ca59d219fea069cdc604aea49ffb4e482b518cee (patch) | |
tree | 8479da6f747b3bcc95251ebeec9fd6caef172543 /libgo | |
parent | a0367cc1accefe75740171915e77b6122b7c9e67 (diff) | |
download | gcc-ca59d219fea069cdc604aea49ffb4e482b518cee.zip gcc-ca59d219fea069cdc604aea49ffb4e482b518cee.tar.gz gcc-ca59d219fea069cdc604aea49ffb4e482b518cee.tar.bz2 |
runtime: Support broken makecontext on Solaris 8/9.
From Rainer Orth.
From-SVN: r184289
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/config.h.in | 3 | ||||
-rwxr-xr-x | libgo/configure | 17 | ||||
-rw-r--r-- | libgo/configure.ac | 18 | ||||
-rw-r--r-- | libgo/runtime/proc.c | 3 |
4 files changed, 41 insertions, 0 deletions
diff --git a/libgo/config.h.in b/libgo/config.h.in index ae81ff4..5318cf5 100644 --- a/libgo/config.h.in +++ b/libgo/config.h.in @@ -182,6 +182,9 @@ */ #undef LT_OBJDIR +/* Define if makecontext expects top of stack in uc_stack. */ +#undef MAKECONTEXT_STACK_TOP + /* Name of package */ #undef PACKAGE diff --git a/libgo/configure b/libgo/configure index 9bbdfe9..7da2e3f 100755 --- a/libgo/configure +++ b/libgo/configure @@ -14873,6 +14873,20 @@ $as_echo "#define HAVE_STRUCT_EXCEPTION 1" >>confdefs.h fi +case "$target" in + sparc*-*-solaris2.[89]*) + libgo_cv_lib_makecontext_stack_top=yes + ;; + *) + libgo_cv_lib_makecontext_stack_top=no + ;; +esac +if test "$libgo_cv_lib_makecontext_stack_top" = "yes"; then + +$as_echo "#define MAKECONTEXT_STACK_TOP 1" >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setcontext clobbers TLS variables" >&5 $as_echo_n "checking whether setcontext clobbers TLS variables... " >&6; } if test "${libgo_cv_lib_setcontext_clobbers_tls+set}" = set; then : @@ -14974,6 +14988,9 @@ main () abort (); c.uc_stack.ss_sp = stack; +#ifdef MAKECONTEXT_STACK_TOP + c.uc_stack.ss_sp += sizeof stack; +#endif c.uc_stack.ss_flags = 0; c.uc_stack.ss_size = sizeof stack; c.uc_link = NULL; diff --git a/libgo/configure.ac b/libgo/configure.ac index 249918b..479ced0e 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -611,6 +611,21 @@ if test "$libgo_has_struct_exception" = "yes"; then [Define to 1 if <math.h> defines struct exception]) fi +dnl Check if makecontext expects the uc_stack member of ucontext to point +dnl to the top of the stack. +case "$target" in + sparc*-*-solaris2.[[89]]*) + libgo_cv_lib_makecontext_stack_top=yes + ;; + *) + libgo_cv_lib_makecontext_stack_top=no + ;; +esac +if test "$libgo_cv_lib_makecontext_stack_top" = "yes"; then + AC_DEFINE(MAKECONTEXT_STACK_TOP, 1, + [Define if makecontext expects top of stack in uc_stack.]) +fi + dnl See whether setcontext changes the value of TLS variables. AC_CACHE_CHECK([whether setcontext clobbers TLS variables], [libgo_cv_lib_setcontext_clobbers_tls], @@ -667,6 +682,9 @@ main () abort (); c.uc_stack.ss_sp = stack; +#ifdef MAKECONTEXT_STACK_TOP + c.uc_stack.ss_sp += sizeof stack; +#endif c.uc_stack.ss_flags = 0; c.uc_stack.ss_size = sizeof stack; c.uc_link = NULL; diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index 609920a..d7e1e5f 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -1316,6 +1316,9 @@ __go_go(void (*fn)(void*), void* arg) getcontext(&newg->context); newg->context.uc_stack.ss_sp = sp; +#ifdef MAKECONTEXT_STACK_TOP + newg->context.uc_stack.ss_sp += spsize; +#endif newg->context.uc_stack.ss_size = spsize; makecontext(&newg->context, kickoff, 0); |