Patchwork [gccgo]

login
register
mail settings
Submitter Ian Taylor
Date July 23, 2010, 11:01 a.m.
Message ID <mcrocdyea2h.fsf@google.com>
Download mbox | patch
Permalink /patch/59766/
State New
Headers show

Comments

Ian Taylor - July 23, 2010, 11:01 a.m.
To correctly use split stacks in a threaded program, the pthread_create
function should be wrapped with a version provided by libgcc.  This
patch changes the gccgo driver to pass -fsplit-stack to the regular
driver in order to make that happen.  This is done in all cases where
split stacks are supported, since the Go compiler always turns them on
when possible.  Committed to gccgo branch.

Ian

Patch

diff -r b317821ab6f9 go/gospec.c
--- a/go/gospec.c	Wed Jul 21 03:14:47 2010 -0700
+++ b/go/gospec.c	Fri Jul 23 03:58:49 2010 -0700
@@ -225,11 +225,11 @@ 
   /* We always combine all input files.  */
   arglist[j++] = "-combine";
 
-  /* If we are going to link in libgo, force __go_register_types to be
-     pulled in.  This will let the runtime support code find the type
-     descriptors.  */
-  if (library > 0)
-    arglist[j++] = "-Wl,-u,__go_register_types";
+  /* If we are linking, pass -fsplit-stack if it is supported.  */
+#ifdef TARGET_SUPPORTS_SPLIT_STACK
+  if (library >= 0)
+    arglist[j++] = "-fsplit-stack";
+#endif
 
   /* NOTE: We start at 1 now, not 0.  */
   while (i < argc)