Boost C++ Libraries: Ticket #4381: GCC previous to 4.3.x does not implement inclass member initialization https://svn.boost.org/trac10/ticket/4381 <p> o Add compile gcc option to make sure that boost compilation toolchain </p> <blockquote> <p> acknowledges that gcc versions prior to 4.3.x do not implement inclass member initialization. </p> </blockquote> <p> o This enables libtorrent-rasterbar 1.4.x to build python </p> <blockquote> <p> bindings with the base system gcc on FreeBSD 8.x. Previously, we would have had to resort gcc 4.3+ ports. </p> </blockquote> <p> o Further information can be found at </p> <p> <a class="ext-link" href="http://www.freebsd.org/cgi/query-pr.cgi?pr=144336"><span class="icon">​</span>http://www.freebsd.org/cgi/query-pr.cgi?pr=144336</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4381 Trac 1.4.3 Mario Ferreira <lioux@…> Sat, 26 Jun 2010 10:00:57 GMT attachment set https://svn.boost.org/trac10/ticket/4381 https://svn.boost.org/trac10/ticket/4381 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch-boost__config__compiler__gcc.hpp</span> </li> </ul> <p> Define BOOST_NO_INCLASS_MEMBER_INITIALIZATION on gcc versions prior to 4.3.x </p> Ticket anonymous Sat, 26 Jun 2010 10:13:06 GMT component changed; owner set https://svn.boost.org/trac10/ticket/4381#comment:1 https://svn.boost.org/trac10/ticket/4381#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">John Maddock</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">config</span> </li> </ul> Ticket John Maddock Sat, 26 Jun 2010 16:07:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4381#comment:2 https://svn.boost.org/trac10/ticket/4381#comment:2 <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">invalid</span> </li> </ul> <p> Sorry, but this is very much the wrong patch - gcc has implemented this since gcc-2.95. </p> <p> Whatever the issue is, this is the wrong solution. </p> Ticket Mario Ferreira <lioux@…> Sat, 26 Jun 2010 21:25:07 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4381#comment:3 https://svn.boost.org/trac10/ticket/4381#comment:3 <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">invalid</span> </li> </ul> <blockquote> <p> Humm, that patch fixed the build of libtorrent-rasterbar 1.4.10 python </p> </blockquote> <p> bindings with gcc 4.2.1 on FreeBSD 8-STABLE. </p> <p> $ uname -a FreeBSD exxodus.fedaykin.here 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10" title="#10: Bugs: allyourbase.jam file is bad. (closed: Out of Date)">#10</a>: Thu Jun 17 12:28:13 BRT 2010 lioux@exxodus:/usr/obj/usr/src/sys/LIOUX amd64 </p> <blockquote> <p> If that is not the proper patch, what other gcc 4.2.1 compilation </p> </blockquote> <p> glitch could have been avoided by setting that flag? </p> <blockquote> <p> I recompiled boost-libs without the patch then tried to compile the </p> </blockquote> <p> python bindings again. Then I got the following error: </p> <hr /> <p> /usr/local/libexec/ccache/cc -DNDEBUG -O2 -pipe -march=athlon64 -D<span class="underline">wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -O2 -pipe -march=athlon64 -fno-strict-aliasing -fPIC -I/usr/local/include -I/usr/local/include/libtorrent -I/usr/local/include -I/usr/include/openssl -I/usr/local/include/python2.6 -c src/extensions.cpp -o build/temp.freebsd-8.1-PRERELEASE-amd64-2.6/src/extensions.o -DHAVE_SSL -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION /usr/local/include/boost/type_traits/detail/cv_traits_impl.hpp: In instantiation of 'const bool boost::detail::cv_traits_imp&lt;&lt;unnamed&gt;::torrent_plugin_wrap*&gt;::is_volatile': /usr/local/include/boost/type_traits/is_volatile.hpp:52: instantiated from 'boost::is_volatile&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/type_traits/remove_const.hpp:54: instantiated from 'boost::detail::remove_const_impl&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/type_traits/remove_const.hpp:61: instantiated from 'boost::remove_const&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/python/object/pointer_holder.hpp:127: instantiated from 'void* boost::python::objects::pointer_holder&lt;Pointer, Value&gt;::holds(boost::python::type_info, bool) [with Pointer = boost::shared_ptr&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;, Value = &lt;unnamed&gt;::torrent_plugin_wrap]' src/extensions.cpp:168: instantiated from here /usr/local/include/boost/type_traits/detail/cv_traits_impl.hpp:38: internal compiler error: in make_rtl_for_nonlocal_decl, at cc1plus/../../../../contrib/gcc/cp/decl.c:4971 Please submit a full bug report, with preprocessed source if appropriate. See &lt;URL:http://gcc.gnu.org/bugs.html&gt; for instructions. error: command '/usr/local/libexec/ccache/cc' failed with exit status 1 <strong>* Error code 1 1 error </strong>* Error code 1 </span></p> <hr /> <blockquote> <p> Then I tried to obtain the preprocessed source with: </p> </blockquote> <p> $ gcc -v -save-temps -DNDEBUG -O2 -pipe -march=athlon64 -D<span class="underline">wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -O2 -pipe -march=athlon64 -fno-strict-aliasing -fPIC -I/usr/local/include -I/usr/local/include/libtorrent -I/usr/local/include -I/usr/include/openssl -I/usr/local/include/python2.6 -c src/extensions.cpp -o build/temp.freebsd-8.1-PRERELEASE-amd64-2.6/src/extensions.o -DHAVE_SSL -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION </span></p> <blockquote> <p> The source and preprocessed files </p> </blockquote> <p> ./src/extensions.cpp ./extensions.ii ./extensions.s </p> <p> can be found at </p> <p> <a class="ext-link" href="http://people.freebsd.org/~lioux/extensions_src__and__preprocessed.tar.gz"><span class="icon">​</span>http://people.freebsd.org/~lioux/extensions_src__and__preprocessed.tar.gz</a>. </p> <hr /> <p> gcc: warning: -pipe ignored because -save-temps specified Using built-in specs. Target: amd64-undermydesk-freebsd Configured with: FreeBSD/amd64 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD] </p> <blockquote> <p> /usr/libexec/cc1plus -E -quiet -v -I/usr/local/include </p> </blockquote> <p> -I/usr/local/include/libtorrent -I/usr/local/include -I/usr/include/openssl -I/usr/local/include/python2.6 -D_LONGLONG -DNDEBUG -D<span class="underline">wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -DHAVE_SSL -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION src/extensions.cpp -march=athlon64 -march=athlon64 -fno-strict-aliasing -fPIC -O2 -O2 -fpch-preprocess -o extensions.ii ignoring duplicate directory "/usr/include" ignoring duplicate directory "/usr/local/include" #include "..." search starts here: #include &lt;...&gt; search starts here: </span></p> <blockquote> <p> /usr/local/include /usr/local/include/libtorrent /usr/include/openssl /usr/local/include/python2.6 /usr/include/c++/4.2 /usr/include/c++/4.2/backward /usr/include </p> </blockquote> <p> End of search list. </p> <blockquote> <p> /usr/libexec/cc1plus -fpreprocessed extensions.ii -quiet -dumpbase </p> </blockquote> <p> extensions.cpp -march=athlon64 -march=athlon64 -auxbase-strip build/temp.freebsd-8.1-PRERELEASE-amd64-2.6/src/extensions.o -O2 -O2 -version -fno-strict-aliasing -fPIC -o extensions.s GNU C++ version 4.2.1 20070719 [FreeBSD] (amd64-undermydesk-freebsd) </p> <blockquote> <p> compiled by GNU C version 4.2.1 20070719 [FreeBSD]. </p> </blockquote> <p> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 00c8d3715b4cad4e2f9456e93053adc2 /usr/local/include/boost/type_traits/detail/cv_traits_impl.hpp: In instantiation of 'const bool boost::detail::cv_traits_imp&lt;&lt;unnamed&gt;::torrent_plugin_wrap*&gt;::is_volatile': /usr/local/include/boost/type_traits/is_volatile.hpp:52: instantiated from 'boost::is_volatile&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/type_traits/remove_const.hpp:54: instantiated from 'boost::detail::remove_const_impl&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/type_traits/remove_const.hpp:61: instantiated from 'boost::remove_const&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;' /usr/local/include/boost/python/object/pointer_holder.hpp:127: instantiated from 'void* boost::python::objects::pointer_holder&lt;Pointer, Value&gt;::holds(boost::python::type_info, bool) [with Pointer = boost::shared_ptr&lt;&lt;unnamed&gt;::torrent_plugin_wrap&gt;, Value = &lt;unnamed&gt;::torrent_plugin_wrap]' src/extensions.cpp:168: instantiated from here /usr/local/include/boost/type_traits/detail/cv_traits_impl.hpp:38: internal compiler error: in make_rtl_for_nonlocal_decl, at cc1plus/../../../../contrib/gcc/cp/decl.c:4971 </p> <hr /> <blockquote> <p> The offending 4971 from decl.c follows: </p> </blockquote> <hr /> <p> 4963: /* If we see a class member here, it should be a static data 4964: member. */ 4965: if (DECL_LANG_SPECIFIC (decl) &amp;&amp; DECL_IN_AGGR_P (decl)) 4966: { 4967: gcc_assert (TREE_STATIC (decl)); 4968: /* An in-class declaration of a static data member should be 4969: external; it is only a declaration, and not a definition. */ 4970: if (init == NULL_TREE) 4971: gcc_assert (DECL_EXTERNAL (decl)); 4972: } </p> <hr /> Ticket John Maddock Tue, 29 Jun 2010 17:00:13 GMT owner, status, component changed https://svn.boost.org/trac10/ticket/4381#comment:4 https://svn.boost.org/trac10/ticket/4381#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Dave Abrahams</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> <li><strong>component</strong> <span class="trac-field-old">config</span> → <span class="trac-field-new">Python</span> </li> </ul> <p> This is strange as our regression tests are passing for that compiler. </p> <p> Also are you compiling Boost, or something that uses Boost? </p> <p> The fact that you're getting an internal compiler error tells us that it's a compiler bug, the thing is this: setting BOOST_NO_INCLASS_MEMBER_INITIALIZATION is too big a sledgehammer to fix this particular issue with. </p> <p> I'm reassigning this to the Boost.Python guys, in the meantime if you can produce a reduced test case that would also help a lot. </p> <p> John. </p> Ticket Steven Watanabe Tue, 29 Jun 2010 17:22:28 GMT <link>https://svn.boost.org/trac10/ticket/4381#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4381#comment:5</guid> <description> <p> Could the issue be related to the unnamed namespace? </p> </description> <category>Ticket</category> </item> <item> <author>Mario Ferreira <lioux@…></author> <pubDate>Tue, 29 Jun 2010 22:12:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4381#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4381#comment:6</guid> <description> <blockquote> <p> I can compile boost 1.43.0 under FreeBSD 8's base GCC 4.2.1 without setting BOOST_NO_INCLASS_MEMBER_INITIALIZATION. </p> </blockquote> <blockquote> <p> BOOST_NO_INCLASS_MEMBER_INITIALIZATION is required to build rasterbar </p> </blockquote> <blockquote> <p> libtorrent 1.4.10 python bindings. rasterbar 1.4.10 can be built but not the python bindings. </p> </blockquote> <blockquote> <blockquote> <p> The offending file for rasterbar 1.4.10 is extensions.cpp as my previous post documents. This is under GCC 4.2.1 available in the FreeBSD 8-STABLE base installation. </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> Please let me know if there is anything I can do to help. </p> </blockquote> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 22 Sep 2010 18:06:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4381#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4381#comment:7</guid> <description> <p> FYI the proposed patch here is already causing other bug reports: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/4669"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/4669</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>