Reland "Use explicit path for libtool rather than implicit invocation of xcrun."

This reverts commit 6f979049822acf3e4cde9b34f5dcfeb8e94745e5.

Reason for revert: This doesn't cause compile failure.
I have to revert 
https://chromium-review.googlesource.com/c/chromium/src/+/1649054

Original change's description:
> Revert "Use explicit path for libtool rather than implicit invocation of xcrun."
> 
> This reverts commit 1f49775ab209ba5668029cdffe63f40ce5e98668.
> 
> Reason for revert: causes compile failure on Mac ASan 64 Builder
> https://ci.chromium.org/p/chromium/builders/ci/Mac%20ASan%2064%20Builder/84739
> https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8911354223898031376/+/steps/compile/0/stdout
> 
> 
> Original change's description:
> > Use explicit path for libtool rather than implicit invocation of xcrun.
> > 
> > libtool is part of the default path at /usr/bin/libtool. That binary is just a
> > shim that calls out to xcrun to find the actual libtool. If we're using hermetic
> > xcode, then we can explicitly specify the path to avoid invoking xcrun.
> > 
> > Bug: 971452
> > Change-Id: If9344a244160ccc43895cf913d48f9c9a44ac5d9
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648836
> > Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> > Commit-Queue: Erik Chen <erikchen@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#666906}
> 
> TBR=dpranke@chromium.org,erikchen@chromium.org
> 
> Change-Id: I0cdc4acdff512213116ecd872230b6d7b634b865
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 971452
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1647598
> Reviewed-by: Takashi Sakamoto <tasak@google.com>
> Commit-Queue: Takashi Sakamoto <tasak@google.com>
> Cr-Commit-Position: refs/heads/master@{#666983}

TBR=dpranke@chromium.org,tasak@google.com,erikchen@chromium.org

Change-Id: I1180b957926016864fcb83f351985ce6ec4fb8bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 971452
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1647600
Reviewed-by: Takashi Sakamoto <tasak@google.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#666985}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 20fb0ca2321693ac194b9efd7c83d8a4b856fdb4
diff --git a/mac/BUILD.gn b/mac/BUILD.gn
index 3daf045..9cf25a9 100644
--- a/mac/BUILD.gn
+++ b/mac/BUILD.gn
@@ -269,7 +269,17 @@
       # corrupted by this process. Don't use spaces for source files or labels.
       rspfile = "{{output}}.rsp"
       rspfile_content = "{{inputs_newline}}"
-      command = "$env_wrapper rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script libtool -static {{arflags}} -o {{output}} -filelist $rspfile"
+
+      # libtool is part of the default path at /usr/bin/libtool. That binary is
+      # just a shim that calls out to xcrun to find the actual libtool. If we're
+      # using hermetic xcode, then we can explicitly specify the path to avoid
+      # invoking xcrun.
+      if (use_system_xcode) {
+        libtool = "libtool"
+      } else {
+        libtool = "$hermetic_xcode_path/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool"
+      }
+      command = "$env_wrapper rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script $libtool -static {{arflags}} -o {{output}} -filelist $rspfile"
       description = "LIBTOOL-STATIC {{output}}"
       outputs = [
         "{{output_dir}}/{{target_output_name}}{{output_extension}}",