Skip to content

could not compile std_detect on FreeBSD aarch64 rust 1.59.0 #1289

Closed
@MikaelUrankar

Description

@MikaelUrankar
Contributor

error log:

error: cannot find macro `asm` in this scope
  --> library/stdarch/crates/std_detect/src/detect/os/aarch64.rs:37:13
   |                                                                                                                           
37 |             asm!(       
   |             ^^^                                                                                                           
   |                                                                                                                           
   = note: consider importing this macro:                                                                                      
           core::arch::asm 
                                                                                                                               
error: cannot find macro `asm` in this scope
  --> library/stdarch/crates/std_detect/src/detect/os/aarch64.rs:52:13
   | 
52 |             asm!(               
   |             ^^^                          
   |
   = note: consider importing this macro:
           core::arch::asm

error: cannot find macro `asm` in this scope
  --> library/stdarch/crates/std_detect/src/detect/os/aarch64.rs:83:13
   |
83 |             asm!(
   |             ^^^
   |
   = note: consider importing this macro:
           core::arch::asm

Activity

MikaelUrankar

MikaelUrankar commented on Mar 8, 2022

@MikaelUrankar
ContributorAuthor

As noted in the error, importing "core::arch::asm" seems to fix it:

--- library/stdarch/crates/std_detect/src/detect/os/aarch64.rs.orig     2022-03-08 09:13:53.485340000 +0100
+++ library/stdarch/crates/std_detect/src/detect/os/aarch64.rs  2022-03-08 09:27:20.315462000 +0100
@@ -17,6 +17,7 @@
 //! - [Linux documentation](https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt)
 
 use crate::detect::{cache, Feature};
+use core::arch::asm;
 
 /// Try to read the features from the system registers.
 ///
added a commit that references this issue on Mar 9, 2022
4557e22
lu-zero

lu-zero commented on Mar 9, 2022

@lu-zero
Contributor

I reproduced the problem with -Z build-std, the pr should fix your problem.

added a commit that references this issue on Mar 9, 2022
63e70c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @lu-zero@MikaelUrankar

      Issue actions

        could not compile `std_detect` on FreeBSD aarch64 rust 1.59.0 · Issue #1289 · rust-lang/stdarch