Backport build changes from the main branch to the LLVM 17 branch
This backports various changes from main to the LLVM 17 branch such that it can be built on Alpine. I didn't backport the GitLab CI changes because they appear to make specific assumptions about the used LLVM version of Rust nightly, and I'm not sure how to handle that in regards to LLVM 17.