首页 > 编程知识 正文

arm安装ubuntu,arm交叉编译器

时间:2023-05-03 23:15:42 阅读:170480 作者:601

注:在x86 Ubuntu下构建的aarch64 Ubuntu的版本必须与最终运行程序的aarch64 Ubuntu的版本相匹配。 (如果x86 Ubuntu的版本和构建的aarch64 Ubuntu的版本匹配,安装aarch64的编译工具很简单,直接就是apt install。 本文以Ubuntu 20.04.03为例)。

准备aarch64或arm64的文件系统rootfs; 从3http://cdimage.Ubuntu.com/Ubuntu-base/releases /下载相应版本的base镜像,并基于该镜像构建编译环境; 在x86 Ubuntu中创建新的rootfs目录,并将下载的base镜像到该目录并解压缩;

$ mkdir /path/to/rootfs

在$ tar-zxfubuntu-base-20.04.3-base-arm 64.tar.gz-c/path/to/rootfs x86 Ubuntu上键入chroot到/path/to/rootftft 但是,qemu可以在x86 Ubuntu上构建aarch64 Ubuntu的运行环境来解决这个问题。)

$ sudo apt-getinstallqemu-user-static结实的蝴蝶fmt-support debootstrap注册aarch64的运行环境(update-结实的蝴蝶fmts --display中当前的x86

$ sudo update-要使结实的蝴蝶fmts---enable QEMU-aarch64 x86 Ubuntu能够通过chroot到/path/to/rootfs运行a arch 64程序,请使用QEMU

$ sudo cp -av /usr/配置壮实蝴蝶/QEMU-a arch 64-static/path/to/rootfs/usr /壮实蝴蝶arrch64 Ubuntu的网关;

从$ CP/etc/resolv.conf/path/to/rootfs/etc/resolv.confchroot到aarch64 Ubuntu的rootfs安装开发库。

$ sudo chroot /path/to/rootfs

# aptupdateaptinstall-ylib opencv-dev准备x86上的aarch64的编译工具。

要在sudo apt-getinstallgcc-a arch 64-Linux-gnug-a arch 64-Linux-GNU之后开发arm程序,必须使用第三方库。 您只需从chroot安装到rootfs并配置cmakeLists .这样,使用x86 Ubuntu编译的aarch64程序就可以在相应版本的aarch64 Ubuntu上运行。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。