Boost C++ Libraries: Ticket #4839: boost_thread will not build with MinGW-w64 and bjam on Windows 7 https://svn.boost.org/trac10/ticket/4839 <p> OS:<br /> Windows 7 Ultimate (64-bit) </p> <p> Compiler:<br /> MinGW-w64 </p> <pre class="wiki">&gt; g++ --version[[BR]] g++ (GCC) 4.5.2 20101015 (prerelease) </pre><p> Command line: </p> <pre class="wiki">bjam.exe toolset=gcc stage --build-type=complete --with-thread &gt;thread.log.txt </pre><p> (I have used bootstrap.bat to build a native version of bjam.exe.) </p> <p> Output: please see attached thread.log.txt. </p> <p> To summarise, boost_thread seems to be the only binary Boost library which won't build in my MinGW-w64 build environment. Running without --with-thread results in 250-odd libboost*.a files in my stage/lib directory (as expected) but without boost_thread. </p> <p> Please see also bug 4804. This is similar but not quite the same bug. His bug occurred while /linking against/ boost_thread; mine occurs while /building/ boost_thread. </p> <p> Thanks for reading. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4839 Trac 1.4.3 fatman@… Thu, 11 Nov 2010 11:04:18 GMT attachment set https://svn.boost.org/trac10/ticket/4839 https://svn.boost.org/trac10/ticket/4839 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">thread.log.txt</span> </li> </ul> <p> Output from bjam with stage and --with-thread on MinGW-w64 </p> Ticket fatman@… Thu, 11 Nov 2010 14:33:16 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:1</guid> <description> <p> Line 45 of the output: </p> <p> <code>./boost/thread/win32/interlocked_read.hpp:71:13: error: cast from 'void*' to 'long int' loses precision</code> </p> <p> suggests we're casting a pointer to a 32-bit integer. We can get away with that in 32 bits, but on a 64-bit system? No kidding it loses precision, we've just thrown away half the pointer. I'm guessing that's not the intended effect? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 16 Nov 2010 20:53:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:2</guid> <description> <p> Hi, </p> <p> it will be useful if you can provide the result of bjam -d2, so we can see the compiler command line. Also useful could be the output of the preprocessing (replace -c in the command line by -E). </p> <p> Best, Vicente </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 16 Nov 2010 20:56:23 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4839#comment:3 https://svn.boost.org/trac10/ticket/4839#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> Ticket fatman@… Wed, 17 Nov 2010 09:37:35 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:4</guid> <description> <p> Thanks Vicente. I'll attach the outputs as soon as they're ready. </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Wed, 17 Nov 2010 21:56:31 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4839 https://svn.boost.org/trac10/ticket/4839 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">thread.log.d2.txt</span> </li> </ul> <p> Same command line but with -d2 at the end, before the redirect </p> Ticket fatman@… Wed, 17 Nov 2010 22:01:46 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:5</guid> <description> <p> Ok, I've run the same command with -d2 at the end: </p> <pre class="wiki">bjam.exe toolset=gcc stage --build-type=complete --with-thread -d2 &gt;thread.log.d2.txt </pre><p> When I add -E to the command line, I get "Invalid option: -E". Are you thinking about a different command? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 27 Nov 2010 15:12:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4839#comment:5" title="Comment 5">fatman@…</a>: </p> <blockquote class="citation"> <p> Ok, I've run the same command with -d2 at the end: </p> <pre class="wiki">bjam.exe toolset=gcc stage --build-type=complete --with-thread -d2 &gt;thread.log.d2.txt </pre><p> When I add -E to the command line, I get "Invalid option: -E". Are you thinking about a different command? </p> </blockquote> <p> Could you try </p> <pre class="wiki"> "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -Wno-long-long -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -E -o "bin.v2\libs\thread\build\gcc-mingw-4.5.2\debug\threading-multi\win32\thread.o" "libs\thread\src\win32\thread.cpp" </pre><p> and check where the first error occurs? </p> </description> <category>Ticket</category> </item> <item> <author>Sebastian Held <sebastian.held@…></author> <pubDate>Tue, 30 Nov 2010 15:12:25 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/4839#comment:7 https://svn.boost.org/trac10/ticket/4839#comment:7 <ul> <li><strong>cc</strong> <span class="trac-author">sebastian.held@…</span> added </li> </ul> Ticket fatman@… Thu, 23 Dec 2010 13:16:19 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:8</guid> <description> <p> Apologies for the delay in replying. I have been away. </p> <p> I will try your suggestion as soon as I get home from work. </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Thu, 23 Dec 2010 22:39:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:9</guid> <description> <p> My build environment has changed slightly. Now: </p> <pre class="wiki">&gt; g++ --version g++ (GCC) 4.4.5 20101001 (release) [svn/rev.164871 - mingw-w64/oz] </pre><p> and I'm using Boost 1.40, and I've generated some new output with the command: </p> <pre class="wiki">bjam.exe toolset=gcc stage --build-type=complete --with-thread &gt;thread.log.txt </pre><p> which I will attach. </p> <p> Vicente, I've altered your command slightly to reflect the change of compiler version. </p> <pre class="wiki">g++ -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -Wno-long-long DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -E -o "bin.v2\libs\thread\build\gcc-mingw-4.4.5\debug\threading-multi\win32\thread.o" "libs\thread\src\win32\thread.cpp" </pre><p> It returns with no output. boost_thread still won't build, though. </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Thu, 23 Dec 2010 22:41:49 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4839 https://svn.boost.org/trac10/ticket/4839 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">thread.log.2.txt</span> </li> </ul> <p> New output from altered environment </p> Ticket Jim Bell <jim@…> Tue, 04 Jan 2011 20:43:47 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:10</guid> <description> <p> As a point of reference, boost.thread builds for my MinGW-64 boost regression test. See <a href="http://www.boost.org/development/tests/trunk/developer/summary.html">the trunk regression matrix</a>, column "Win7-x64 jc-bell.com" (current as of 2011-04-01). </p> <p> Also see patches here: <a class="ext-link" href="http://lists.boost.org/boost-users/2010/12/65214.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2010/12/65214.php</a> </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Tue, 04 Jan 2011 22:20:15 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/4839#comment:11 https://svn.boost.org/trac10/ticket/4839#comment:11 <ul> <li><strong>cc</strong> <span class="trac-author">jim@…</span> added </li> </ul> Ticket fatman@… Wed, 05 Jan 2011 14:49:15 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:12</guid> <description> <p> Thanks Jim, most interesting, although I find the huge tables of test results a bit overwhelming. Some bedtime reading there for sure. </p> <p> In reference to your comment in the patches thread that bootstrap.bat needs hacking to work with gcc, I found I was able to build a native bjam.exe by running tools/jam/build.bat (path?) myself, and IIRC I just had to set the toolchain to gcc in build.bat. Hope that's of use to you. </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Fri, 07 Jan 2011 16:36:45 GMT</pubDate> <title>version, milestone changed https://svn.boost.org/trac10/ticket/4839#comment:13 https://svn.boost.org/trac10/ticket/4839#comment:13 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.46.0</span> </li> </ul> <p> I'm updating the milestone &amp; version on this so that it gets picked up for the 1.46 release. Sadly, though it's marked "showstopper," being marked "Milestone: TBD" and/or "Version: 1.44", it gets missed by the release managers. (Follow the thread back from &lt;<a class="ext-link" href="http://lists.boost.org/Archives/boost/2010/10/172431.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2010/10/172431.php</a>&gt;.) </p> Ticket fatman@… Wed, 19 Jan 2011 22:54:18 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:14</guid> <description> <p> Ah. Hm. I marked the bug as "showstopper" because I am unable to use boost_thread if it won't compile. Was that wrong? </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Wed, 19 Jan 2011 23:07:10 GMT</pubDate> <title>severity changed https://svn.boost.org/trac10/ticket/4839#comment:15 https://svn.boost.org/trac10/ticket/4839#comment:15 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> This is a useful page. -&gt; <a class="ext-link" href="https://svn.boost.org/trac/boost/wiki/TicketWorkflow"><span class="icon">​</span>https://svn.boost.org/trac/boost/wiki/TicketWorkflow</a> </p> <p> Now I can see I set the bug severity way too high. I'll reset it to "problem" since I have no idea if it's a regression or not. </p> Ticket Jim Bell <jim@…> Thu, 20 Jan 2011 17:34:10 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:16</guid> <description> <p> My <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/4839#comment:10"><span class="icon">​</span>regression test</a> promotes it to regression, IMO, once my regression gets running on a regular schedule. </p> <p> And I don't think showstopper is way too high myself. I think 1.46 is going to ship without it, but if I can get my regression-testing act together on this, I say we promote it to showstopper then. </p> <p> This is an important platform and compiler. </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Thu, 20 Jan 2011 21:29:44 GMT</pubDate> <title>severity changed https://svn.boost.org/trac10/ticket/4839#comment:17 https://svn.boost.org/trac10/ticket/4839#comment:17 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> </ul> <p> Good points. Back to "showstopper" then. </p> Ticket mikko.vainio@… Mon, 06 Jun 2011 09:59:38 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:18</guid> <description> <p> I'm seeing this bug in the release branch but not in trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/72431" title="Merged thread changes from trunk">r72431</a>. Will the changes in trunk be merged to release for 1.47.0? </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Mon, 04 Jul 2011 15:58:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:19</guid> <description> <p> Hmm. Well, I hope they fix this some day - guess I'll have to abandon Boost for now. :( </p> </description> <category>Ticket</category> </item> <item> <author>fatman@…</author> <pubDate>Mon, 04 Jul 2011 19:59:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:20</guid> <description> <p> I had a last-ditch poke around in Boost's internals and it looks like I found a workaround. :D </p> <p> Thanks to the OP on bug 4804 for the clue. </p> <p> Applying this patch to boost/detail/interlocked.hpp allows Boost.Thread to build (hopefully not breaking something else): </p> <pre class="wiki">9a10,11 &gt; #define BOOST_USE_WINDOWS_H 1 &gt; </pre><p> Obviously this is not a proper fix; I'm guessing it breaks Boost.Thread on other platforms than Windows. It can be applied to Windows x64 build environments individually. </p> <p> Glad I don't have to ditch Boost after all. :) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 11 Dec 2011 09:27:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:21</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4839#comment:20" title="Comment 20">fatman@…</a>: </p> <blockquote class="citation"> <p> I had a last-ditch poke around in Boost's internals and it looks like I found a workaround. :D </p> <p> Thanks to the OP on bug 4804 for the clue. </p> <p> Applying this patch to boost/detail/interlocked.hpp allows Boost.Thread to build (hopefully not breaking something else): </p> <pre class="wiki">9a10,11 &gt; #define BOOST_USE_WINDOWS_H 1 &gt; </pre><p> Obviously this is not a proper fix; I'm guessing it breaks Boost.Thread on other platforms than Windows. It can be applied to Windows x64 build environments individually. </p> <p> Glad I don't have to ditch Boost after all. :) </p> </blockquote> <p> I don't know if that helps you, you can define BOOST_USE_WINDOWS_H directly on the command line. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 11 Dec 2011 16:39:25 GMT</pubDate> <title>keywords set https://svn.boost.org/trac10/ticket/4839#comment:22 https://svn.boost.org/trac10/ticket/4839#comment:22 <ul> <li><strong>keywords</strong> 64 interlocked added </li> </ul> Ticket jim@… Mon, 12 Dec 2011 01:10:27 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:23</guid> <description> <p> Note that I've been running the boost regression tests on MinGW-w64, Windows 7 x64 for the last couple months, and thread builds fine (passes its regressions), for gcc 4.7, 4.6, 4.5 and 4.4 (besides the tss issue). See <a href="http://www.boost.org/development/tests/release/developer/thread.html">http://www.boost.org/development/tests/release/developer/thread.html</a>. So I'm pretty sure these issues are cleared up. Anyone disagree? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 03 Jan 2012 16:48:10 GMT</pubDate> <title>status changed; resolution set; milestone deleted https://svn.boost.org/trac10/ticket/4839#comment:24 https://svn.boost.org/trac10/ticket/4839#comment:24 <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">worksforme</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.46.0</span> </li> </ul> <p> Closed as no one disagree :) </p> Ticket kalast@… Sat, 21 Apr 2012 17:39:55 GMT <link>https://svn.boost.org/trac10/ticket/4839#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:25</guid> <description> <p> Hi, using this <a class="ext-link" href="https://sourceforge.net/projects/mingwbuilds/files/windows-host/4.7.0/"><span class="icon">​</span>https://sourceforge.net/projects/mingwbuilds/files/windows-host/4.7.0/</a> build results in the same errors for thread unfortunately. Will test latest release to see if it's fixed. </p> </description> <category>Ticket</category> </item> <item> <author>kalast@…</author> <pubDate>Sat, 21 Apr 2012 17:57:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4839#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4839#comment:26</guid> <description> <p> Hello again, looks like 1.49 works correctly, sorry for the noise. </p> </description> <category>Ticket</category> </item> </channel> </rss>