2013-05-20 200 views
1

我已經被分配到samba 4.0.5從i686交叉編譯到MIPS,以便稍後將其移植到板上。我正在編譯在Ubuntu 13.04。交叉編譯Samba 4.0.5 i686到MIPS

我得到的錯誤是:

lib/sysquotas_4A.c: In function ‘sys_get_vfs_quota’: 
lib/sysquotas_4A.c:107:10: error: ‘struct dqblk’ has no member named ‘dqb_curblocks’ 
lib/sysquotas_4A.c:124:10: error: ‘struct dqblk’ has no member named ‘dqb_curblocks’ 
lib/sysquotas_4A.c:170:29: error: ‘struct dqblk’ has no member named ‘dqb_curblocks’ 
The following command failed: 
cc -fno-builtin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT 
-D_POSIX_PTHREAD_SEMANTICS -I. 
-I/home/constantine/software_forge/2013/5_month/samba/samba-4.0.5/source3 
-I/home/constantine/software_forge/2013/5_month/samba/samba-4.0.5/source3/../lib/popt 
-I/home/constantine/software_forge/2013/5_month/samba/samba-4.0.5/source3/../lib/iniparser/src 
-Iinclude/autoconf -Iautoconf -Iautoconf/source3 -Iinclude -I./include 
-I. -I. -I./../lib/replace -I./../lib/tevent -I../lib/ccan/.. -I./librpc -I./.. 
-I./../lib/tdb_compat -I./../lib/talloc -I../lib/tdb/include -I../lib/ntdb 
-DHAVE_CONFIG_H -I/~/opt/buildroot-gcc342/include -Iinclude/autoconf -Iautoconf 
-Iautoconf/source3 -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/tevent -I../lib/ccan/.. 
-I./librpc -I./.. -I./../lib/tdb_compat -I./../lib/popt -DLDAP_DEPRECATED 
-I/home/constantine/software_forge/2013/5_month/samba/samba-4.0.5/source3/lib -I.. 
-I./../lib/ldb/include -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 -fPIE -c lib/sysquotas_4A.c -o lib/sysquotas_4A.o 

我跑

的./configure --target = MIPS-Linux的uClibc的--host = i686的

而之前我跑這些:

export LD_LIBARY_PATH=~/opt/buildroot-gcc342/lib 
export LDFLAGS=-L/~/opt/buildroot-gcc342/lib 
export CPPFLAGS=-I/~/opt/buildroot-gcc342/include 
export CC=~/opt/buildroot-gcc342/bin/mipsel-linux-uclib-gcc 

另外,我已經安裝了配額軟件包,刪除了-w標誌(作爲來自OS/X的朋友建議),但它仍然是一樣的。它爲本地架構編譯。我也看到了來源,我看到這些

#if _LINUX_QUOTA_VERSION < 2 
struct dqblk{ 
    ... 
    u_int32_t dqb_curblocks; 
    ... 
} 
#else 
#define QIF_BLIMITS  1 
#define QIF_SPACE  2 
... 
struct dqblk{ 
    ... 
} 
#endif 

並檢查包括,它應該工作。 我是新來linux和交叉編譯,所以我非常抱歉,如果這個問題是愚蠢的。然而,Google搜索結果目前無法幫助我。

回答

0

好的,我找到了解決方案,如果有人遇到類似的情況,我會留下答案。

以上步驟完全正確。但是,應該確保頭文件是從MIPS編譯器目錄中獲取的。所以我通過指定quota.h的完整路徑(在我的情況下爲/opt/buildroot-gcc342/include/sys/quota.h)更改了的源代碼sysquotas_4A.c,它的工作原理很好。

乾杯, 君士坦丁