This is a reland of https://github.com/llvm/llvm-project/pull/112811. Fixed the bot breakage by running ld.lld explicitly.