mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Cc: Gregor Richards <gr@purdue.edu>
Subject: Re: Latest pkgsrc results [What builds on musl 0.9.13?]
Date: Sun, 10 Nov 2013 13:22:33 -0500	[thread overview]
Message-ID: <20131110182233.GJ24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <20131110171412.GK1685@port70.net>

On Sun, Nov 10, 2013 at 06:14:13PM +0100, Szabolcs Nagy wrote:
> * Rich Felker <dalias@aerifal.cx> [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


  reply	other threads:[~2013-11-10 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07  0:34 Gregor Richards
2013-11-07  2:01 ` Szabolcs Nagy
2013-11-07  2:22   ` Gregor Richards
2013-11-07  2:46     ` Szabolcs Nagy
2013-11-07 23:46       ` Szabolcs Nagy
2013-11-08 10:48         ` John Spencer
2013-11-09  1:01         ` Rich Felker
2013-11-09  4:02           ` Szabolcs Nagy
2013-11-09  5:20             ` Rich Felker
2013-11-09 16:16               ` Szabolcs Nagy
2013-11-09 16:41                 ` Rich Felker
2013-11-10 17:14                   ` Szabolcs Nagy
2013-11-10 18:22                     ` Rich Felker [this message]
2013-11-28  3:23               ` Rob Landley
2013-11-29 17:49                 ` Rich Felker
2013-11-07  4:50 ` Kurt H Maier
2013-11-07 13:19   ` Kurt H Maier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131110182233.GJ24286@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=gr@purdue.edu \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).