From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/37 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Musl git 0d......455eee8 and recent compilers Date: Mon, 6 Jun 2011 12:47:51 -0400 Message-ID: <20110606164751.GC191@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1307379328 23338 80.91.229.12 (6 Jun 2011 16:55:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 16:55:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-120-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 06 18:55:24 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QTd5B-0002nx-3X for gllmg-musl@lo.gmane.org; Mon, 06 Jun 2011 18:55:17 +0200 Original-Received: (qmail 23593 invoked by uid 550); 6 Jun 2011 16:55:16 -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 23585 invoked from network); 6 Jun 2011 16:55:16 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:37 Archived-At: On Mon, Jun 06, 2011 at 10:48:08AM +0200, Igmar Palsenberg wrote: > Hi, Hi! Thanks for the reports. > I was using Musle as a test for investigating a (completely > unrelated) clang-analyser problem, and I've stumbled upon a couple > of issues > > 1) The struct dirent in include/dirent.h uses a 1 byte array for > d_name. In reality, it's larger : We allocate more space than the > struct. Since muscle requires a C99 compiler anyway, what's keeping > use from using d_name[0] or d_name[] ? If a C89 compiler includes > dirent.h, we're screwed anyway :). That will probably silence GCC > 4.5 and clang, and severely reduce the warnings it gives in similar > cases. While musl requires a C99 compiler, my intent was to minimize breakage when building programs against it using a lesser compiler. This could probably just be changed though. I think the time of caring about compilers that don't support [] is past.. > 2) The NULL pointer dereference in src/time/__asctime.c won't work > with clang : It removes it. I suggest using either __builtin_trap() > or an abort(). If you get to that point, you're in trouble anyway. The best fix is adding volatile. __builtin_trap is compiler-specific and calling abort will pull on bloat for no reason. (Note that raise is actually a rather heavy function due to Linux not directly supporting the correct POSIX semantics with regard to threads, and having to hack it to be async-signal-safe from userspace...) > 3) Clang does't seem to grasp the weak_alias thingy. It need to > check if those parts actually are correct Does it really not support making non-static aliases for static functions? If so that's a major pain that will bloat the symbol table. You can't just remove static though; the functions from which static is removed will have to be renamed so as not to use reserved external names. > 4) Is there a muscl testsuite somewhere ? A partial one: git://git.etalabs.net/libc-testsuite That's mostly quick examples I wrote just to make sure things were basically working while writing musl; it's not exhaustive. Luka is working on a much more extensive set of tests as a GSoC project. Rich