From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2150 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: TLS (thread-local storage) support Date: Fri, 19 Oct 2012 14:41:35 -0400 Message-ID: <20121019184135.GQ254@brightrain.aerifal.cx> References: <20121004211332.GA12874@brightrain.aerifal.cx> <20121004223631.GL254@brightrain.aerifal.cx> <20121020023943.41a525b4@sibserver.ru> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1350672618 9372 80.91.229.3 (19 Oct 2012 18:50:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Oct 2012 18:50:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2151-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 19 20:50:26 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TPHeK-0005lw-Uz for gllmg-musl@plane.gmane.org; Fri, 19 Oct 2012 20:50:25 +0200 Original-Received: (qmail 31834 invoked by uid 550); 19 Oct 2012 18:50:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31826 invoked from network); 19 Oct 2012 18:50:17 -0000 Content-Disposition: inline In-Reply-To: <20121020023943.41a525b4@sibserver.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2150 Archived-At: On Sat, Oct 20, 2012 at 02:39:43AM +0800, orc wrote: > > 4) Compile musl with '-fsplit-stack' and add no_split_stack attribute > > to appropriate functions (at least all functions called before > > pthread_self_init because %gs or %fs register is unusable before this > > call). > > > > 5) set main thread stack limit to 0 (pthread_self_init) : the main > > thread stack grow is handled by the kernel. > > > > 6) add no-split-stack note to every asm file. > Why anything works only after putting a weak spikes that break after a > slight touch? I don't follow what you're saying here. > > 7) make split stack support optional (either by checking the > > -fsplit-stack option in CFLAGS or with a specific option : > > --enable-split-stack) : split stack adds overhead to every functions > > (except for those with the 'no_split_stack' attribute). > > > > > Do you have any concern about adding those features in musl ? > > > > > > Let me know if you see other issues I haven't noticed. > > > > > > > > > Regards, > > > > > > Boris > > After reading whole thread I agree with Rich that this one is not only > hard to implement, but completely useless. From other point of view: I think it's hard (read: probably impossible) to implement in a way that's robust and correct, but it may not be too hard to implement the minimal support code so that folks who insist on using -fsplit-stack will not get pathologically bad behavior due to the calling code being unaware that is already has a plenty pre-allocated stack space to run on. > people expect from musl an easy to read and understand code, that not > only works, but is easy to understand, modify, debug and build. Why > extend it with features not even related to libc? (It is mostly a hack > from gcc-binutils again?) I agree. I definitely don't want to compromise on correctness/robustness for the sake of this, and I'd also like to avoid adding complexity or maintenance burdens. Rich