Build fail with build target thumbv7em-none-eabi (version 0.11.2)
I'm trying to use encode and decode function in my code and build it with latest minicbor version (0.11.2) on build target thumbv7em-none-eabi, but build failed with the following error log:
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /Users/khlung/projects/niomon-monorepo/embedded/access-core/rust/access-core/Cargo.toml
workspace: /Users/khlung/projects/niomon-monorepo/embedded/access-core/rust/Cargo.toml
Compiling typenum v1.14.0
Compiling serde v1.0.130
Compiling ryu v1.0.5
Compiling serde_json v1.0.68
Compiling cfg-if v1.0.0
Compiling opaque-debug v0.3.0
Compiling itoa v0.4.8
Compiling bytes v1.1.0
Compiling minicbor v0.11.2
Compiling generic-array v0.14.4
error[E0412]: cannot find type `AtomicU64` in module `core::sync::atomic`
--> /Users/khlung/.cargo/registry/src/github.com-1ecc6299db9ec823/minicbor-0.11.2/src/decode.rs:269:25
|
269 | core::sync::atomic::AtomicU64
| ^^^^^^^^^ help: a struct with a similar name exists: `AtomicU16`
|
::: /Users/khlung/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2143:1
|
2143 | / atomic_int! {
2144 | | cfg(target_has_atomic = "16"),
2145 | | cfg(target_has_atomic_equal_alignment = "16"),
2146 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
2159 | | u16 AtomicU16 ATOMIC_U16_INIT
2160 | | }
| |_- similarly named struct `AtomicU16` defined here
error[E0412]: cannot find type `AtomicI64` in module `core::sync::atomic`
--> /Users/khlung/.cargo/registry/src/github.com-1ecc6299db9ec823/minicbor-0.11.2/src/decode.rs:274:25
|
274 | core::sync::atomic::AtomicI64
| ^^^^^^^^^ help: a struct with a similar name exists: `AtomicI16`
|
::: /Users/khlung/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2124:1
|
2124 | / atomic_int! {
2125 | | cfg(target_has_atomic = "16"),
2126 | | cfg(target_has_atomic_equal_alignment = "16"),
2127 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
2140 | | i16 AtomicI16 ATOMIC_I16_INIT
2141 | | }
| |_- similarly named struct `AtomicI16` defined here
error[E0412]: cannot find type `AtomicU64` in module `core::sync::atomic`
--> /Users/khlung/.cargo/registry/src/github.com-1ecc6299db9ec823/minicbor-0.11.2/src/encode.rs:238:25
|
238 | core::sync::atomic::AtomicU64
| ^^^^^^^^^ help: a struct with a similar name exists: `AtomicU16`
|
::: /Users/khlung/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2143:1
|
2143 | / atomic_int! {
2144 | | cfg(target_has_atomic = "16"),
2145 | | cfg(target_has_atomic_equal_alignment = "16"),
2146 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
2159 | | u16 AtomicU16 ATOMIC_U16_INIT
2160 | | }
| |_- similarly named struct `AtomicU16` defined here
error[E0412]: cannot find type `AtomicI64` in module `core::sync::atomic`
--> /Users/khlung/.cargo/registry/src/github.com-1ecc6299db9ec823/minicbor-0.11.2/src/encode.rs:243:25
|
243 | core::sync::atomic::AtomicI64
| ^^^^^^^^^ help: a struct with a similar name exists: `AtomicI16`
|
::: /Users/khlung/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:2124:1
|
2124 | / atomic_int! {
2125 | | cfg(target_has_atomic = "16"),
2126 | | cfg(target_has_atomic_equal_alignment = "16"),
2127 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
2140 | | i16 AtomicI16 ATOMIC_I16_INIT
2141 | | }
| |_- similarly named struct `AtomicI16` defined here
For more information about this error, try `rustc --explain E0412`.
error: could not compile `minicbor` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
But I can successfully build my code on previous minicbor version (0.11.1).
core::sync::atomic::AtomicI64 notes that This type is only available on platforms that support atomic loads and stores of i64. which is not compatible with thumbv7em-none-eabi.