鱿鱼交叉编译(Squid cross compile)

编程入门 行业动态 更新时间:2024-10-15 14:16:26
鱿鱼交叉编译(Squid cross compile)

我一直试图在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 install

Next 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 install

The 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=no

Export 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>:$PATH

Then 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

make

Then install the binaries using make install

make install

更多推荐

本文发布于:2023-08-01 05:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1354918.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鱿鱼   Squid   compile   cross

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!