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

查看:567
本文介绍了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

Apache正试图编译这个test_char.h生成器为实际的设备,而我需要它运行在我的Ubuntu,我是交叉编译。 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.

但我终于遇到了这个 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
然后运行它,并将其输出到include文件夹(或
放置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天全站免登陆