From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/131 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: cluts review Date: Wed, 13 Jul 2011 09:38:38 -0400 Message-ID: <20110713133838.GA16618@brightrain.aerifal.cx> References: <20110713110723.GA22153@openwall.com> 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 1310564894 30450 80.91.229.12 (13 Jul 2011 13:48:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 13:48:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-215-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 13 15:48:11 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 1QgznK-0006kQ-RP for gllmg-musl@lo.gmane.org; Wed, 13 Jul 2011 15:48:07 +0200 Original-Received: (qmail 2024 invoked by uid 550); 13 Jul 2011 13:48:05 -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 2015 invoked from network); 13 Jul 2011 13:48:05 -0000 Content-Disposition: inline In-Reply-To: <20110713110723.GA22153@openwall.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:131 Archived-At: On Wed, Jul 13, 2011 at 03:07:23PM +0400, Solar Designer wrote: > The uses of SA_NODEFER appeared to be a bug anyway, so I am simply > removing them. It's not a bug. The bug is just that Luka is relying on glibc's practice of defining everything by default. Since the tests are testing a POSIX environment, -D_POSIX_C_SOURCE=200809L (or even -D_XOPEN_SOURCE=700) should be in the CFLAGS. > -std=c99 appears to be needed to get LLONG_MAX, etc. defined by glibc's > header files when compiling with older gcc (I used 3.4.5). Defining the right feature test macros would also fix this, but it's good to have -std=c99 anyway. > +#define _BSD_SOURCE /* for scandir() and alphasort() */ These are POSIX 2008 functions. _BSD_SOURCE should not be needed for anything. > +#include /* for PATH_MAX */ This is a classic error I fought with all the time early in musl's life cycle - it's absolutely the wrong fix. sys/param.h is completely nonstandard. PATH_MAX comes from limits.h, as long as you have the proper feature test macros defined, but it might not be defined, in which case you have to use sysconf/pathconf. That could still come back as "no limit" though, in which case security for functions which need a PATH_MAX-sized buffer is broken... > +#define _XOPEN_SOURCE /* for sigaction() */ Needs a value, not a blank definition. Current version is 700. > - act.sa_flags = SA_NODEFER; > + act.sa_flags = 0; This was being used as part of the longjmp trick. By the way, there are a lot of warnings about local vars potentially clobbered by longjmp. Those are worth checking out. I found gcc was pretty strict about breaking my code in the dynamic linker when I broke the rules for longjmp... Rich