您的位置:首页 > 其它

产品中 configure/cross compile的一个bug

2016-04-15 12:07 127 查看
在mac机上, 为iPhone版本编译产品. 运行./configure报错如下:

configure:22793: error: cannot run test program while cross compiling

See `config.log' for more details

原因:

aclocal/xx.m4中, 有如下代码:

AC_RUN_IFELSE([AC_LANG_PROGRAM([], [
// ...
])], [var="a"],
[var="b"])
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Runtime.html

If the compiler being used does not produce executables that run on the system where configure is being run, then the test program is not run. If the optional shell commandsaction-if-cross-compiling are given, they are run instead. Otherwise, configure prints an error message and exits.


在configure中, 我们需要实际run一些代码来检查系统. 对于cross compile的情况, 我们实际上没有相应的运行环境. 所以configure会报错退出.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: