extract_utils: implement patchelf

Change-Id: I406f70ef1ce9ec7a0998f77439b7d3fa3ec4e62a

fixup! extract_utils: implement patchelf

* Move $PATCHELF exporting from oat2dex to setup_vendor
* Since it requires $HOST to be set, let's make it global, so oat2dex can also use it

Change-Id: I4556a3c19cd01c9b3a68d358d19a361217d9c3c1
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index 002e238..635027f 100755
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -29,6 +29,7 @@
 FULLY_DEODEXED=-1
 
 TMPDIR=$(mktemp -d)
+HOST="$(uname | tr '[:upper:]' '[:lower:]')"
 
 #
 # cleanup
@@ -101,6 +102,10 @@
         VENDOR_STATE=0
         VENDOR_RADIO_STATE=0
     fi
+
+    if [ -z "$PATCHELF" ]; then
+        export PATCHELF="$OMNI_ROOT"/vendor/omni/build/tools/${HOST}/bin/patchelf
+    fi
 }
 
 # Helper functions for parsing a spec.
@@ -1248,7 +1253,6 @@
     local SRC="$3"
     local TARGET=
     local OAT=
-    local HOST="$(uname | tr '[:upper:]' '[:lower:]')"
 
     if [ -z "$BAKSMALIJAR" ] || [ -z "$SMALIJAR" ]; then
         export BAKSMALIJAR="$OMNI_ROOT"/vendor/omni/build/tools/smali/baksmali.jar