From 9f192e81bffff66a69c16c41b5e5e1f101d40e69 Mon Sep 17 00:00:00 2001
From: Chandler Carruth <chandlerc@gmail.com>
Date: Sat, 11 Jun 2016 04:57:29 +0000
Subject: [PATCH] Revert "Strip Android version when looking up toolchain
 paths."

This reverts commit r272413. The tests here have been failing on several
different build bots for over 10 hours.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272454 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Driver/Driver.cpp                                  | 10 +---------
 .../bin/arm-linux-androideabi-ld                       |  0
 .../bin/arm-linux-androideabi-ld.exe                   |  0
 test/Driver/android-triple-version.c                   | 10 ----------
 4 files changed, 1 insertion(+), 19 deletions(-)
 delete mode 100755 test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld
 delete mode 100755 test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld.exe
 delete mode 100644 test/Driver/android-triple-version.c

diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 7db9e112a15..f7e15309ac3 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -2343,15 +2343,7 @@ void Driver::generatePrefixedToolNames(
     const char *Tool, const ToolChain &TC,
     SmallVectorImpl<std::string> &Names) const {
   // FIXME: Needs a better variable than DefaultTargetTriple
-  StringRef Triple = DefaultTargetTriple;
-
-  // On Android, the target triple can include a version number that needs to
-  // be stripped.
-  if (TC.getTriple().isAndroid()) {
-    Triple = Triple.rtrim("0123456789");
-  }
-
-  Names.emplace_back((Triple + "-" + Tool).str());
+  Names.emplace_back(DefaultTargetTriple + "-" + Tool);
   Names.emplace_back(Tool);
 
   // Allow the discovery of tools prefixed with LLVM's default target triple.
diff --git a/test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld b/test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld
deleted file mode 100755
index e69de29bb2d..00000000000
diff --git a/test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld.exe b/test/Driver/Inputs/android_triple_version/bin/arm-linux-androideabi-ld.exe
deleted file mode 100755
index e69de29bb2d..00000000000
diff --git a/test/Driver/android-triple-version.c b/test/Driver/android-triple-version.c
deleted file mode 100644
index 093f71f88bd..00000000000
--- a/test/Driver/android-triple-version.c
+++ /dev/null
@@ -1,10 +0,0 @@
-// Android's target triples can contain a version number in the environment
-// field (e.g. arm-linux-androideabi9).
-// Make sure that any version is stripped when finding toolchain binaries.
-
-// RUN: env "PATH=%S/Inputs/android_triple_version/bin" \
-// RUN:     %clang -### -target arm-linux-androideabi %s 2>&1 | FileCheck %s
-// RUN: env "PATH=%S/Inputs/android_triple_version/bin" \
-// RUN:     %clang -### -target arm-linux-androideabi9 %s 2>&1 | FileCheck %s
-
-// CHECK: arm-linux-androideabi-ld
-- 
GitLab