This is one of the steps needed to support building for Apple ARM when
cross-compiling.
This is a partial backport of core#21851
https://github.com/bitcoin/bitcoin/pull/21851/commits/446e73cc0bb7cd628039eaf9b1bcc93db23b924f
doc improvements from core#24241