Another patch for libgo with an old linker: if the compiler supports
-fsplit-stack but the linker does not, then we need to explicitly
compile the Go code with -fno-split-stack.  Otherwise the linker will
complain when linking libgo.so.  This patch fixes the problem.
Bootstrapped on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 227802)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-6f0ac34e139755c319368757fe2a093f1e5bde49
+eac8b31fec761c8da0606a70ae0547ff0b12e8db
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/Makefile.am
===================================================================
--- libgo/Makefile.am   (revision 227777)
+++ libgo/Makefile.am   (working copy)
@@ -2074,7 +2074,7 @@ libnetgo_a_LIBADD = netgo.o
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
 GOCFLAGS = $(CFLAGS)
-AM_GOCFLAGS = $(STRINGOPS_FLAG)
+AM_GOCFLAGS = $(STRINGOPS_FLAG) $(GO_SPLIT_STACK)
 GOCOMPILE = $(GOC) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_GOCFLAGS) $(GOCFLAGS)
 
 LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \
Index: libgo/configure.ac
===================================================================
--- libgo/configure.ac  (revision 227802)
+++ libgo/configure.ac  (working copy)
@@ -407,6 +407,15 @@ AC_SUBST(SPLIT_STACK)
 AM_CONDITIONAL(USING_SPLIT_STACK,
        test "$libgo_cv_c_split_stack_supported" = yes -a 
"$libgo_cv_c_linker_split_non_split" = yes)
 
+dnl If the compiler supports split-stack but the linker does not, then
+dnl we need to explicitly disable split-stack for Go.
+if test "$libgo_cv_c_split_stack_supported" = yes -a 
"$libgo_cv_c_linker_split_non_split" = no; then
+  GO_SPLIT_STACK=-fno-split-stack
+else
+  GO_SPLIT_STACK=
+fi
+AC_SUBST(GO_SPLIT_STACK)
+
 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

Reply via email to