===================================================================
@@ -1,4 +1,4 @@
-23392287e9a26956977987fe95f337c5be4d6417
+6f0ac34e139755c319368757fe2a093f1e5bde49
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
===================================================================
@@ -374,7 +374,29 @@ AC_COMPILE_IFELSE([[int i;]],
[libgo_cv_c_split_stack_supported=yes],
[libgo_cv_c_split_stack_supported=no])
CFLAGS=$CFLAGS_hold])
-if test "$libgo_cv_c_split_stack_supported" = yes; then
+
+dnl Make sure the linker permits -fsplit-stack. Old versions of gold will
+dnl reject split-stack code calling non-split-stack code on targets
+dnl they don't support.
+AC_CACHE_CHECK([whether linker supports split/non-split linked together],
+[libgo_cv_c_linker_split_non_split],
+[cat > conftest1.c << EOF
+extern void f();
+int main() { f(); return 0; }
+EOF
+cat > conftest2.c << EOF
+void f() {}
+EOF
+$CC -c -fsplit-stack $CFLAGS $CPPFLAGS conftest1.c
+$CC -c $CFLAGS $CPPFLAGS conftest2.c
+if $CC -o conftest conftest1.$ac_objext conftest2.$ac_objext; then
+ libgo_cv_c_linker_split_non_split=yes
+else
+ libgo_cv_c_linker_split_non_split=no
+fi
+rm -f conftest1.* conftest2.* conftest])
+
+if test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes; then
SPLIT_STACK=-fsplit-stack
AC_DEFINE(USING_SPLIT_STACK, 1,
[Define if the compiler supports -fsplit-stack])
@@ -383,13 +405,15 @@ else
fi
AC_SUBST(SPLIT_STACK)
AM_CONDITIONAL(USING_SPLIT_STACK,
- test "$libgo_cv_c_split_stack_supported" = yes)
+ test "$libgo_cv_c_split_stack_supported" = yes -a "$libgo_cv_c_linker_split_non_split" = yes)
dnl Check whether the linker does stack munging when calling from
dnl split-stack into non-split-stack code. We check this by looking
dnl at the --help output. FIXME: This is only half right: it's
dnl possible for the linker to support this for some targets but not
dnl others.
+dnl This is slightly different from the above check, which is whether
+dnl the linker permits the call at all.
AC_CACHE_CHECK([whether linker supports split stack],
[libgo_cv_c_linker_supports_split_stack],
[libgo_cv_c_linker_supports_split_stack=no