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

Can't be used on ARM platform because of error 'is_x86_feature_detected can only be used on x86 and x86_64 targets' #55

Closed
iav opened this issue Jul 18, 2020 · 6 comments

Comments

@iav
Copy link

iav commented Jul 18, 2020

Trying to build project for ARM (both aarch64and armv7hf) platforms got an error. It seems there proposedaway to fix:

Compiling v_escape v0.12.0
error[E0658]: use of unstable library feature 'stdsimd'
 --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/v_escape-0.12.0/build.rs:6:8
  |
6 |     if is_x86_feature_detected!("sse2") {
  |        ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information

error:
        is_x86_feature_detected can only be used on x86 and x86_64 targets.
        You can prevent it from being used in other architectures by
        guarding it behind a cfg(target_arch) as follows:

            #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
                if is_x86_feature_detected(...) { ... }
            }

 --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/v_escape-0.12.0/build.rs:6:8
  |
6 |     if is_x86_feature_detected!("sse2") {
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'stdsimd'
  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/v_escape-0.12.0/build.rs:10:8
   |
10 |     if is_x86_feature_detected!("avx2") {
   |        ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information

error:
        is_x86_feature_detected can only be used on x86 and x86_64 targets.
        You can prevent it from being used in other architectures by
        guarding it behind a cfg(target_arch) as follows:

            #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
                if is_x86_feature_detected(...) { ... }
            }

  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/v_escape-0.12.0/build.rs:10:8
   |
10 |     if is_x86_feature_detected!("avx2") {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `v_escape`.

To learn more, run the command again with --verbose.
@zzau13
Copy link
Owner

zzau13 commented Jul 18, 2020

It's true. I had not tried it, I thought the macros was defined in other targets. It's just a #[cfg ()] attributte in v_escape/build.rs. Can you do the PR?

@iav
Copy link
Author

iav commented Jul 18, 2020

Sad I am not a programmer at all.
I can run cargo build on ARM platform if somebody else does changes and project to test it.

@zzau13
Copy link
Owner

zzau13 commented Jul 18, 2020

b0f839c should fix this issue. Can you confirm it?

@iav
Copy link
Author

iav commented Jul 18, 2020

How can I test it?
Currently I just build another project with dependency v_escape.
How can I tell this project to use this fixed version?

@zzau13
Copy link
Owner

zzau13 commented Jul 18, 2020

Use git version

v_htmlescape = { git = "https://github.com/botika/v_escape" }

@zzau13 zzau13 closed this as completed Jul 20, 2020
@iav
Copy link
Author

iav commented Jul 22, 2020

Thank you!
Seems it work.

Sorry for delay.

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

2 participants