[MacPorts] #37443: problem using boost_thread with -stdlib=libc++
#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 */ }); t.join(); } }}} 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 test_libc++-crashes 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
#37443: problem using boost_thread with -stdlib=libc++ ----------------------+--------------------------- Reporter: itsme@… | Owner: adfernandes@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: boost | ----------------------+--------------------------- Changes (by ryandesign@…): * owner: macports-tickets@… => adfernandes@… * port: boost, clang++ => boost Comment: I'm not sure this represents a bug in a MacPorts port, so you may have to contact the developers of the software for assistance. -- Ticket URL: <https://trac.macports.org/ticket/37443#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37443: problem using boost_thread with -stdlib=libc++ ----------------------+--------------------------- Reporter: itsme@… | Owner: adfernandes@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: invalid | Keywords: Port: boost | ----------------------+--------------------------- Changes (by adfernandes@…): * status: new => closed * resolution: => invalid Comment: This is not a bug, [http://stackoverflow.com/questions/12542971/using- libstdc-compiled-libraries-with-clang-stdlib-libc it's a feature]! Seriously... the `c++` standard library is very tightly coupled between headers and compiled code, so unless you're very, very careful when mixing compilation units, what you're seeing is a purposeful design (as per the StackOverflow commentary). -- Ticket URL: <https://trac.macports.org/ticket/37443#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts