Boost C++ Libraries: Ticket #11246: boost.coroutine 1.58 fails to build for mingw because of undefined symbols https://svn.boost.org/trac10/ticket/11246 <p> Hello, </p> <p> I'm trying to cross-compile boost 1.58 from linux for mingw from tarball for archlinux (aur.archlinux.org/packages/mingw-w64-boost/). </p> <p> I'm stuck when linking boost.coroutine because I've got undefined references to symbols in boost.context (make_fcontext, jump_fcontext): </p> <pre class="wiki">gcc.link.dll bin.v2/libs/coroutine/build/gcc-mingw-mingw64/release/binary-format-pe/target-os-windows/threadapi-win32/threading-multi/libboost_coroutine-mt.dll.a bin.v2/libs/coroutine/build/gcc-mingw-mingw64/release/binary-format-pe/target-os-windows/threadapi-win32/threading-multi/detail/coroutine_context.o:coroutine_context.cpp:(.text+0x4a): undefined reference to `_imp__make_fcontext' bin.v2/libs/coroutine/build/gcc-mingw-mingw64/release/binary-format-pe/target-os-windows/threadapi-win32/threading-multi/detail/coroutine_context.o:coroutine_context.cpp:(.text+0xc7): undefined reference to `_imp__jump_fcontext' </pre><p> It looks exactly like this issue github.com/boostorg/context/pull/12 that was fixed for AIX. </p> <p> Prior to the build I applied the fedora patch used to successfully build previous versions of boost for mingw: pkgs.fedoraproject.org/cgit/mingw-boost.git/tree/boost-mingw.patch, but maybe it needs updating. Also I wonder why it wasn't submited or accepted upstream. </p> <p> Regards, xan </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11246 Trac 1.4.3 anonymous Wed, 29 Apr 2015 08:16:53 GMT component, summary changed https://svn.boost.org/trac10/ticket/11246#comment:1 https://svn.boost.org/trac10/ticket/11246#comment:1 <ul> <li><strong>component</strong> <span class="trac-field-old">context</span> → <span class="trac-field-new">Building Boost</span> </li> <li><strong>summary</strong> <span class="trac-field-old">boost.coroutine 1.58 fails to build for mingw because of undefined symbols in boost.context</span> → <span class="trac-field-new">boost.coroutine 1.58 fails to build for mingw because of undefined symbols</span> </li> </ul> Ticket anonymous Tue, 12 May 2015 15:00:03 GMT component changed https://svn.boost.org/trac10/ticket/11246#comment:2 https://svn.boost.org/trac10/ticket/11246#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">Building Boost</span> → <span class="trac-field-new">coroutine</span> </li> </ul> Ticket stellarpower@… Mon, 18 May 2015 10:27:43 GMT <link>https://svn.boost.org/trac10/ticket/11246#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11246#comment:3</guid> <description> <p> I have the same here, Boost 1.58, using mingw32 4.9.1 on Windows x86 (toolchain provided by Qt 5.4 package) </p> <pre class="wiki">gcc.link.dll bin.v2\libs\context\build\gcc-mingw-4.9.1\release\threading-multi\libboost_context-mgw49-mt-1_58.dll.a Warning: corrupt .drectve at end of def file Warning: corrupt .drectve at end of def file gcc.link.dll bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\libboost_coroutine-mgw49-1_58.dll.a bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\detail\coroutine_context.o:coroutine_context.cpp:(.text+0x4a): undefined reference to `_imp__make_fcontext' bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\detail\coroutine_context.o:coroutine_context.cpp:(.text+0xc7): undefined reference to `_imp__jump_fcontext' c:/qt5/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\detail\coroutine_context.o: bad reloc address 0x20 in section `.eh_frame' collect2.exe: error: ld returned 1 exit status "g++" "-Wl,--out-implib,bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\libboost_coroutine-mgw49-1_58.dll.a" -o "bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\libboost_coroutine-mgw49-1_58.dll" -shared -Wl,--start-group "bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\detail\coroutine_context.o" "bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\exceptions.o" "bin.v2\libs\coroutine\build\gcc-mingw-4.9.1\release\windows\stack_traits.o" "bin.v2\libs\context\build\gcc-mingw-4.9.1\release\threading-multi\libboost_context-mgw49-mt-1_58.dll.a" "bin.v2\libs\thread\build\gcc-mingw-4.9.1\release\threading-multi\libboost_thread-mgw49-mt-1_58.dll.a" "bin.v2\libs\chrono\build\gcc-mingw-4.9.1\release\threading-multi\libboost_chrono-mgw49-mt-1_58.dll.a" "bin.v2\libs\system\build\gcc-mingw-4.9.1\release\threading-multi\libboost_system-mgw49-mt-1_58.dll.a" "bin.v2\libs\system\build\gcc-mingw-4.9.1\release\libboost_system-mgw49-1_58.dll.a" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -march=i686 -m32 ...failed </pre><p> I haven't used any patches, just following the build instructions on the 'Getting Started' page. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Tue, 26 Jan 2016 16:59:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11246#comment:4 https://svn.boost.org/trac10/ticket/11246#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 olli Tue, 26 Jan 2016 16:59:39 GMT component changed https://svn.boost.org/trac10/ticket/11246#comment:5 https://svn.boost.org/trac10/ticket/11246#comment:5 <ul> <li><strong>component</strong> <span class="trac-field-old">coroutine</span> → <span class="trac-field-new">context</span> </li> </ul> Ticket