我試圖與該文件一個交叉編譯器從http://crossgcc.rts-software.org/doku.php?id=i386linuxgccformac獲得GMP與GCC 4.5.2
我的英特爾Mac上(10.6.6,x86_64的)我編的工作:GMP,MPFR ,MPC的交叉編譯器爲32位(因爲我在64位的Mac),但我得到
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /gmp1/lib/libmpc.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /gmp1/lib/libmpfr.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /gmp1/lib/libgmp.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
當與GCC編譯:
--prefix=/usr/local/i386-linux-4.5.2 --target=i386-linux --enable-languages=c --without-headers --disable-shared --disable-threads --disable-nls --with-gmp=/gmp1 --with-gmp-lib=/gmp1 --with-gmp-include=/gmp1 --with-mpfr=/gmp1 --with-mpfr-include=/gmp1 --with-mpfr-lib=/gmp1 --with-mpc=/gmp1 --with-mpc-lib=/gmp1 --with-mpc-include=/gmp1
另外,如果我編譯GMP有:
./configure --prefix=/gmp1 --host=i386-linux
我得到:
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | link -dump -symbols output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: | ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
checking how to switch to read-only data section... .data
checking for assembler .type directive...
checking for assembler .size directive...
checking for assembler local label prefix... configure: WARNING: "link -dump -symbols" failure
configure: WARNING: cannot determine local label, using default L
L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... link: illegal option -- d
我有點困惑,請你舉個例子 – Daniel 2011-03-09 12:13:19
@thkala也gmp不允許--target被設置? – Daniel 2011-03-09 12:15:18
@thkala我試過「./configure --prefix =/gmp1 --host = i386-apple-darwin10.6.0 --build = i386-linux --with-gmp =/gmp1 --with-mpfr =/gmp1」但它出現了上述錯誤(如問題中提到的) – Daniel 2011-03-09 12:21:12