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

could not compile std_detect on FreeBSD aarch64 rust 1.59.0 #1289

Closed
MikaelUrankar opened this issue Mar 8, 2022 · 2 comments · Fixed by #1290
Closed

could not compile std_detect on FreeBSD aarch64 rust 1.59.0 #1289

MikaelUrankar opened this issue Mar 8, 2022 · 2 comments · Fixed by #1290

Comments

@MikaelUrankar
Copy link
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
@MikaelUrankar
Copy link
Contributor Author

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.
 ///

@lu-zero
Copy link
Contributor

lu-zero commented Mar 9, 2022

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

lu-zero added a commit to lu-zero/stdarch that referenced this issue Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants