Dear Maintainer,
I was investigating an FTBFS issue in one of my packages that links against
Boost.Fiber and realized that this library used ucontext_t on alpha, hppa,
m68k, ppc64, sh4, x32 but did not define the BOOST_USE_UCONTEXT macro in the
CMake configuration scripts.
Please consider adding this macro to the INTERFACE_COMPILE_DEFINITIONS property
of the Boost::context target for architectures where it is needed.
Alternatively, you could add appropriate #if-conditions to the config.hpp
header.
Below is the result of compiling of a simple example on ppc64. The example is
attached.
[ 50%] Linking CXX executable example
/usr/bin/powerpc64-linux-gnu-ld.bfd: CMakeFiles/example.dir/example.cpp.o: in function `boost::context::fiber::~fiber()':
example.cpp:(.text._ZN5boost7context5fiberD2Ev[_ZN5boost7context5fiberD5Ev]+0x84): undefined reference to `boost::context::detail::ontop_fcontext(void*, void*, boost::context::detail::transfer_t (*)(boost::context::detail::transfer_t))'
/usr/bin/powerpc64-linux-gnu-ld.bfd: CMakeFiles/example.dir/example.cpp.o: in function `boost::context::fiber::resume() &&':
example.cpp:(.text._ZNO5boost7context5fiber6resumeEv[_ZNO5boost7context5fiber6resumeEv]+0x9c): undefined reference to `boost::context::detail::jump_fcontext(void*, void*)'
/usr/bin/powerpc64-linux-gnu-ld.bfd: CMakeFiles/example.dir/example.cpp.o: in function `void* boost::context::detail::create_fiber2<boost::context::detail::fiber_record<boost::context::fiber, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, std::_Bind<boost::context::fiber (boost::fibers::worker_context<void (&)()>::*(boost::fibers::worker_context<void (&)()>*, std::_Placeholder<1>))(boost::context::fiber&&)> >, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, std::_Bind<boost::context::fiber (boost::fibers::worker_context<void (&)()>::*(boost::fibers::worker_context<void (&)()>*, std::_Placeholder<1>))(boost::context::fiber&&)> >(boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, std::_Bind<boost::context::fiber (boost::fibers::worker_context<void (&)()>::*(boost::fibers::worker_context<void (&)()>*, std::_Placeholder<1>))(boost::context::fiber&&)>&&)':
example.cpp:(.text._ZN5boost7context6detail13create_fiber2INS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEES7_SL_EEPvNS0_12preallocatedEOT0_OT1_[_ZN5boost7context6detail13create_fiber2INS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEES7_SL_EEPvNS0_12preallocatedEOT0_OT1_]+0x104): undefined reference to `boost::context::detail::make_fcontext(void*, unsigned long, void (*)(boost::context::detail::transfer_t))'
/usr/bin/powerpc64-linux-gnu-ld.bfd: example.cpp:(.text._ZN5boost7context6detail13create_fiber2INS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEES7_SL_EEPvNS0_12preallocatedEOT0_OT1_[_ZN5boost7context6detail13create_fiber2INS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEES7_SL_EEPvNS0_12preallocatedEOT0_OT1_]+0x154): undefined reference to `boost::context::detail::jump_fcontext(void*, void*)'
/usr/bin/powerpc64-linux-gnu-ld.bfd: CMakeFiles/example.dir/example.cpp.o: in function `void boost::context::detail::fiber_entry<boost::context::detail::fiber_record<boost::context::fiber, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, std::_Bind<boost::context::fiber (boost::fibers::worker_context<void (&)()>::*(boost::fibers::worker_context<void (&)()>*, std::_Placeholder<1>))(boost::context::fiber&&)> > >(boost::context::detail::transfer_t)':
example.cpp:(.text._ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE[_ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE]+0x98): undefined reference to `boost::context::detail::jump_fcontext(void*, void*)'
/usr/bin/powerpc64-linux-gnu-ld.bfd: example.cpp:(.text._ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE[_ZN5boost7context6detail11fiber_entryINS1_12fiber_recordINS0_5fiberENS0_21basic_fixedsize_stackINS0_12stack_traitsEEESt5_BindIFMNS_6fibers14worker_contextIRFvvEJEEEFS4_OS4_EPSD_St12_PlaceholderILi1EEEEEEEEvNS1_10transfer_tE]+0x11c): undefined reference to `boost::context::detail::ontop_fcontext(void*, void*, boost::context::detail::transfer_t (*)(boost::context::detail::transfer_t))'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/example.dir/build.make:104: example] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/example.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Other related failures are on buildd.
https://buildd.debian.org/status/fetch.php?pkg=cppgir&arch=alpha&ver=2.0%2Bgit20260518.0bdd2b6-1&stamp=1788169263&raw=0
https://buildd.debian.org/status/fetch.php?pkg=cppgir&arch=hppa&ver=2.0%2Bgit20260518.0bdd2b6-1&stamp=1788169132&raw=0
https://buildd.debian.org/status/fetch.php?pkg=cppgir&arch=ppc64&ver=2.0%2Bgit20260518.0bdd2b6-1&stamp=1788168286&raw=0