From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7260 invoked by alias); 14 Jan 2013 19:42:37 -0000 Received: (qmail 7250 invoked by uid 22791); 14 Jan 2013 19:42:36 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f181.google.com (HELO mail-qc0-f181.google.com) (209.85.216.181) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Jan 2013 19:42:30 +0000 Received: by mail-qc0-f181.google.com with SMTP id x40so2709797qcp.26 for ; Mon, 14 Jan 2013 11:42:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.18.136 with SMTP id w8mr74505689qaa.2.1358192549259; Mon, 14 Jan 2013 11:42:29 -0800 (PST) Received: by 10.49.12.210 with HTTP; Mon, 14 Jan 2013 11:42:29 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Jan 2013 19:42:00 -0000 Message-ID: Subject: Re: libgcc patch committed: Change __real_pthread_create ref to be non-weak From: "H.J. Lu" To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00736.txt.bz2 On Mon, Jan 14, 2013 at 11:33 AM, Ian Lance Taylor wrote: > The declaration of __real_pthread_create in generic-morestack-thread.c > had attribute weak. Note that this code is linked with --wrap > pthread_create, so the reference to __real_pthread_create is really to > pthread_create. Using weak was incorrect, because the reference really > is a strong one. There is no support for __real_pthread_create aka > pthread_create to not be defined. It caused some Go programs to fail > when linking statically, because a weak reference does not cause a > symbol definition to be included from an archive. If there was no other > reason to include pthread_create, then pthread_create would never be > defined, so the call to __real_pthread_create would crash at runtime. > > This fixes a regression, as static linking of Go programs used to work. > > Bootstrapped and ran Go testsuite and split-stack tests on > x86_64-unknown-linux-gnu. Committed to mainline. > > Ian > > > 2013-01-14 Ian Lance Taylor > > * generic-morestack-thread.c: Change declaration of > __real_pthread_create to not be weak. > I think you run into: http://sourceware.org/bugzilla/show_bug.cgi?id=14556 -- H.J.