Repository: SergioBenitez/Figment (language: rust)

Issue:
Fails to build on armv5te
Hello. 
I am using Rocket which depends on this crate and it fails to compile with the `armv5te-unknown-linux-musleabi` target, because AtomicU64 is not supported and unconditionally used in value/tag.rs.

The error is:
```
2 | use std::sync::atomic::{Ordering, AtomicU64};
  |                                   ^^^^^^^^^
  |                                   |
  |                                   no `AtomicU64` in `sync::atomic`
  |                                   help: a similar name exists in the module: `AtomicU8`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `figment`
```



Discussion / hints:
Okay. I wouldn't be surprised if there's more code in Rocket or some of its dependencies that are targeted to 64-bit processors.

I'm open to a fix, but it is not something I will implement myself. Feel free to take it on. The fix should be backwards compatible and have no performance impact on 64-bit processors with the requisite atomic instructions. I don't mind a performance impact on older processors. 

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5e3a0a6..51e98fb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -42,3 +42,30 @@ jobs:
       - name: Run Tests
         run: ./scripts/test.sh
         shell: bash
+
+  test_cross:
+    name: Linux ARMv7 (${{ matrix.toolchain }})
+    runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        toolchain: [nightly, stable]
+
+    steps:
+      - name: Checkout Sources
+        uses: actions/checkout@v2
+
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: ${{ matrix.toolchain }}
+          target: armv7-unknown-linux-gnueabihf
+          override: true
+
+      - name: Build
+        uses: actions-rs/cargo@v1
+        with:
+          use-cross: true
+          command: build
+          args: --target armv7-unknown-linux-gnueabihf --all-features
diff --git a/Cargo.toml b/Cargo.toml
index 269c1dc..d98c4b5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,6 +29,9 @@ serde_yaml = { version = "0.8", optional = true }
 tempfile = { version = "3", optional = true }
 parking_lot = { version = "0.11", optional = true }
 
+[target.'cfg(any(target_pointer_width = "8", target_pointer_width = "16", target_pointer_width = "32"))'.dependencies]
+atomic = "0.5.0"
+
 [dev-dependencies]
 tempfile = "3"
 parking_lot = "0.11"
diff --git a/src/value/tag.rs b/src/value/tag.rs
index 6514893..cb35323 100644
--- a/src/value/tag.rs
+++ b/src/value/tag.rs
@@ -1,9 +1,8 @@
 use std::fmt;
-use std::sync::atomic::{Ordering, AtomicU64};
+use std::sync::atomic::Ordering;
 
 use serde::{de, ser};
 use crate::profile::{Profile, ProfileTag};
-
 /// An opaque, unique tag identifying a value's [`Metadata`](crate::Metadata)
 /// and profile.
 ///
@@ -17,7 +16,12 @@ use crate::profile::{Profile, ProfileTag};
 #[derive(Copy, Clone)]
 pub struct Tag(u64);
 
-static COUNTER: AtomicU64 = AtomicU64::new(1);
+#[cfg(any(target_pointer_width = "8", target_pointer_width = "16", target_pointer_width = "32"))]
+static COUNTER: atomic::Atomic<u64> = atomic::Atomic::new(1);
+
+#[cfg(not(any(target_pointer_width = "8", target_pointer_width = "16", target_pointer_width = "32")))]
+static COUNTER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
+
 
 impl Tag {
     /// The default `Tag`. Such a tag will never have associated metadata and


Test patch: