[MacPorts] #37443: problem using boost_thread with -stdlib=libc++

MacPorts noreply at macports.org
Sun Dec 30 04:26:33 PST 2012

#37443: problem using boost_thread with -stdlib=libc++
 Reporter:  itsme@…  |      Owner:  macports-tickets@…
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.1.2
 Keywords:           |       Port:  boost, clang++
 Given this very short test program:
 #include <boost/thread.hpp>
 int main(int,char**)
     boost::thread t([]() { /* nothing */ });

 I compile this using the clang++ compiler ( either apple clang++ or
 macports clang++-mp-3.1 ) like this:
 clang++ -stdlib=libc++ clangthread.cpp  -I /opt/local/include/
 /opt/local/lib/libboost_thread-mt.dylib /opt/local/lib/libboost_system-
 mt.dylib  -std=c++11 -DBOOST_NO_CXX11_NUMERIC_LIMITS -o

 clang++ clangthread.cpp  -I /opt/local/include/ /opt/local/lib
 /libboost_thread-mt.dylib /opt/local/lib/libboost_system-mt.dylib
 -std=c++11 -o test_libstdc++-nocrash

 Now running the version using libc++, i get: {{{Segmentation fault: 11}}}
 while the version with libstdc++ runs just fine.

 When i don't call {{{join}}}  both versions terminate without errors.

Ticket URL: <https://trac.macports.org/ticket/37443>
MacPorts <http://www.macports.org/>
Ports system for Mac OS

More information about the macports-tickets mailing list