歡迎您光臨本站 註冊首頁

移植squid到arm-linux上遇到的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

移植squid到arm-linux上遇到的問題

大家好,

我下載了squid-2.6.STABLE19.tar.gz這個版本的squid軟體,
打算移植到我的arm-linux上,當然還沒有成功,還在實驗階段哈.

但在移植過程中遇到了下面的問題

我的編譯器是armeb-linux-gcc

所以在./configure CC=armeb-linux-gcc --host=armeb-linux --target=armeb-linux

在編譯時遇到了
configure: error: cannot run test program while cross compiling

這樣的錯誤,


checking if epoll works... configure: error: cannot run test program while cross

在configure中找到if eopll

可以看到ac_cv_epoll_works是我們要查找的變數

在命令行輸入echo ac_cv_have_abstract_sockets=yes>arm-linux.cache

在./configure CC=armeb-linux-gcc --host=armeb-linux --target=armeb-linux  --cache-file=armeb-linx.cache
把這類問題解決了,這時生成了makefile文件,

接著在make
看就是在make時卻出問題了...

錯誤日誌如下

make: Entering directory `/opt/other/squid-2.6.STABLE19/lib'
make: Nothing to be done for `all'.
make: Leaving directory `/opt/other/squid-2.6.STABLE19/lib'
Making all in scripts
make: Entering directory `/opt/other/squid-2.6.STABLE19/scripts'
make: Nothing to be done for `all'.
make: Leaving directory `/opt/other/squid-2.6.STABLE19/scripts'
Making all in src
make: Entering directory `/opt/other/squid-2.6.STABLE19/src'
./cf_gen cf.data ./cf.data.depend
./cf_gen: ./cf_gen: cannot execute binary file
make: *** Error 126
make: Leaving directory `/opt/other/squid-2.6.STABLE19/src'
make: *** Error 1
#




我在google上查到

說可以這樣解決




Try replacing the cf_gen binary in the build directory with one from an
native build. Should work I think. Or check how OpenWRT, OpenEmbedded
etc build their Squid packages.


First build Squid natively on the host to get cf_gen, then in the
cross-compile run

  make -C lib
  make -C src cf_gen
  cp /path/to/host_build/src/cf_gen src/
  touch src/cf_gen
  make

To set up the makefiles to allow for proper build of cf_gen in a
cross-compile is a rather major task, probably easier to rewrite cf_gen
in perl or awk to avoid that mess..



可我愚鈍,還沒有明白他說的意思,make -C lib 和src都是squid配置文件目錄下目錄嗎?
/path/to/host_build/src/ 又是什麼目錄呢?

這些都是疑問......

[ 本帖最後由 cltnet 於 2008-4-1 14:31 編輯 ]
《解決方案》

./cf_gen cf.data ./cf.data.depend
./cf_gen: ./cf_gen: cannot execute binary file


這個錯誤也解決了,只能怪自己粗心.
我編譯這個squid是想編譯到arm-linux上跑的,所以編譯器用的是armeb-linux-gcc 但是我們PC上的編譯器是GCC
雖然在編譯時我們把編譯器換為了armeb-linux-gcc了,但是編譯生成的cf_gen確是要在我們的PC上執行的,使用只有使用gcc編譯一個cf_gen 然後再拷貝到src目錄下就可以了....

剛剛編譯通過了,馬上拿到arm-linux上去試一下,完成後吧結果放上來.
《解決方案》

正好用到了,支持一下樓主。:lol:hug:
《解決方案》

squid內存管理可能是個問題。

[火星人 ] 移植squid到arm-linux上遇到的問題已經有1143次圍觀

http://coctec.com/docs/service/show-post-11561.html