From patchwork Tue Nov 22 01:13:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 126982 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 688D7B6F84 for ; Tue, 22 Nov 2011 12:14:29 +1100 (EST) Received: (qmail 3531 invoked by alias); 22 Nov 2011 01:14:26 -0000 Received: (qmail 3519 invoked by uid 22791); 22 Nov 2011 01:14:25 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from anubis.se.axis.com (HELO anubis.se.axis.com) (195.60.68.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 01:13:41 +0000 Received: from localhost (localhost [127.0.0.1]) by anubis.se.axis.com (Postfix) with ESMTP id 43E0B19D89; Tue, 22 Nov 2011 02:13:38 +0100 (CET) Received: from anubis.se.axis.com ([127.0.0.1]) by localhost (anubis.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Pk6dYHGQD+6K; Tue, 22 Nov 2011 02:13:33 +0100 (CET) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by anubis.se.axis.com (Postfix) with ESMTP id D6A1E19CFA; Tue, 22 Nov 2011 02:13:32 +0100 (CET) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 97D093E0A1; Tue, 22 Nov 2011 02:13:32 +0100 (CET) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id pAM1DWF6008015; Tue, 22 Nov 2011 02:13:32 +0100 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id pAM1DV4E008011; Tue, 22 Nov 2011 02:13:31 +0100 Date: Tue, 22 Nov 2011 02:13:31 +0100 Message-Id: <201111220113.pAM1DV4E008011@ignucius.se.axis.com> From: Hans-Peter Nilsson To: developer@sandoe-acoustics.co.uk CC: bonzini@gnu.org, rth@redhat.com, jakub@redhat.com, dave.korn.cygwin@googlemail.com, gcc-patches@gcc.gnu.org, mrs@gcc.gnu.org In-reply-to: (message from Iain Sandoe on Mon, 21 Nov 2011 11:04:18 +0100) Subject: Re: CFT: Re: libgcc: why emutls.c in LIB2ADDEH instead of LIB2ADD? MIME-Version: 1.0 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 > From: Iain Sandoe > Date: Mon, 21 Nov 2011 11:04:18 +0100 > On 21 Nov 2011, at 09:34, Hans-Peter Nilsson wrote: > > >> From: Paolo Bonzini > >> Sender: Paolo Bonzini > >> Date: Mon, 21 Nov 2011 10:20:39 +0100 > > > >> H-P, can you try bootstrapping your patch on cygwin and/or mingw too > >> before applying it? > > > > Sorry, I don't have that. Dave? > > The reason it was in libgcc_eh (AFAIK, the original implementation pre- > dates my GCC days) - is because there can only be one copy of the > static emutls locking entities in a given exe. I guess it was felt > analogous to the "only one unwinder" rule. > > note also: Darwin links libgcc.a even when using dynamic libs - it > provides eprintf (and the out-of-line GPR/FPR save routines for > powerpc). > > (this is not a total show-stopper, we could provide those things some > other way) I'm not sure how, and as I only intended to fix what seemed like an obvious oversight, I'm just going to fix what's obvious: the lack of an explanatory comment to warn future similar cleanup attempts. Don't forget I at one point had an "ok" while no committer remembered what was the reason! If you have something better than what's below, that'd be welcome. If you were to fix the LIB2ADDEH-abuse, that'd be welcome too, but maybe that's not proper stage-3-material. ;-) * Makefile.in ($(srcdir)/emutls.c): Explain why it's in LIB2ADDEH et al. brgds, H-P Index: Makefile.in =================================================================== --- Makefile.in (revision 181531) +++ Makefile.in (working copy) @@ -394,6 +394,9 @@ endif LIB2ADD += enable-execute-stack.c +# While emutls.c has nothing to do with EH, it is in LIB2ADDEH* +# instead of LIB2ADD because that's the way to be sure on some targets +# (e.g. *-*-darwin*) only one copy of it is linked. LIB2ADDEH += $(srcdir)/emutls.c LIB2ADDEHSTATIC += $(srcdir)/emutls.c LIB2ADDEHSHARED += $(srcdir)/emutls.c