Apache的交叉编译错误./gen_test_char:不能执行二进制文件 [英] Apache Cross Compilation Error ./gen_test_char: cannot execute binary file

查看:1162
本文介绍了Apache的交叉编译错误./gen_test_char:不能执行二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了很长一段时间来找到解决这个bug。当试图交叉编译Apache的一个臂(我相信这可能发生许多其他架构),我会从服务器中的文件夹得到这个错误:

I looked quite some time to find a solution to this bug. When trying to Cross-Compile Apache for an Arm (I am sure that this could happen for many other Architectures), I would get this bug from with in the server folder:

 ./gen_test_char: cannot execute binary file

这意味着阿帕奇正试图在我需要它的地方,我交叉编译在我的Ubuntu运行编译实际的设备本test_char.h发生器。 Ubuntu的不承认编译gen_test_char作为一个可执行文件,所以我需要得到它的Ubuntu正确编译。

This means that Apache is trying to compile this test_char.h generator for the actual device while I need it to run on my Ubuntu where I am Cross-Compiling. Ubuntu does not recognize the compiled gen_test_char as an executable so I need to get it compiled correctly for Ubuntu.

推荐答案

我找啊找,发现多次尝试修补,但没有一次成功。其中大部分是直接从Apache开发小组建议补丁。

I searched and searched and found several tries to patch but none of them worked. Most of these were patches suggested directly from the Apache dev group.

不过,我终于碰到这个<少时href=\"http://mail-archives.apache.org/mod_mbox/httpd-dev/201203.mbox/%3C4F646F05.80302@apache.org%3E\"相对=nofollow> Apache的邮件列表。这表明一个简单的解决方案,该补丁无法提供。

But I finally came across this Apache mail list. It suggests a straight forward solution that the patches could not provide.

试图交叉编译Apache之前编译gen_test_char应用。所以我做了。并遵循建议,它的工作就像一个魅力。

Compile the gen_test_char app before trying to cross-compile Apache. So I did. And followed the suggestions and it worked like a charm.

而不是仅仅编译gen_test_char.c月1日的东西,如:
  GCC -Wall -O2 -DCROSS_COMPILE gen_test_char.c -s -o gen_test_char
  然后运行它,并把它输出到包括文件夹(或在其
  normaly配售);

instead just compile gen_test_char.c 1st with something like: gcc -Wall -O2 -DCROSS_COMPILE gen_test_char.c -s -o gen_test_char then run it and put its output into the include folder (or where its placed normaly);

和这个编译后运行它以获得所需的输出:

and after this compilation run it to get the desired output with:

 ./gen_test_char > test_char.h

这篇关于Apache的交叉编译错误./gen_test_char:不能执行二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆