Cross-compile version of the fix in 087383c. See #793.