New comment by ayakael on void-packages repository https://github.com/void-linux/void-packages/pull/32974#issuecomment-1299452435 Comment: > ### Check out [this](https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/dotnet6-stage0/APKBUILD) then. Since dotnet is actually an ecosytem of components packaged together, to figure out crosscompilation it was necessary to identify the core-components to build. Our `stage0` package thus builds the following components: * runtime (this is where the actual crosscompilation happens, as clang builds the c# runtime) * roslyn (we then build roslyn compilers using the current bootstrap sdk. As it's all c# code, the corssbuilt sdk will be able to run the code) * sdk (takes runtime, roslyn, and downloads prebuilt c# code and packages initial SDK code) * aspnetcore (using roslyn, and other downloadable prebuilt c# code, packages aspnetcore runtime) * installer (using runtime, sdk, and aspnetcore artifacts, packages an SDK tarball similar to what upstream provides) The idea is that we just need to feed the tarball SDK to `stage0` on the target platform, and it'll build from scratch and package in a .apk file the necessary bootstrap artifacts for use by `dotnet6-build`. `dotnet6-build` can then take those packaged artifacts, feeds them into source-build, and builds the whole stack properly so that no upstream prebuilts are used. Now that `dotnet6-build` is built, future builds will use `build` rather than `stage0` to build itself. I don't know how void does its crossbuilding. Alpine crossbuilds via sysroots so our `stage0` is built around that.