[ZBX-5561] Configure fails when cross compiling. Created: 2012 Sep 10  Updated: 2017 May 30  Resolved: 2014 Oct 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 2.0.2
Fix Version/s: 2.2.7rc1, 2.4.2rc1, 2.5.0

Type: Incident report Priority: Trivial
Reporter: Christof Lauber Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: compilation, patch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux ubuntu 2.6.38-15-generic with cross tool chain for ppc_8xx and arm-vfp


Attachments: Text File configure.ac.patch     File cross-comp-configure.patch     File cross-comp.patch    
Issue Links:
Duplicate

 Description   

When cross compiling the the configure fails with:

checking for long long format... configure: error: in `/home/user/zabbix-2.0.2':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

This seems caused by a AC_TRY_RUN macro in configure.in that does not have a default for cross compiling set. I so added a safe default value in case of cross compiling and it seems to work.
Check the suggested patch.



 Comments   
Comment by Oleksii Zagorskyi [ 2014 Aug 07 ]

There was also discussion in forum http://www.zabbix.com/forum/showthread.php?t=26591

Comment by Aleksandrs Saveljevs [ 2014 Aug 08 ]

For those without the possibility to run ./bootstrap.sh and use automake, attached is "cross-comp-configure.patch" which patches the resulting ./configure script, rather than the original configure.ac.

Inspired by http://stackoverflow.com/questions/25183435/zabbix-cross-compilation-issue-with-have-long-long-condition-test .

Comment by Oleksii Zagorskyi [ 2014 Aug 19 ]

Note that starting from 2.2.2 (ZBX-7227) configure.in renamed to configure.ac
Attached as "configure.ac.patch" based on 2.2.5 sources.
Reminder - after patching with the patch, don't forget to re-run bootstrap.sh

Comment by Igors Homjakovs (Inactive) [ 2014 Sep 25 ]

Fixed in svn://svn.zabbix.com/branches/dev/ZBX-5561

Comment by Igors Homjakovs (Inactive) [ 2014 Sep 25 ]

The agent was compiled for raspberypi(ARM) using this tool: https://github.com/raspberrypi/tools.git.
During configuration the following arguments were specified:
--host=arm CC=arm-unknown-linux-gnueabi-gcc

Comment by Aleksandrs Saveljevs [ 2014 Oct 03 ]

According to https://www.sourceware.org/autobook/autobook/autobook_269.html , AC_CHECK_SIZEOF macro might not work correctly. However, https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html claims that this macro works even when cross-compiling. I have checked with Raspberry Pi and it seems to work indeed.

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 10 ]

Fixed in 2.2.7rc1 (r49754), 2.4.2rc1 (r49755), 2.5.0 (r49756)

Generated at Fri Mar 29 17:09:23 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.