The following two commits on LLVM 17 are needed for the latest release of emscripten to build with LLVM 16 (see emscripten-core/emscripten#19466). That release requires the functionality of https://reviews.llvm.org/D145308, and that commit appears to depend on https://reviews.llvm.org/D145431 as well.
/cherry-pick 8aef04f 3111784