diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-09-15 21:15:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-09-15 21:15:37 +0000 |
commit | a2bf11d16a01ced5d2bd0500a6896627b7bed076 (patch) | |
tree | cc1561d9c684e30e43f7804a87ab7caab0047110 /libgo | |
parent | c8338173d725ca0690f25f54e04171ed6cad6be9 (diff) | |
download | gcc-a2bf11d16a01ced5d2bd0500a6896627b7bed076.zip gcc-a2bf11d16a01ced5d2bd0500a6896627b7bed076.tar.gz gcc-a2bf11d16a01ced5d2bd0500a6896627b7bed076.tar.bz2 |
libgo: If compiler can split-stack and linker can not, use -fno-split-stack.
If the compiler supports split-stack but we are using a gold linker that
does not, as happens on PPC with current GCC but old gold, then we need
to compile the Go code with -fno-split-stack to avoid a linker error
avoid the inability to call from split-stack code to non-split-stack
code.
Reviewed-on: https://go-review.googlesource.com/14598
From-SVN: r227811
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/Makefile.am | 2 | ||||
-rw-r--r-- | libgo/Makefile.in | 3 | ||||
-rwxr-xr-x | libgo/configure | 12 | ||||
-rw-r--r-- | libgo/configure.ac | 9 | ||||
-rw-r--r-- | libgo/testsuite/Makefile.in | 1 |
5 files changed, 23 insertions, 4 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 924dba0..ca2280d 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -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) \ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 5072ceb..5d7b8c9 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -366,6 +366,7 @@ GOCFLAGS = $(CFLAGS) GOOS = @GOOS@ GO_LIBCALL_OS_ARCH_FILE = @GO_LIBCALL_OS_ARCH_FILE@ GO_LIBCALL_OS_FILE = @GO_LIBCALL_OS_FILE@ +GO_SPLIT_STACK = @GO_SPLIT_STACK@ GO_SYSCALL_OS_ARCH_FILE = @GO_SYSCALL_OS_ARCH_FILE@ GO_SYSCALL_OS_FILE = @GO_SYSCALL_OS_FILE@ GREP = @GREP@ @@ -2153,7 +2154,7 @@ libgolibbegin_a_CFLAGS = $(AM_CFLAGS) -fPIC libnetgo_a_SOURCES = $(go_netgo_files) libnetgo_a_LIBADD = netgo.o LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) -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) \ $(AM_GOCFLAGS) $(GOCFLAGS) diff --git a/libgo/configure b/libgo/configure index 9c79574..3dfa1d8 100755 --- a/libgo/configure +++ b/libgo/configure @@ -620,6 +620,7 @@ NET_LIBS MATH_LIBS GOC_IS_LLGO_FALSE GOC_IS_LLGO_TRUE +GO_SPLIT_STACK USING_SPLIT_STACK_FALSE USING_SPLIT_STACK_TRUE SPLIT_STACK @@ -11123,7 +11124,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11126 "configure" +#line 11127 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11229,7 +11230,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11232 "configure" +#line 11233 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14050,6 +14051,13 @@ else fi +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 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker supports split stack" >&5 $as_echo_n "checking whether linker supports split stack... " >&6; } if test "${libgo_cv_c_linker_supports_split_stack+set}" = set; then : diff --git a/libgo/configure.ac b/libgo/configure.ac index ca5325a..15814bab 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -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 diff --git a/libgo/testsuite/Makefile.in b/libgo/testsuite/Makefile.in index b4547a3..ba04a50 100644 --- a/libgo/testsuite/Makefile.in +++ b/libgo/testsuite/Makefile.in @@ -108,6 +108,7 @@ GOCFLAGS = @GOCFLAGS@ GOOS = @GOOS@ GO_LIBCALL_OS_ARCH_FILE = @GO_LIBCALL_OS_ARCH_FILE@ GO_LIBCALL_OS_FILE = @GO_LIBCALL_OS_FILE@ +GO_SPLIT_STACK = @GO_SPLIT_STACK@ GO_SYSCALL_OS_ARCH_FILE = @GO_SYSCALL_OS_ARCH_FILE@ GO_SYSCALL_OS_FILE = @GO_SYSCALL_OS_FILE@ GREP = @GREP@ |