migrate detect_arch