Upgrade rust/crates/clang-sys to 1.0.2

Test: make
Change-Id: Iaad849bd41ba039f97fcb68ff5b7303b38c16990
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index f284d32..a6a7b1b 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "ddd3af568ed76a2af94bcc3a9fd06af8e00fec99"
+    "sha1": "a5f2b5fef678dd436d16750922f59b2146c9b055"
   }
 }
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 58e4502..a114fb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+## [1.0.2] - 2020-11-17
+
+### Fixed
+- Fixed `Clang::find` to properly search directories returned by the
+`llvm-config --bindir` and `xcodebuild -find clang` commands
+- Improved version selection algorithm in the case where there are multiple
+instances of `libclang` with the highest version found; previously the lowest
+priority instance would be selected instead of the highest priority instance
+(e.g., the versions found by searching the fallback directories were preferred
+over the versions found by searching the `llvm-config --prefix` directory)
+
 ## [1.0.1] - 2020-10-01
 
 ### Changed
diff --git a/Cargo.toml b/Cargo.toml
index 7937a28..895d93f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
 
 [package]
 name = "clang-sys"
-version = "1.0.1"
+version = "1.0.2"
 authors = ["Kyle Mayes <kyle@mayeses.com>"]
 build = "build.rs"
 links = "clang"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 18b5c1a..2986183 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -3,7 +3,7 @@
 name = "clang-sys"
 authors = ["Kyle Mayes <kyle@mayeses.com>"]
 
-version = "1.0.1"
+version = "1.0.2"
 
 readme = "README.md"
 license = "Apache-2.0"
diff --git a/METADATA b/METADATA
index 39ca89e..ad5f1e4 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/clang-sys/clang-sys-1.0.1.crate"
+    value: "https://static.crates.io/crates/clang-sys/clang-sys-1.0.2.crate"
   }
-  version: "1.0.1"
+  version: "1.0.2"
   license_type: NOTICE
   last_upgrade_date {
     year: 2020
-    month: 10
-    day: 26
+    month: 11
+    day: 17
   }
 }
diff --git a/build/dynamic.rs b/build/dynamic.rs
index 8a9e5d3..c15973c 100644
--- a/build/dynamic.rs
+++ b/build/dynamic.rs
@@ -181,6 +181,20 @@
 pub fn find(runtime: bool) -> Result<(PathBuf, String), String> {
     search_libclang_directories(runtime)?
         .iter()
+        // We want to find the `libclang` shared library with the highest
+        // version number, hence `max_by_key` below.
+        //
+        // However, in the case where there are multiple such `libclang` shared
+        // libraries, we want to use the order in which they appeared in the
+        // list returned by `search_libclang_directories` as a tiebreaker since
+        // that function returns `libclang` shared libraries in descending order
+        // of preference by how they were found.
+        //
+        // `max_by_key`, perhaps surprisingly, returns the *last* item with the
+        // maximum key rather than the first which results in the opposite of
+        // the tiebreaking behavior we want. This is easily fixed by reversing
+        // the list first.
+        .rev()
         .max_by_key(|f| &f.2)
         .cloned()
         .map(|(path, filename, _)| (path, filename))
diff --git a/out/dynamic.rs b/out/dynamic.rs
index 8a9e5d3..c15973c 100644
--- a/out/dynamic.rs
+++ b/out/dynamic.rs
@@ -181,6 +181,20 @@
 pub fn find(runtime: bool) -> Result<(PathBuf, String), String> {
     search_libclang_directories(runtime)?
         .iter()
+        // We want to find the `libclang` shared library with the highest
+        // version number, hence `max_by_key` below.
+        //
+        // However, in the case where there are multiple such `libclang` shared
+        // libraries, we want to use the order in which they appeared in the
+        // list returned by `search_libclang_directories` as a tiebreaker since
+        // that function returns `libclang` shared libraries in descending order
+        // of preference by how they were found.
+        //
+        // `max_by_key`, perhaps surprisingly, returns the *last* item with the
+        // maximum key rather than the first which results in the opposite of
+        // the tiebreaking behavior we want. This is easily fixed by reversing
+        // the list first.
+        .rev()
         .max_by_key(|f| &f.2)
         .cloned()
         .map(|(path, filename, _)| (path, filename))
diff --git a/src/support.rs b/src/support.rs
index f061275..2441487 100644
--- a/src/support.rs
+++ b/src/support.rs
@@ -84,11 +84,11 @@
             paths.push(path.into());
         }
         if let Ok(path) = run_llvm_config(&["--bindir"]) {
-            paths.push(path.into());
+            paths.push(path.lines().next().unwrap().into());
         }
         if cfg!(target_os = "macos") {
             if let Ok((path, _)) = run("xcodebuild", &["-find", "clang"]) {
-                paths.push(path.into());
+                paths.push(path.lines().next().unwrap().into());
             }
         }
         paths.extend(env::split_paths(&env::var("PATH").unwrap()));