rust-osdev / bootloader

An experimental pure-Rust x86 bootloader
Apache License 2.0
1.31k stars 204 forks source link

Deprecation: `asm!` > `llvm_asm!` #107

Closed kennystrawnmusic closed 4 years ago

kennystrawnmusic commented 4 years ago

Should be a pretty simple problem to fix, but as of 24 April 2020, use of the asm! macro is triggering multiple deprecation warnings:

warning: use of deprecated item 'asm': the syntax of asm! will change soon, use llvm_asm! to avoid breakage
  --> src/main.rs:46:5
   |
46 |     asm!("call $1; ${:private}.spin.${:uid}: jmp ${:private}.spin.${:uid}" ::
   |     ^^^ help: replace the use of the deprecated item: `llvm_asm`
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'asm': the syntax of asm! will change soon, use llvm_asm! to avoid breakage
  --> src/main.rs:92:5
   |
92 |     asm!("mov bx, 0x0
   |     ^^^ help: replace the use of the deprecated item: `llvm_asm`

Should be an easy fix if you ask me ― since there's probably a lot more instances than those two, is this being worked on already?

kennystrawnmusic commented 4 years ago

Pull Request #108 includes a fix for this.

TzviPM commented 2 years ago

Hmm... Current nightly is giving me the opposite issue right now:

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
  --> src/main.rs:45:5
   |
45 |     llvm_asm!("call $1; ${:private}.spin.${:uid}: jmp ${:private}.spin.${:uid}" ::
   |     ^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
  --> src/main.rs:91:5
   |
91 |     llvm_asm!("mov bx, 0x0
   |     ^^^^^^^^

warning: `bootloader` (bin "bootloader") generated 2 warnings

Looks like x86_64 updated to use asm! as well: https://github.com/rust-osdev/x86_64/issues/164

My understanding is that asm! was renamed to llvm_asm! as an intermediate step to keep it as a legacy API, but there is a new asm! macro that should be used.