From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12779 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Some questions Date: Sun, 29 Apr 2018 23:16:53 -0400 Message-ID: <20180430031653.GI1392@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1525058102 10700 195.159.176.226 (30 Apr 2018 03:15:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Apr 2018 03:15:02 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12795-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 30 05:14:57 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fCzHF-0002h3-IK for gllmg-musl@m.gmane.org; Mon, 30 Apr 2018 05:14:57 +0200 Original-Received: (qmail 9745 invoked by uid 550); 30 Apr 2018 03:17:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 9724 invoked from network); 30 Apr 2018 03:17:05 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12779 Archived-At: On Mon, Apr 30, 2018 at 12:52:06PM +1000, Patrick Oppenlander wrote: > Hi, > > while working on another project I've been looking through quite a bit > of the musl code and have come up with a few minor questions I think > worth raising: > > - Is there a way that spinlocks could be disabled or bypassed on > uniprocessor systems? Whether locks are needed is a matter of whether there are multiple threads, not whether it's uniprocessor or multiprocessor. For some things where it's likely to matter (stdio, malloc, some other internals), locks are already optimized out when there is only one thread. In other cases it was deemed either too costly/difficult or irrelevant to overall performance. > - sigisemptyset uses bss. Could be implemented in a similar fashion to > sigemptyset, save bss & would probably be faster. Ahh, yes. I wonder if gcc has any way to force const zero objects into rodata rather than bss..? In any case memcmp is not an efficient way to implement this, so maybe it should be changed. > - getcwd returned buffer size can be incorrect. If you call > getcwd(NULL, 1234) the returned buffer is sized to match the path > length but should be 1234 to be compatible with the glibc extension. I'll look at this. It seems like a worse behavior for most callers, but maybe it should match. > - Are there any plans to support static linking with LTO? It should be possible, but gcc mishandles the crt files when doing LTO. I think if you suppress LTO for them it works. Someone posted results experimenting with it either on the list or IRC channel recently. I'll see if I can find anything useful. Rich