From patchwork Fri Jul 23 11:01:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 59766 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1A1001007D1 for ; Fri, 23 Jul 2010 21:01:46 +1000 (EST) Received: (qmail 13350 invoked by alias); 23 Jul 2010 11:01:45 -0000 Received: (qmail 13307 invoked by uid 22791); 23 Jul 2010 11:01:44 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Jul 2010 11:01:38 +0000 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id o6NB1XVT005855 for ; Fri, 23 Jul 2010 04:01:33 -0700 Received: from ewy28 (ewy28.prod.google.com [10.241.103.28]) by kpbe19.cbf.corp.google.com with ESMTP id o6NB1VGo008150 for ; Fri, 23 Jul 2010 04:01:32 -0700 Received: by ewy28 with SMTP id 28so33314ewy.14 for ; Fri, 23 Jul 2010 04:01:31 -0700 (PDT) Received: by 10.213.17.195 with SMTP id t3mr321591eba.61.1279882891441; Fri, 23 Jul 2010 04:01:31 -0700 (PDT) Received: from coign.google.com (dhcp-172-28-249-136.lul.corp.google.com [172.28.249.136]) by mx.google.com with ESMTPS id z55sm180069eeh.15.2010.07.23.04.01.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Jul 2010 04:01:28 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: [gccgo] Date: Fri, 23 Jul 2010 04:01:26 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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)