我一直试图在ARM Cortex A8 (Linux)上交叉编译Squid 3.5.7。 我是从http://www.squid-cache.org/Versions/v3/3.5/下载的 我有arm-linux-gnueabi-gcc和arm-linux-gnueabi-g ++。
tar -zxvf squid-3.5.7.tar.gz cd squid-3.5.7 ./configure --prefix=/usr/local/squid make all make install接下来,我将文件夹/ usr / local / squid和〜/ squid-3.5.7复制到SD卡。 当我尝试从ARM板上的SD卡打开./squid -z时遇到问题:
root@am335x:/# ls bin etc lib mnt srv usr boot findHelp linuxrc proc sys var dev home media sbin tmp root@am335x:/media/mmcblk0/squid/sbin# ls squid root@am335x:/media/mmcblk0/squid/sbin# ./squid -z ./squid: line 20: syntax error: ")" unexpected root@am335x:/media/mmcblk0/squid/sbin# ./squid ./squid: line 20: syntax error: ")" unexpected root@am335x:/media/mmcblk0/squid/sbin#我不知道该怎么办 :/
I've been trying to cross compile the Squid 3.5.7 on ARM Cortex A8 (Linux). I downloaded it from http://www.squid-cache.org/Versions/v3/3.5/ I have arm-linux-gnueabi-gcc and arm-linux-gnueabi-g++.
tar -zxvf squid-3.5.7.tar.gz cd squid-3.5.7 ./configure --prefix=/usr/local/squid make all make installNext I copy folders /usr/local/squid and ~/squid-3.5.7 to SD card. When I try open ./squid -z from SD card on the board with ARM I have problem:
root@am335x:/# ls bin etc lib mnt srv usr boot findHelp linuxrc proc sys var dev home media sbin tmp root@am335x:/media/mmcblk0/squid/sbin# ls squid root@am335x:/media/mmcblk0/squid/sbin# ./squid -z ./squid: line 20: syntax error: ")" unexpected root@am335x:/media/mmcblk0/squid/sbin# ./squid ./squid: line 20: syntax error: ")" unexpected root@am335x:/media/mmcblk0/squid/sbin#I don't know what to do :/
最满意答案
您构建的二进制文件是为您的PC架构而构建的。 按照以下说明制作手臂鱿鱼。
配置尝试运行测试,如果您使用交叉编译器将失败,因此添加缓存文件以覆盖这些测试。
例如,创建一个缓存文件squid.cache,其行如下所示
squid_cv_gnu_atomics=no导出编译squid所需的BUILDCXX变量
export BUILDCXX=g++确保已将工具链路径导出到路径变量($ PATH)
export PATH=<TOOLCHAIN_PATH>:$PATH然后通过运行configure来配置squid,如下所示
./configure --host=arm-linux-gnueabi --cache-file=squid.cache --prefix=<install/dir>最后通过运行make来编译squid
make然后使用make install安装二进制文件
make installThe binary which you have built is built for your PC architecture. To build squid for arm follow the below instructions.
The configure is trying to run a test which will fail if you are using a cross compiler so add a cache file to override those tests.
For example create a cache file squid.cache with the line shown below
squid_cv_gnu_atomics=noExport the BUILDCXX variable required for compiling squid
export BUILDCXX=g++Make sure you have exported the toolchain path to the path variable($PATH)
export PATH=<TOOLCHAIN_PATH>:$PATHThen configure the squid by running the configure as shown below
./configure --host=arm-linux-gnueabi --cache-file=squid.cache --prefix=<install/dir>Finally compile the squid by running make
makeThen install the binaries using make install
make install更多推荐
发布评论