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 FilesMicrosoft Visual Studio 10.0VCINCLUDEstring.h(51) : error C2
143: 語法錯誤 : 遺漏 ‘)’ (在 ‘(‘ 之前)
C:Program FilesMicrosoft Visual Studio 10.0VCINCLUDEstring.h(51) : error C2
091: 函式傳回函式
C:Program FilesMicrosoft Visual Studio 10.0VCINCLUDEstring.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-mingw32include複製ffi.h及ffitarget.h到C:gtk_compilationvs10Win32include,從$(srcroot)i686-pc-mingw32src.libs複製libffi_conveneince.lib到C:gtk_compilationvs10Win32lib並且改名為libffi.lib。

好了這一篇終於告一段落,向另一個套件邁進。

感謝你看到這裡,很快就可以離開了,但最好的獎勵行動就是按一下幫我分享或留言,感恩喔~

點我分享到Facebook

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *