diff mbox

CFT: Re: libgcc: why emutls.c in LIB2ADDEH instead of LIB2ADD?

Message ID 201111220113.pAM1DV4E008011@ignucius.se.axis.com
State New
Headers show

Commit Message

Hans-Peter Nilsson Nov. 22, 2011, 1:13 a.m. UTC
> From: Iain Sandoe <developer@sandoe-acoustics.co.uk>
> Date: Mon, 21 Nov 2011 11:04:18 +0100

> On 21 Nov 2011, at 09:34, Hans-Peter Nilsson wrote:
> 
> >> From: Paolo Bonzini <bonzini@gnu.org>
> >> Sender: Paolo Bonzini <paolo.bonzini@gmail.com>
> >> 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

Comments

Richard Henderson Nov. 22, 2011, 1:46 a.m. UTC | #1
On 11/21/2011 05:13 PM, Hans-Peter Nilsson wrote:
> 	* Makefile.in ($(srcdir)/emutls.c): Explain why it's in
> 	LIB2ADDEH et al.

Definitely ok.  ;-)


r~
diff mbox

Patch

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