makecontext, swapcontext, … are not provided on musl as there are no longer mandated by POSIX. Instead, these functions are available via a separately library (libucontext), however, we need to link explicitly against this. diff -upr capnproto-c++-0.8.0.orig/src/kj/CMakeLists.txt capnproto-c++-0.8.0/src/kj/CMakeLists.txt --- capnproto-c++-0.8.0.orig/src/kj/CMakeLists.txt 2021-02-04 19:39:00.666936799 +0100 +++ capnproto-c++-0.8.0/src/kj/CMakeLists.txt 2021-02-04 19:39:27.560397981 +0100 @@ -74,6 +74,7 @@ add_library(CapnProto::kj ALIAS kj) # TODO(cleanup): Use cxx_std_14 once it's safe to require cmake 3.8. target_compile_features(kj PUBLIC cxx_generic_lambdas) +target_link_libraries(kj PUBLIC ucontext) if(UNIX AND NOT ANDROID) target_link_libraries(kj PUBLIC pthread) endif()