[build] rewrite #21707 so that it doesn't break cross-compilation #30170
+48
−41
We went looking everywhere, but couldn’t find those commits.
Sometimes commits can disappear after a force-push. Head back to the latest changes here.