Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 30 Jun 2016 10:58:09 -0400
From: Rich Felker <>
Subject: Re: Issues when building libcxx libcxxabi with MUSL

On Thu, Jun 30, 2016 at 04:36:09PM +0200, Julien Ramseier wrote:
> > Le 30 juin 2016 à 15:38, Rich Felker <> a écrit :
> > 
> > Could you cite the specific text you're looking at? The requirement of
> > static storage was removed by
> > <> but I see nothing allowing
> > the use of mutex values or assigning one to another, which as I
> > understand it is what the offending libc++ code is doing.
> I'm not sure what you mean by "mutex value".

What I mean is any use of an expression of type pthread_mutex_t except
an lvalue whose address is taken to pass to one of the pthread_mutex_*
functions -- and especially, assignment expressions assigning a value
of type pthread_mutex_t to an object of type pthread_mutex_t.

> The libcxx mutex class only uses the PTHREAD_MUTEX_INITIALIZER
> macro as an initializer for its underlying pthread_mutex member.

I don't know modern C++ well enough to evaluate whether that's
accurate. But in the old code this looks like use of a mutex value:

	constexpr mutex() _NOEXCEPT : __m_(_LIBCPP_MUTEX_INITIALIZER) {} 

Maybe I'm misreading it.

> The part of the spec I was referring to is the use of
> PTHREAD_MUTEX_INITIALIZER to initialize non-static mutexes,
> which is what libcxx did and still do with my patch, but in a different
> way to avoid the constexpr issue due to the nested volatile types.

If the old code was actually just an initialization but just failing
to work for some technical C++ reasons, I'm sorry for the noise. In
any case it seems like there's a working fix now.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.