boostorg / boost

Super-project for modularized Boost
https://github.com/boostorg/wiki/wiki/Getting-Started%3A-Overview
Boost Software License 1.0
7.22k stars 1.77k forks source link

Windows on ARM64 (aarch64-w64-mingw32) winfib build using MinGW-w64 fails (undefined jump_fcontext) #983

Open brechtsanders opened 1 week ago

brechtsanders commented 1 week ago

When trying to build a aarch64-w64-mingw32 build (native on Windows on ARM using this LLVM/CLang) with -DBOOST_CONTEXT_IMPLEMENTATION:STRING=winfib there the following error occcurs:

undefined symbol: __declspec(dllimport) jump_fcontext

This only happens with a shared build. A static build works fine (-DBUILD_SHARED_LIBS:BOOL=OFF -DBOOST_RUNTIME_LINK:STRING=static).

Full error output:

ld.lld: error: undefined symbol: __declspec(dllimport) make_fcontext
>>> referenced by libs/coroutine/CMakeFiles/boost_coroutine.dir/src/detail/coroutine_context.cpp.obj:(boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(boost::context::detail::transfer_t), boost::coroutines::detail::preallocated const&))
>>> referenced by libs/coroutine/CMakeFiles/boost_coroutine.dir/src/detail/coroutine_context.cpp.obj:(boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(boost::context::detail::transfer_t), boost::coroutines::detail::preallocated const&))

ld.lld: error: undefined symbol: __declspec(dllimport) jump_fcontext
>>> referenced by libs/coroutine/CMakeFiles/boost_coroutine.dir/src/detail/coroutine_context.cpp.obj:(boost::coroutines::detail::coroutine_context::jump(boost::coroutines::detail::coroutine_context&, void*))
>>> referenced by libs/coroutine/CMakeFiles/boost_coroutine.dir/src/detail/coroutine_context.cpp.obj:(boost::coroutines::detail::coroutine_context::jump(boost::coroutines::detail::coroutine_context&, void*))
clang-19: error: linker command failed with exit code 1 (use -v to see invocation)
[79/435] Building CXX object libs/serialization/CMakeFiles/boost_serialization.dir/src/xml_grammar.cpp.obj
ninja: build stopped: subcommand failed.

As mentioned in #982 builds with -DBOOST_CONTEXT_IMPLEMENTATION:STRING=fcontext also fail, so I don't seem to have a proper MinGW-w64 build of Boost for Windows on ARM64 (aarch64-w64-mingw32).