fixed cross-compile function