在OS X 10.8(64位)到10.7(32位)上交叉编译rsync

时间:2013-06-18 21:11:31

标签: xcode macos cross-compiling rsync

我需要将rsync二进制文件与-iconv参数(> v3.0.0)一起提供给OS X Lion(10.7.5),而不安装Xcode。 (OS X上的默认rsync只是过时的v2.6.9)

如何从运行Mountain Lion(10.8.4)的另一台计算机上的源代码编译它?

尝试:

export CFLAGS="-arch i386"
./configure
make

编译好的rsync在10.8.4上运行正常但是当它复制到10.7.5时说:

$ ./rsync
Illegal instruction: 4

不起作用:

export CFLAGS="-arch i386 -m32"
./configure
make

请有人告诉我如何在OS X 10.8上交叉编译rsync v3.0.9 for 10.7?

我的系统:

$ uname -a
Darwin jonatan.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

目标系统

Darwin panda.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386

或者,是否有人编译rsync-3.0.9 for OS X 10.7.5下载? ;)

1 个答案:

答案 0 :(得分:1)

刚发现这个问题:What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?

export CFLAGS="-arch i386 -mmacosx-version-min=10.7"
./configure
make

的工作原理。 :)