有什么办法可以编译&在小端电脑上以大端方式运行程序?
看到我已经为大端写了一个程序,现在我没有大端机器,但我想检查我的程序是否在大端上正常工作,那么我如何在我的小端电脑上检查这一点?
有在线虚拟大端编译器吗?
注意:我已经用谷歌搜索过这个问题,但没有得到任何结果。
see i have written one program for big endian now i dont have big endian machine but i want to check whether my program will works correctly or not on big endian so how can i check that on my little endian pc.?
Is there any online virtual big-endian compiler ?
note : i have googled about this but did not get anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
qemu 可以虚拟化各种架构,其中包括大端架构。
qemu can virtualize all sorts of architectures, amongst then big endian ones.
Qemu 作为模拟器/虚拟器很有用,即用于运行程序,但您首先需要一些东西来编译它。
一旦您选择了 qemu 支持的大端架构(例如 PowerPC),您将需要一个在您的 PC 上运行但为该架构(例如 PowerPC)生成二进制文件的交叉编译器。
如果您非常幸运,您的发行版包含一些二进制文件。但是,在大多数情况下,您可能被迫自己编译
binutils
、glibc
和gcc
。Qemu is useful as an emulator/virtualizer, i.e. for running the program, but you'll need something to compile it in the first place.
Once you have chosen a big-endian architecture supported by qemu, for example PowerPC, you'll need a cross-compiler which runs on your PC but produces binaries for this architecture (e.g. PowerPC).
If you're very lucky, your distribution contains some binaries. However, in most cases, you might be forced to compile
binutils
,glibc
andgcc
yourself.