旧的 ARM32 二进制文件可以在 AARCH64 内核上运行吗? [英] Can old ARM32 binary files be run on AARCH64 kernel?

查看:29
本文介绍了旧的 ARM32 二进制文件可以在 AARCH64 内核上运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇在 AARCH64-Linux 机器上运行旧的 ARM32-Linux 程序的可行性,并进行了一些实验:

I am curious about the feasibility of running old ARM32-Linux programs on AARCH64-Linux machines and I conducted some experiments:

  1. 编写一个程序你好,世界!"并使用 arm-none-linux-gnueabi-gcc 和 aarch64-linux-gnu-gcc 静态编译它.
  2. 使用 busybox 和 aarch64 编译器静态构建和创建 ramdisk.
  3. 输入 2 Hello, World!"程序(在 ARM32 和 AARCH64 中)到 ramdisk.
  4. 使用 vexpress_defconfig 和 aarch64 编译器构建一个简单的 AARCH64-Linux 内核.
  5. 使用 qemu-system-aarch64 运行内核和 ramdisk.

(ramdisk中包括busybox在内的所有二进制文件都是静态编译的.)

(All binary files including busybox in the ramdisk are statically compiled.)

结果:

  1. 你好,世界!"AARCH64 中的程序已成功执行.
  2. 你好,世界!"ARM32 中的程序无法运行但显示消息:

第 1 行:语法错误:意外的词(期待)")

line 1: syntax error: unexpected word (expecting ")")

是否有解决上述问题的建议或专业知识?

Is there suggestion or expertise to solve the issue above?

推荐答案

谢谢moonbutt74.您为我寻求解决该问题的方法提供了有用的线索.

Thank you moonbutt74. You had provided an useful clue for me to seek the solution to that issue.

要启用在AARCH64内核上运行ARM32-Linux程序的支持,应选择内核中的选项:

To enable the support of running ARM32-Linux programs on AARCH64 kernel, the option in the kernel should be selected:

  1. 运行 make menuconfig ARCH=arm64
  2. 转到选项并选择它:

用户空间二进制格式---> 内核支持 32 位 EL0

Userspace binary formats ---> Kernel support for 32-bit EL0

  1. 通过运行make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

使用 ramdisk 和 qemu-system-aarch64 运行重新编译的内核.

run the recompiled kernel with ramdisk and qemu-system-aarch64.

你好,世界!"(ARM32和AARCH64)中的程序可以成功执行!!

the "Hello, World!" programs in (ARM32 and AARCH64) can be executed successfully !!

这篇关于旧的 ARM32 二进制文件可以在 AARCH64 内核上运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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