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

After ./configure --prefix=/usr/local/squid I have this Makefile:http://wklej.se/makefile

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

I don't know what to do :/

  • The squid executable that you are running is a shell script, check around line number 20 to see why it throws this error. – dr01 Aug 13 '15 at 12:14
  • this problem there is because i have problem with cross compiling :/ – Jakub G Aug 13 '15 at 12:20
  • I can't see the squid because it is after compilation so it is an executable file – Jakub G Aug 13 '15 at 12:25
  • Did you try to do a cat squid? – dr01 Aug 13 '15 at 12:27
  • when I used a cat squid: o[�U��}�Tw�Q0�*�W%��B�W_N�[�Us�L�W; \�U��}�\�Wy�<\�U ����Tv�Q|���WZc\�U��}�T5�Q0���Wy\�Us���W�U��}���WǞ���W͞�Uv���������ʛ?��W ��\/]�ٛ�����E����W ��U�U#8�T�T�����W�S]d]��U��T� R &�"^�^�P���Z�A���%�h����;�+��r��W8�]�����������W�U�T1�A – Jakub G Aug 13 '15 at 12:34

You're not actually cross-compiling; to cross-compile you need to tell ./configure about your target architecture:

./configure --prefix=/usr/local --host=arm-linux-gnueabi

You should then get Makefiles which use arm-linux-gnueabi-gcc, and a resulting squid binary which is appropriate for your ARM device. (Assuming you have all the necessary libraries of course.)

  • checking for compiler variant... gcc configure: inlining optimizations enabled: yes checking for GNU atomic operations support... configure: error: in .../squid-3.5.7': configure: error: cannot run test program while cross compiling See config.log' for more details – Jakub G Aug 13 '15 at 13:10
  • You probably need to provide a CONFIG_SITE file to configure then... See the autoconf manual for details. – Stephen Kitt Aug 13 '15 at 21:02
  • where can I find the autoconf manual ?? – Jakub G Aug 14 '15 at 6:59
  • I linked to it in my comment above... – Stephen Kitt Aug 14 '15 at 6:59
  • ok, however i don't know what i must change to work it. – Jakub G Aug 14 '15 at 7:21

You can manually edit the configure.ac file, look up the atomic section, and replace the line




You then need to run bootstrap.sh to recreate the configure script.

This should let you configure, but compilation/linking might fail because your toolchain may not, in fact, support __sync_xxx calls. In my situation, libatomic.so did not contain these calls. I then had to resort to manually editing the configure script to always respond "no" to the atomic check:




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.