Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用cargo qemu进行build时报错 #10

Closed
leo-frank opened this issue Dec 25, 2021 · 0 comments
Closed

使用cargo qemu进行build时报错 #10

leo-frank opened this issue Dec 25, 2021 · 0 comments

Comments

@leo-frank
Copy link

我在使用cargo qemu进行编译,显示了如下错误。
➜ [/home/wynn/Desktop/codes/rustsbi-qemu] git:(main) cargo qemu Finished dev [unoptimized + debuginfo] target(s) in 0.03s Runningtarget/debug/xtask qemuxtask: mode: Debug Compiling rustsbi v0.2.0-alpha.8 error: cannot find macroasmin this scope --> /home/wynn/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/rustsbi-0.2.0-alpha.8/src/privileged.rs:30:15 | 30 | () => asm!(" | ^^^ | = note: consider importing this macro: core::arch::asm
因此,我认为是rustsbi v0.2.0-alpha.8导致的编译错误。
这是我使用的toolchain 的情况:
`➜ [/home/wynn/Desktop/codes/rustsbi-qemu] git:(main) rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /home/wynn/.rustup

installed toolchains

stable-x86_64-unknown-linux-gnu
nightly-2018-09-18-x86_64-unknown-linux-gnu
nightly-2019-07-15-x86_64-unknown-linux-gnu
nightly-2020-05-01-x86_64-unknown-linux-gnu
nightly-2020-06-04-x86_64-unknown-linux-gnu
nightly-2020-06-27-x86_64-unknown-linux-gnu
nightly-2021-10-15-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain

riscv64imac-unknown-none-elf
x86_64-unknown-linux-gnu

active toolchain

nightly-x86_64-unknown-linux-gnu (overridden by '/home/wynn/Desktop/codes/rustsbi-qemu/rust-toolchain.toml')
rustc 1.59.0-nightly (475b00aa4 2021-12-24)`

奇怪的是,我在rustsbi的仓库下(https://github.com/rustsbi/rustsbi/)对rustsbi的最新版本0.2.0-alpha.9进行编译不会报错。
`
➜ [/home/wynn/Desktop/codes/rustsbi] git:(master) cargo build --target riscv64imac-unknown-none-elf

Compiling memchr v2.4.1
Compiling regex-syntax v0.6.25
Compiling lazy_static v1.4.0
Compiling nb v1.0.0
Compiling bit_field v0.10.1
Compiling void v1.0.2
Compiling bare-metal v1.0.0
Compiling nb v0.1.3
Compiling embedded-hal v0.2.6
Compiling aho-corasick v0.7.18
Compiling regex v1.5.4
Compiling riscv-target v0.1.2
Compiling riscv v0.7.0
Compiling rustsbi v0.2.0-alpha.9 (/home/wynn/Desktop/codes/rustsbi)
Finished dev [unoptimized + debuginfo] target(s) in 6.48s
并且编译rustsbi使用的toolchain和编译rustsbi-qemu时使用的toolchain相同:
➜ [/home/wynn/Desktop/codes/rustsbi] git:(master) rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /home/wynn/.rustup

installed toolchains

stable-x86_64-unknown-linux-gnu
nightly-2018-09-18-x86_64-unknown-linux-gnu
nightly-2019-07-15-x86_64-unknown-linux-gnu
nightly-2020-05-01-x86_64-unknown-linux-gnu
nightly-2020-06-04-x86_64-unknown-linux-gnu
nightly-2020-06-27-x86_64-unknown-linux-gnu
nightly-2021-10-15-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain

riscv64imac-unknown-none-elf
x86_64-unknown-linux-gnu

active toolchain

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.59.0-nightly (475b00aa4 2021-12-24)
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant