Boost C++ Libraries: Ticket #9610: boost fails to build with clang-3.4 and later https://svn.boost.org/trac10/ticket/9610 <p> boost-1.55.0 fails to build with current versions of clang (3.4 and 3.5). It builds fine with clang-3.3. The error is here: </p> <pre class="wiki">/opt/local/bin/clang++-mp-3.4 -ftemplate-depth-128 -Os -stdlib=libc++ -O3 -finline-functions -Wno-inline -Wall -pedantic -gdwarf-2 -fexceptions -arch i386 -arch x86_64 -Wextra -Wno-long-long -Wno-variadic-macros -Wunused-function -fpermissive -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/link-static/pch-off/threading-multi/pthread/once.o" "libs/thread/src/pthread/once.cpp" In file included from libs/thread/src/pthread/once.cpp:8: In file included from libs/thread/src/pthread/./once_atomic.cpp:9: In file included from ./boost/thread/once.hpp:20: In file included from ./boost/thread/pthread/once_atomic.hpp:20: In file included from ./boost/atomic.hpp:12: In file included from ./boost/atomic/atomic.hpp:17: In file included from ./boost/atomic/detail/platform.hpp:22: ./boost/atomic/detail/gcc-atomic.hpp:961:64: error: no matching constructor for initialization of 'storage_type' (aka 'boost::atomics::detail::storage128_type') explicit base_atomic(value_type const&amp; v) BOOST_NOEXCEPT : v_(0) ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided ./boost/atomic/detail/gcc-atomic.hpp:968:22: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type tmp = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:966:34: warning: unused parameter 'v' [-Wunused-parameter] void store(value_type const&amp; v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT ^ ./boost/atomic/detail/gcc-atomic.hpp:966:50: warning: unused parameter 'order' [-Wunused-parameter] void store(value_type const&amp; v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT ^ ./boost/atomic/detail/gcc-atomic.hpp:983:22: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type tmp = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:981:43: warning: unused parameter 'v' [-Wunused-parameter] value_type exchange(value_type const&amp; v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT ^ ./boost/atomic/detail/gcc-atomic.hpp:981:59: warning: unused parameter 'order' [-Wunused-parameter] value_type exchange(value_type const&amp; v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT ^ ./boost/atomic/detail/gcc-atomic.hpp:997:22: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type expected_s = 0, desired_s = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:997:38: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type expected_s = 0, desired_s = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:993:27: warning: unused parameter 'desired' [-Wunused-parameter] value_type const&amp; desired, ^ ./boost/atomic/detail/gcc-atomic.hpp:994:22: warning: unused parameter 'success_order' [-Wunused-parameter] memory_order success_order, ^ ./boost/atomic/detail/gcc-atomic.hpp:995:22: warning: unused parameter 'failure_order' [-Wunused-parameter] memory_order failure_order) volatile BOOST_NOEXCEPT ^ ./boost/atomic/detail/gcc-atomic.hpp:1013:22: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type expected_s = 0, desired_s = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:1013:38: error: no viable conversion from 'int' to 'storage_type' (aka 'boost::atomics::detail::storage128_type') storage_type expected_s = 0, desired_s = 0; ^ ~ ./boost/atomic/detail/gcc-atomic.hpp:932:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const boost::atomics::detail::storage128_type &amp;' for 1st argument struct BOOST_ALIGNMENT(16) storage128_type ^ ./boost/atomic/detail/gcc-atomic.hpp:1009:27: warning: unused parameter 'desired' [-Wunused-parameter] value_type const&amp; desired, ^ ./boost/atomic/detail/gcc-atomic.hpp:1010:22: warning: unused parameter 'success_order' [-Wunused-parameter] memory_order success_order, ^ ./boost/atomic/detail/gcc-atomic.hpp:1011:22: warning: unused parameter 'failure_order' [-Wunused-parameter] memory_order failure_order) volatile BOOST_NOEXCEPT ^ 10 warnings and 7 errors generated. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9610 Trac 1.4.3 Jeremy Sequoia <jeremyhu@…> Mon, 27 Jan 2014 19:40:45 GMT <link>https://svn.boost.org/trac10/ticket/9610#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:1</guid> <description> <p> Downstream at <a class="ext-link" href="http://trac.macports.org/ticket/42282"><span class="icon">​</span>http://trac.macports.org/ticket/42282</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 26 Feb 2014 21:29:54 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/9610#comment:2 https://svn.boost.org/trac10/ticket/9610#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">timblechmann</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">atomic</span> </li> </ul> Ticket timblechmann Thu, 27 Feb 2014 09:42:29 GMT <link>https://svn.boost.org/trac10/ticket/9610#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:3</guid> <description> <p> seems to be already fixed: 6bb71fdd8f7cc346d90fb14beb38b7297fc1ffd9 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Thu, 27 Feb 2014 09:42:40 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9610#comment:4 https://svn.boost.org/trac10/ticket/9610#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket Jeremy Sequoia <jeremyhu@…> Thu, 27 Feb 2014 23:43:18 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/9610#comment:5 https://svn.boost.org/trac10/ticket/9610#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Nope. That doesn't address the issue in boost/atomic/detail/gcc-atomic.hpp. With that change applied, the build still fails in gcc-atomic.hpp as indicated above: </p> <p> :info:build ./boost/atomic/detail/gcc-atomic.hpp:961:64: error: no matching constructor for initialization of 'storage_type' (aka 'boost::atomics::detail::storage128_type') :info:build explicit base_atomic(value_type const&amp; v) BOOST_NOEXCEPT : v_(0) :info:build <sup> ~ </sup></p> Ticket Andrey Semashev Fri, 28 Feb 2014 08:44:58 GMT <link>https://svn.boost.org/trac10/ticket/9610#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:6</guid> <description> <p> Check if <a class="ext-link" href="https://github.com/boostorg/atomic/commit/e4bde20f2eec0a51be14533871d2123bd2ab9cf3"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/e4bde20f2eec0a51be14533871d2123bd2ab9cf3</a> helps, I cannot test it locally. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Fri, 28 Feb 2014 08:45:16 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/9610#comment:7 https://svn.boost.org/trac10/ticket/9610#comment:7 <ul> <li><strong>cc</strong> <span class="trac-author">Andrey.Semashev@…</span> added </li> </ul> Ticket arto@… Mon, 03 Mar 2014 12:56:06 GMT <link>https://svn.boost.org/trac10/ticket/9610#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:8</guid> <description> <p> The Boost 1.55.0 build with Clang 3.4 successfully completed for me after manually applying the following two patches: </p> <ul><li><a class="ext-link" href="https://github.com/boostorg/atomic/commit/6bb71fdd8f7cc346d90fb14beb38b7297fc1ffd9"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/6bb71fdd8f7cc346d90fb14beb38b7297fc1ffd9</a> </li><li><a class="ext-link" href="https://github.com/boostorg/atomic/commit/e4bde20f2eec0a51be14533871d2123bd2ab9cf3"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/e4bde20f2eec0a51be14533871d2123bd2ab9cf3</a> </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Tue, 11 Mar 2014 17:04:28 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9610#comment:9 https://svn.boost.org/trac10/ticket/9610#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged to master: <a class="ext-link" href="https://github.com/boostorg/atomic/commit/e04ffeb523edb6ac2c3f980878787a4112a4495c"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/e04ffeb523edb6ac2c3f980878787a4112a4495c</a> </p> Ticket ruslan_baratov@… Mon, 02 Jun 2014 14:11:14 GMT <link>https://svn.boost.org/trac10/ticket/9610#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:10</guid> <description> <p> Possible workaround before fix release is add <code>BOOST_HAS_INT128</code> definition </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Mon, 02 Jun 2014 14:14:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9610#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:11</guid> <description> <p> The compiler in topic does not support 128-bit integers, therefore the macro is not defined. </p> </description> <category>Ticket</category> </item> <item> <author>ruslan_baratov@…</author> <pubDate>Mon, 02 Jun 2014 15:23:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9610#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9610#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9610#comment:11" title="Comment 11">andysem</a>: </p> <blockquote class="citation"> <p> The compiler in topic does not support 128-bit integers, therefore the macro is not defined. </p> </blockquote> <p> Note that clang used to build universal library (x86_64 and i386). So result for me (Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn), Xcode 5.1.1): </p> <ul><li>clang++ -arch i386 (OK, without any changes) </li><li>clang++ -arch x86_64 -DBOOST_HAS_INT128=1 (OK) </li></ul><p> To be honest adding <code>BOOST_HAS_INT128</code> will break <code>i386</code> compilation, so this workaround will not help for building universal library)) </p> <p> Related: boost.2283326.n4.nabble.com/config-clang-int128-support-td4653826.html </p> </description> <category>Ticket</category> </item> </channel> </rss>