微信公众号的网站,搜狗网站制作,wordpress中设置,学编程的好处很多朋友只有x86的系统#xff0c;因为我们上学时代和工作机大部分都x86系统。loongson推出LoongArch指令集后#xff0c;也想尝尝鲜或者作为一个开发者又不想买新的机器#xff0c;此时就可以用到我下边为大家介绍的方法。
此处也给大家提供一个debian社区发布的官方的文档…很多朋友只有x86的系统因为我们上学时代和工作机大部分都x86系统。loongson推出LoongArch指令集后也想尝尝鲜或者作为一个开发者又不想买新的机器此时就可以用到我下边为大家介绍的方法。
此处也给大家提供一个debian社区发布的官方的文档
debian社区发布LoongArch/sbuildQEMU - Debian Wiki
也可以参考我为大家已经整理好的资料 GitHub - loongson-zn/qemu-debian
如果你翻墙困难我将整理的readme粘贴到此处 宿主机环境 架 构x86_64
系统环境debian bookworm
具体操作步骤
安装qemu-user
rootdebian:~# apt install binfmt-support
rootdebian:~# apt build-dep qemu-user-static
rootdebian:~# git clone https://github.com/qemu/qemu.git
rootdebian:~# cd qemu
rootdebian:~/qemu# ./configure --static --disable-system --target-listloongarch64-linux-user
rootdebian:~/qemu# make
rootdebian:~/qemu# cp build/loongarch64-linux-user/qemu-loongarch64 /usr/bin/qemu-loongarch64-static
rootdebian:~/qemu# cat /tmp/qemu-loongarch64 EOF
package qemu-user-static
type magic
offset 0
magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01
mask \xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
interpreter /usr/bin/qemu-loongarch64-static
EOFrootdebian:~/qemu# update-binfmts --import /tmp/qemu-loongarch64 制作LA最小镜像
rootdebian:~# apt install debootstrap sbuild debian-ports-archive-keyring
rootdebian:~# debootstrap --foreign --archloong64 --variantbuildd --includedebian-ports-archive-keyring --verbose --componentsmain --keyring/etc/apt/trusted.gpg.d/debian-ports-archive-2023.gpg --resolve-deps --extra-suitesunreleased unstable /srv/chroots/sid-loong64-sbuild/ http://ftp.ports.debian.org/debian-ports
rootdebian:~# cd /srv/chroots/sid-loong64-sbuild/
rootdebian:/srv/chroots/sid-loong64-sbuild# cp /usr/bin/qemu-loongarch64-static usr/bin/
rootdebian:/srv/chroots/sid-loong64-sbuild# chroot .
I have no name!loongson01:/# /debootstrap/debootstrap --second-stage准备gcc编译器我提供的gcc及qemu是支持lasx及lsx向量的如果不需要用debian仓库安装即可
git clone https://github.com/loongson-zn/qemu-debian.git
cd qemu-debian/gcc_13.2.0-7.1_nodbg
apt install ./*
apt install gcc gfortran
mount -t proc proc proc
mount -t sysfs sys sys
mount -t devtmpfs dev dev
mount -t devpts devpts dev/pts
mount -t tmpfs shmfs dev/shm
写这篇博客是在2023.12.15LA还处于正在推进debian社区 的阶段此时的地址为
#rootloongson01:~# cat /srv/chroots/sid-loong64-sbuild/etc/apt/sources.list
# binary default
deb http://ftp.ports.debian.org/debian-ports unstable main
deb http://ftp.ports.debian.org/debian-ports unreleased main