[cfe-dev] clang libc++ libcxxabi std::thread std::async

David Irvine david.irvine at maidsafe.net
Tue May 29 12:18:32 PDT 2012


Yes, it's almost enough for me to get to FreeBSD, particularly as I really
like the bsd licence, sad as that may seem :-). I think 10 will be switched
over completely to clang/libc++. I see libcxxab now reports to have nearly
everything done for linux, but I cannot see how it's built at all, I hoped
it would build with libc++ as part of cmake, but alas !!

I think FreeBSD has libc++ set up as some filter library which I do not
understand but if this worked on linux it would be great as we (in house)
have moved to c++11 and until libc++ can seat itself with some abi
implementation that allows std::async etc. I am afraid I code/check/compile
in clang and compile/run in gcc 4.6 and 4.7.

Thanks
David
On Tue, May 29, 2012 at 3:22 PM, David Chisnall <csdavec at swan.ac.uk> wrote:

> I can't speak for Linux, but I just tried your example on FreeBSD 9-STABLE
> with the default configuration of clang++, libc++ and libcxxrt that ship as
> part of the base system and it worked correctly with the following compile
> command:
>
> $ clang++ -std=c++11 thread.cc -o thread -pthread -stdlib=libc++
>
> David
>
> On 29 May 2012, at 14:36, David Irvine wrote:
>
> > I am curious if anyone has been able to get clang++ to run std::async in
> linux at all. If so the process would be great. I have tried TOT + libc++,
> with stdc++ and also the recently released binaries. In no configuration
> can I get this to work. As recently reported (not by me) in another mail
> (lost now), the following fails :
> >
> > #include <thread>
> >
> >    void f(){}
> >
> >    int main() {
> >       std::thread t(f);
> >       t.join();
> >    }
> >
> > compiled with
> >
> > clang++ -std=c++11 thread.cc -o thread -pthread
> >
> > output
> >
> >  ./thread
> > pure virtual method called
> > terminate called without an active exception
> > Aborted (core dumped)
> >
> > using
> >
> > clang++ --version
> > clang version 3.1 (tags/RELEASE_31/final)
> > Target: x86_64-unknown-linux-gnu
> > Thread model: posix
> >
> > std::async seems to fail at runtime, I think this is due to abi issues
> but cannot be sure.
> >
> > Best Regards
> > David Irvine
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120529/d5517351/attachment.html>


More information about the cfe-dev mailing list