Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753435Ab1DJOcU (ORCPT ); Sun, 10 Apr 2011 10:32:20 -0400 Received: from paul.0au.de ([94.23.237.123]:36231 "EHLO 0au.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884Ab1DJOcU (ORCPT ); Sun, 10 Apr 2011 10:32:20 -0400 X-Spam-Score: -1.9 Date: Sun, 10 Apr 2011 16:31:54 +0200 From: Valentin Ochs Cc: Michal Marek , Roman Zippel , trivial@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kconfig/kbuild: define _POSIX_C_SOURCE Message-ID: <20110410143153.GJ4663@erwin> References: <20110410020923.GI4663@erwin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2786 Lines: 65 Thanks for the answer! On Sat, Apr 09, 2011 at 11:34:00PM -0400, Arnaud Lacombe wrote: > Hi, > > On Sat, Apr 9, 2011 at 10:09 PM, Valentin Ochs wrote: > > The three patched files use PATH_MAX without defining the required > > _POSIX_C_SOURCE feature test macro.  This prevents compilation with the > > musl libc.  The patch applies to 2.6.38.2. > > > > Changes since v1: > >  - fix scripts/kconfig/lex.zconf.c_shipped > this file is autogenerated from zconf.l, which should be updated as > well. I'm not sure how you searched for PATH_MAX, but you're still > missing `confdata.c' and `nconf.c'. To be honest, I only fixed the files that did not compile when I ran 'make menuconfig'. It didn't even occur to me that it could be in other files as well. I've grepped for it now, and there are lots of other files that use PATH_MAX - it's probably safe to assume that kernel/* and fs/* use the limits.h in include/linux. What about the files in tools/*? Would it be preferable to have the makefile define _POSIX_C_SOURCE, or is that too hackish? > I had a quick look to different libc implementation, glibc and uClibc > default to _POSIX_C_SOURCE == 200112L, FreeBSD >8.0 defaults to > 200809L for >8.0, FreeBSD 7.x to 200112L. I got the value I used from the Open Group System Interfaces specification, but the musl author said that 200112L would be fine too. > None of these seems to requires _POSIX_C_SOURCE to define PATH_MAX, so > I'm not certain of the requirement of the change. While I don't want to appear like a language lawyer, the specification says that 'all symbols required by POSIX.1-2008 to appear when the header is included shall be made visible' when an application defines _POSIX_C_SOURCE. I guess the musl author interprets that as 'if you don't define the feature test macros, you're not getting PATH_MAX.' This does not seem to be incorrect behaviour to me. > Moreover, musl libc seems to be really young (first public version > less than two month old), and still marked "alpha", not sure if its > the best time to start fixing things. I don't think that the musl headers are going to change much in that regard, and the patch only changes the files to better conform to POSIX. But if you don't want to apply the patch now, I can resubmit it in a few months and just ask the musl author to put it on the musl website for now. Best regards, Valentin > - Arnaud > > >  - fix scripts/kconfig/mconf.c > > > > Sorry about the incomplete patch I sent a few hours ago, it won't > > happen again. :) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/