使得DragonOS kernel 能为riscv64编译通过(尚未能启动) (#457)

* 使得DragonOS kernel 能为riscv64编译通过(尚未能启动)

* 修正了系统调用号声明不正确的问题,同时添加了编译配置文档
This commit is contained in:
LoGin
2023-11-25 12:07:39 +08:00
committed by GitHub
parent a1fd1cf1cb
commit 4fda81ce81
112 changed files with 2587 additions and 615 deletions

View File

@ -47,7 +47,7 @@ install_ubuntu_debian_pkg()
lsb-release \
llvm-dev libclang-dev clang gcc-multilib \
gcc build-essential fdisk dosfstools dnsmasq bridge-utils iptables libssl-dev pkg-config \
sphinx
sphinx gcc-riscv64-unknown-elf
# 如果python3没有安装
if [ -z "$(which python3)" ]; then
@ -142,7 +142,7 @@ rustInstall() {
echo "Rust 还未被安装"
echo "请再次运行脚本接受rustup安装"
echo "或通过以下方式手动安装rustc不推荐"
echo "curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly"
echo "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly"
exit
else
echo "是否为Rust换源为国内镜像源(Tuna)"
@ -162,11 +162,20 @@ rustInstall() {
rustup toolchain install nightly-2023-08-15-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2023-01-21-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu
rustup component add rust-src
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add llvm-tools-preview
rustup target add x86_64-unknown-none --toolchain nightly-2023-01-21-x86_64-unknown-linux-gnu
rustup target add x86_64-unknown-none --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu
rustup toolchain install nightly-2023-01-21-riscv64gc-unknown-linux-gnu --force-non-host
rustup toolchain install nightly-2023-08-15-riscv64gc-unknown-linux-gnu --force-non-host
rustup target add riscv64gc-unknown-none-elf --toolchain nightly-2023-01-21-riscv64gc-unknown-linux-gnu
rustup target add riscv64imac-unknown-none-elf --toolchain nightly-2023-01-21-riscv64gc-unknown-linux-gnu
rustup target add riscv64gc-unknown-none-elf --toolchain nightly-2023-08-15-riscv64gc-unknown-linux-gnu
rustup target add riscv64imac-unknown-none-elf --toolchain nightly-2023-08-15-riscv64gc-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add rust-src
rustup component add llvm-tools-preview
rustup default nightly
echo "Rust已经成功的在您的计算机上安装请运行 source ~/.cargo/env 以使rust在当前窗口生效"
fi
@ -265,7 +274,8 @@ else
fi
fi
rustInstall # 安装rust
# 安装rust
rustInstall
# 初始化DragonOS的musl交叉编译工具链