Created attachment 764311 [details, diff] Specifies that libucontext should be used to provide the necessary symbols on musl. This patch should be reworked to check if musl is being used, however in the interim it may fit in the musl overlay. Mold (1.0.2) currently fails to build on x86_64 musl due to the lack of getcontext/setcontext, which were deprecated as of POSIX 2008 and thus not included in musl. sys-libs/libucontext can be used to replace the missing functionality, however due to an unrelated issue that currently does not work as expected. I have attached a simple patch which, after the libucontext issue is resolved, should enable mold to build successfully on musl. I have not yet had a chance to test whether linking works as expected, however the mold executable does work with this patch applied.
I've done some simple tests with a program that uses libcrypto and libc only, and it appears that mold works as expected with this patch.
It looks like upstream have merged a patch which makes the built-in oneTBB not require the context functions anymore, and oneTBB has also merged a pull request to not use context functions when libc is not glibc (https://github.com/rui314/mold/issues/281) (https://github.com/oneapi-src/oneTBB/pull/748/files). I'll mark this as resolved since only a tbb update / patch should be required from now on to make the build successful.
just wanted to ask, are you able to compile a working binary with the recent changes in dev-cpp/tbb and sys-devel/mold, on musl system? amd64 is working for me, but aarch64 isn't