From f6445d50e73456a9250703f461864eeefee34df2 Mon Sep 17 00:00:00 2001 From: ZT <30907704+mrmitzh@users.noreply.github.com> Date: Thu, 20 Nov 2025 02:34:05 +0000 Subject: [PATCH 1/3] Renamed forced_unwind struct to fiber_forced_unwind in fiber_ucontext.hpp --- include/boost/context/fiber_ucontext.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/context/fiber_ucontext.hpp b/include/boost/context/fiber_ucontext.hpp index 687e1c29..92e8fa4f 100644 --- a/include/boost/context/fiber_ucontext.hpp +++ b/include/boost/context/fiber_ucontext.hpp @@ -241,10 +241,10 @@ struct BOOST_CONTEXT_DECL fiber_activation_record_initializer { ~fiber_activation_record_initializer(); }; -struct forced_unwind { +struct fiber_forced_unwind { fiber_activation_record * from{ nullptr }; - forced_unwind( fiber_activation_record * from_) noexcept : + fiber_forced_unwind( fiber_activation_record * from_) noexcept : from{ from_ } { } }; @@ -290,7 +290,7 @@ class fiber_capture_record : public fiber_activation_record { #else c = std::invoke( fn_, std::move( c) ); #endif - } catch ( forced_unwind const& ex) { + } catch ( fiber_forced_unwind const& ex) { c = Ctx{ ex.from }; } // this context has finished its task @@ -488,7 +488,7 @@ class BOOST_CONTEXT_DECL fiber { detail::fiber_activation_record * ptr = std::exchange( ptr_, nullptr)->resume(); #endif if ( BOOST_UNLIKELY( detail::fiber_activation_record::current()->force_unwind) ) { - throw detail::forced_unwind{ ptr}; + throw detail::fiber_forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::fiber_activation_record::current()->ontop) ) { ptr = detail::fiber_activation_record::current()->ontop( ptr); detail::fiber_activation_record::current()->ontop = nullptr; @@ -507,7 +507,7 @@ class BOOST_CONTEXT_DECL fiber { std::exchange( ptr_, nullptr)->resume_with< fiber >( std::forward< Fn >( fn) ); #endif if ( BOOST_UNLIKELY( detail::fiber_activation_record::current()->force_unwind) ) { - throw detail::forced_unwind{ ptr}; + throw detail::fiber_forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::fiber_activation_record::current()->ontop) ) { ptr = detail::fiber_activation_record::current()->ontop( ptr); detail::fiber_activation_record::current()->ontop = nullptr; From 217968885834e7e290b129d7dfde3a04f5a71452 Mon Sep 17 00:00:00 2001 From: Vyacheslav Chigrin Date: Wed, 10 Dec 2025 13:24:51 +0300 Subject: [PATCH 2/3] Add information to .eh_frame ELF secion about make_fcontext function. --- src/asm/make_x86_64_sysv_elf_gas.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/asm/make_x86_64_sysv_elf_gas.S b/src/asm/make_x86_64_sysv_elf_gas.S index 9336210a..cabebff6 100644 --- a/src/asm/make_x86_64_sysv_elf_gas.S +++ b/src/asm/make_x86_64_sysv_elf_gas.S @@ -133,6 +133,8 @@ make_fcontext: ret /* return pointer to context-data */ trampoline: + .cfi_startproc + .cfi_undefined rip /* store return address on stack */ /* fix stack alignment */ _CET_ENDBR @@ -147,6 +149,7 @@ trampoline: #endif /* jump to context-function */ jmp *%rbx + .cfi_endproc finish: _CET_ENDBR From 3be17f5ccb244dc1173c59880c9423a91ab0cfce Mon Sep 17 00:00:00 2001 From: David McFarland Date: Wed, 17 Dec 2025 12:54:17 -0400 Subject: [PATCH 3/3] Don't default to ucontext on cygwin. --- include/boost/context/detail/config.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/boost/context/detail/config.hpp b/include/boost/context/detail/config.hpp index beec75f1..9de34fe7 100644 --- a/include/boost/context/detail/config.hpp +++ b/include/boost/context/detail/config.hpp @@ -30,10 +30,6 @@ # define BOOST_CONTEXT_DECL #endif -#if ! defined(BOOST_USE_UCONTEXT) && defined(__CYGWIN__) -# define BOOST_USE_UCONTEXT -#endif - #if ! defined(BOOST_CONTEXT_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_CONTEXT_NO_LIB) # define BOOST_LIB_NAME boost_context # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)