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

David Chisnall csdavec at swan.ac.uk
Tue May 29 07:22:35 PDT 2012


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





More information about the cfe-dev mailing list