From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4221 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Latest pkgsrc results [What builds on musl 0.9.13?] Date: Sun, 10 Nov 2013 13:22:33 -0500 Message-ID: <20131110182233.GJ24286@brightrain.aerifal.cx> References: <20131107020120.GY1685@port70.net> <527AF956.1010400@purdue.edu> <20131107024652.GA1685@port70.net> <20131107234630.GC1685@port70.net> <20131109010129.GD24286@brightrain.aerifal.cx> <20131109040252.GG1685@port70.net> <20131109052010.GE24286@brightrain.aerifal.cx> <20131109161655.GI1685@port70.net> <20131109164147.GH24286@brightrain.aerifal.cx> <20131110171412.GK1685@port70.net> 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 1384107763 9854 80.91.229.3 (10 Nov 2013 18:22:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Nov 2013 18:22:43 +0000 (UTC) Cc: Gregor Richards To: musl@lists.openwall.com Original-X-From: musl-return-4225-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 10 19:22:49 2013 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 1VfZeq-0002M7-AP for gllmg-musl@plane.gmane.org; Sun, 10 Nov 2013 19:22:48 +0100 Original-Received: (qmail 32274 invoked by uid 550); 10 Nov 2013 18:22:47 -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 32266 invoked from network); 10 Nov 2013 18:22:46 -0000 Content-Disposition: inline In-Reply-To: <20131110171412.GK1685@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4221 Archived-At: On Sun, Nov 10, 2013 at 06:14:13PM +0100, Szabolcs Nagy wrote: > * Rich Felker [2013-11-09 11:41:47 -0500]: > > On Sat, Nov 09, 2013 at 05:16:55PM +0100, Szabolcs Nagy wrote: > > > this is sad > > > so c++ code that includes mm_malloc.h and stdlib.h will fail > > > > What is mm_malloc.h and why is it declaring malloc itself rather than > > including stdlib.h? > > > > it declares posix_memalign and defined _mm_malloc and _mm_free > > i think it was added to gcc so it is possible to allocate memory > for the sse intrinsics with the right alignment (included in > xmmintrin.h which follows the intel and msvc api, see bug report) > > and for c++ they add throw() to posix_memalign so it's incompatible > with the libc one hence boost fails to build (or anythning that > uses both xmmintrin.h and stdlib.h) > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16570 I see. Well eseentially, the "linux" mm_malloc.h in gcc is glibc-specific, then. (BTW, if these prototypes are incompatible, I think it also means the glibc prototypes are non-conforming to the C++ standard, but that's an entirely separare issue.) I'm not sure what the proper fix is, though. Would declaring the extern function with scope local to the _mm_malloc function, rather than file scope, fix the problem? If so, that could probably be upstreamed in gcc. Another valid gcc-level fix would be: extern "C" int __gcc_posix_memalign (void **, size_t, size_t) __attribute__((__alias__("posix_memalign"))) throw (); I'm leaning towards considering this the superior fix, as it also avoids polluting the namespace with posix_memalign like gcc is currently doing. Rich