Add post_update.sh to fix up Android.bp am: 8cffafec6b

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/serde/+/1444016

Change-Id: Iceee00e3bca445f75083fee1ddea02bd5c8f631e
diff --git a/METADATA b/METADATA
index 2ca368d..13e5248 100644
--- a/METADATA
+++ b/METADATA
@@ -1,7 +1,5 @@
 name: "serde"
-description:
-    "A generic serialization/deserialization framework"
-
+description: "A generic serialization/deserialization framework"
 third_party {
   url {
     type: HOMEPAGE
@@ -12,7 +10,10 @@
     value: "https://static.crates.io/crates/serde/serde-1.0.115.crate"
   }
   version: "1.0.115"
-  last_upgrade_date { year: 2020 month: 8 day: 21 }
   license_type: NOTICE
+  last_upgrade_date {
+    year: 2020
+    month: 8
+    day: 21
+  }
 }
-
diff --git a/post_update.sh b/post_update.sh
new file mode 100755
index 0000000..7de4f29
--- /dev/null
+++ b/post_update.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# $1 Path to the new version.
+# $2 Path to the old version.
+
+set -x
+set -e
+
+# work around missing std_atomic64 on arm/arm64
+SRCFILE=Android.bp
+OLDSTR='"--cfg std_atomic64",'
+NEWSTR='// "--cfg std_atomic64", // not for arm/arm64'
+sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
+# Make sure that sed replaced $OLDSTR with $NEWSTR
+grep "$NEWSTR" $SRCFILE > /dev/null