Make libffi Fail And Boxed Me In

MAKE i686-pc-mingw32 : 0 * all-all
make[1]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
make “AR_FLAGS=” “CC_FOR_BUILD=” “CFLAGS=-O2 -Wall” “CXXFLAGS=” “CFLAGS_FOR_BUIL
D=” “CFLAGS_FOR_TARGET=” “INSTALL=/bin/install -c” “INSTALL_DATA=/bin/install -c
-m 644” “INSTALL_PROGRAM=/bin/install -c” “INSTALL_SCRIPT=/bin/install -c” “JC1
FLAGS=” “LDFLAGS=” “LIBCFLAGS=” “LIBCFLAGS_FOR_TARGET=” “MAKE=make” “MAKEINFO=/b
in/sh /d/source/c/libffi-3.0.10/missing –run makeinfo ” “PICFLAG=” “PICFLAG_FOR
_TARGET=” “RUNTESTFLAGS=” “SHELL=/bin/sh” “exec_prefix=c:/gtk_compilation/vs10/W
in32” “infodir=c:/gtk_compilation/vs10/Win32/share/info” “libdir=c:/gtk_compilat
ion/vs10/Win32/lib” “mandir=c:/gtk_compilation/vs10/Win32/share/man” “prefix=c:/
gtk_compilation/vs10/Win32” “AR=false” “AS=as” “CC=/d/source/c/libffi-3.0.10/msv
cc.sh” “CXX=g++” “LD=link” “NM=dumpbin -symbols” “RANLIB=:” “DESTDIR=” all-recur
sive
make[2]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
Making all in include
make[3]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/include’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/include’
Making all in testsuite
make[3]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/testsuite

make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/testsuite’

Making all in man
make[3]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/man’
make[3]: Nothing to be done for `all’.
make[3]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32/man’
make[3]: Entering directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
source=’../src/debug.c’ object=’src/debug.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/debug.lo ../src/debug.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/debug.c  -DDLL_EXPORT
-DPIC -o src/.libs/debug.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/debug.c -DDLL_EXPORT
-DPIC -Fosrc/.libs/debug.obj -Fdsrc/.libs/debug -Fpsrc/.libs/debug -Fasrc/.libs/
debug
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
debug.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/debug.c -o src/debug.o
bj >/dev/null 2>&1
source=’../src/prep_cif.c’ object=’src/prep_cif.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/prep_cif.lo ../src/prep_cif.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/prep_cif.c  -DDLL_EXPO
RT -DPIC -o src/.libs/prep_cif.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/prep_cif.c -DDLL_EXPO
RT -DPIC -Fosrc/.libs/prep_cif.obj -Fdsrc/.libs/prep_cif -Fpsrc/.libs/prep_cif –
Fasrc/.libs/prep_cif
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
prep_cif.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/prep_cif.c -o src/prep
_cif.obj >/dev/null 2>&1
source=’../src/types.c’ object=’src/types.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/types.lo ../src/types.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/types.c  -DDLL_EXPORT
-DPIC -o src/.libs/types.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/types.c -DDLL_EXPORT
-DPIC -Fosrc/.libs/types.obj -Fdsrc/.libs/types -Fpsrc/.libs/types -Fasrc/.libs/
types
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
types.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/types.c -o src/types.o
bj >/dev/null 2>&1
source=’../src/raw_api.c’ object=’src/raw_api.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/raw_api.lo ../src/raw_api.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/raw_api.c  -DDLL_EXPOR
T -DPIC -o src/.libs/raw_api.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/raw_api.c -DDLL_EXPOR
T -DPIC -Fosrc/.libs/raw_api.obj -Fdsrc/.libs/raw_api -Fpsrc/.libs/raw_api -Fasr
c/.libs/raw_api
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
raw_api.c
../src/raw_api.c(175) : warning C4013: ‘bcopy’ 未定义; 假设 extern 传回整数
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/raw_api.c -o src/raw_a
pi.obj >/dev/null 2>&1
source=’../src/java_raw_api.c’ object=’src/java_raw_api.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/java_raw_api.lo ../src/java_raw_api.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/java_raw_api.c  -DDLL_
EXPORT -DPIC -o src/.libs/java_raw_api.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/java_raw_api.c -DDLL_
EXPORT -DPIC -Fosrc/.libs/java_raw_api.obj -Fdsrc/.libs/java_raw_api -Fpsrc/.lib
s/java_raw_api -Fasrc/.libs/java_raw_api
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
java_raw_api.c
../src/java_raw_api.c(225) : warning C4013: ‘bcopy’ 未定义; 假设 extern 传回整数

libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/java_raw_api.c -o src/
java_raw_api.obj >/dev/null 2>&1
source=’../src/closures.c’ object=’src/closures.lo’ libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
/bin/sh ./libtool –tag=CC   –mode=compile /d/source/c/libffi-3.0.10/ms
vcc.sh -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -g  -O2 -W
all -c -o src/closures.lo ../src/closures.c
libtool: compile:  /d/source/c/libffi-3.0.10/msvcc.sh -DHAVE_CONFIG_H -I. -I.. –
I. -I../include -Iinclude -I../src -g -O2 -Wall -c ../src/closures.c  -DDLL_EXPO
RT -DPIC -o src/.libs/closures.obj
cl -MD -nologo -W3 -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src
-Zi -DEBUG -O2 -OPT:REF -OPT:ICF -INCREMENTAL:NO -c ../src/closures.c -DDLL_EXPO
RT -DPIC -Fosrc/.libs/closures.obj -Fdsrc/.libs/closures -Fpsrc/.libs/closures –
Fasrc/.libs/closures
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OR’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OE’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OP’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OT’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-O:’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OI’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OC’
cl : 命令列 warning D9002 : 忽略未知的选项 ‘-OF’
closures.c
C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(51) : error C2
143: 语法错误 : 遗漏 ‘)’ (在 ‘(‘ 之前)
C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(51) : error C2
091: 函式传回函式
C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(51) : error C2
059: 语法错误 : ‘型别’
make[3]: *** [src/closures.lo] Error 1
make[3]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
make[1]: *** [all] Error 2
make[1]: Leaving directory `/d/source/c/libffi-3.0.10/i686-pc-mingw32′
make: *** [all-all] Error 2

Oh boy! That’s great!

终于在去信给Chun-wei Fan询问可能的问题时,她初次的回覆是这样:

我用VS2010 32/64位元重新编译都通过没有问题…
请问一下您有使用Mozilla-Build来编译LibFFI吗?您的错误看起来好像是因为不是用Mozilla-Build编译的缘故(很不幸一般的MinGW不能用这种方式以MSVC
编译LibFFI的)-您必须按照GNOME Live!所写的方式编译LibFFI才可能编译成功。
若有其他问题烦请告知,愿上帝赐福

他这样问我,我当然继续问:

我是照着GNOME Live!安装Mozilla-Build后使用start-msvc10.bat来编译的
但是我比较好奇的是你是怎看出不是用Mozilla-Build编译?
我在怀疑我的环境设定可能有问题,导致编译时没有出现Mozilla-Build的编译。

第二次的回覆:

因为我有看到g++的字眼,您可能需要确定MinGW*/Cygwin的工具没有在您的PATH当中才行﹝我今天在用VS2010编译的时候没有看到g++的字眼
另外,我也没有看到如以下的字眼:../src/java_raw_api.c(225) : warning C4013: ‘bcopy’ 未定义; 假设 extern 传回整数,那个似乎是./configure的时候
抓到MinGW*和/或Cygwin的Header的样子。
烦请您确定Cygwin/MinGW*没有在您的PATH中再试一次,如果状况解除烦请告知一声,因为我可能需要将此部分写在GNOME Live!的页面上。
p.s.当这些程序确定对一般大众OK的时候我会开始着手写正体中文版的说明
*这边讲的MinGW是指包含GCC的正统mingw.org官方版MinGW,非mozilla-build里面的MinGW相关工具
愿上帝赐福

乖乖,Chun-wei Fan的回答似乎没有帮助,ㄚ琪索性在一台干净安装的Windows XP上只有Microsoft Visual C++ 2008 Express下,将libffi-3.0.10.tar.gz解压缩到d:,所以我就进到D:\libffi-3.0.10进行编译,Yes,成功,继续安装Microsoft Visual C++ 2010 Express然后编译,Yes,再度成功,顺便将编译过程记下来。

接下来继续回到这台设定很乱的电脑上作业,换更新的libffi-3.0.11-rc1.tar.gz编译,失败,重装mozilla-build,编译也失败,再仔细确认PATH也似乎没有问题了,只好回来看编译过程,但是一直都没有成功,而且症结点在于fficonfig.h是错的,至于它为什么错的那么离谱,ㄚ琪因为对confgiure的机制不够了解,所以努力了十几天后我放弃侦错了。

并且得到一个暂时的结论,请千万要在干净PC上编译这个套件,否则错误可能很难解。

好吧,After 20 days’ work on the project, at last I feel I’m getting somewhere.,就让ㄚ琪继续分享吧。

1.下载最新的mozilla-build

2.下载libffi-3.0.10

3.执行mozilla-build里的start-msvc10.bat,到libffi-3.0.10的资料夹,执行:

./configure CC=$(pwd)/msvcc.sh LD=link CPP=’cl -nologo -EP’ CFLAGS=’-O2′ –build=i686-pc-mingw32 –prefix=c:/gtk_compilation/vs10/Win32

4.执行make

5.执行make install,可能会有错误,但是不用管,从$(srcroot)\i686-pc-mingw32\include复制ffi.h及ffitarget.h到C:\gtk_compilation\vs10\Win32\include,从$(srcroot)\i686-pc-mingw32\src\.libs复制libffi_conveneince.lib到C:\gtk_compilation\vs10\Win32\lib并且改名为libffi.lib。

好了这一篇终于告一段落,向另一个套件迈进。