Fix builds for cross compiles