cltnet 发表于 2008-04-01 14:26

移植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 编辑 ]

cltnet 发表于 2008-04-01 17:22

./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上去试一下,完成后吧结果放上来.

trublemaker 发表于 2013-04-21 21:57

正好用到了,支持一下楼主。:lol:hug:

brianchen829 发表于 2013-04-22 13:35

squid内存管理可能是个问题。
页: [1]
查看完整版本: 移植squid到arm-linux上遇到的问题