]> granicus.if.org Git - clang/commitdiff
Add support for the androideabi environment to our triple support, and
authorChandler Carruth <chandlerc@gmail.com>
Tue, 10 Jan 2012 19:47:42 +0000 (19:47 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 10 Jan 2012 19:47:42 +0000 (19:47 +0000)
for the arm-linux-androideabi triple in particular.

Also use this to do a better job of selecting soft FP settings.

Patch by Evgeniy Stepanov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147872 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
lib/Driver/ToolChains.cpp
lib/Driver/Tools.cpp

index b5916229b0360f90aa573a52e1df7415e30950c4..c9e6fc3de9a079eef58df09be4c9410010d24be7 100644 (file)
@@ -2374,7 +2374,7 @@ public:
 
   bool isEABI() const {
     StringRef Env = getContext().getTargetInfo().getTriple().getEnvironmentName();
-    return (Env == "gnueabi" || Env == "eabi");
+    return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi");
   }
 
 private:
index 3034ede2aee2a26741f138585063e7942289faab..3dcdf13f00bfcc61e4cc41c3d2b198fba3fa57d5 100644 (file)
@@ -1164,7 +1164,10 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(const Driver &D)
     SmallVectorImpl<StringRef> &Triples) {
   if (HostArch == llvm::Triple::arm || HostArch == llvm::Triple::thumb) {
     static const char *const ARMLibDirs[] = { "/lib" };
-    static const char *const ARMTriples[] = { "arm-linux-gnueabi" };
+    static const char *const ARMTriples[] = {
+      "arm-linux-gnueabi",
+      "arm-linux-androideabi"
+    };
     LibDirs.append(ARMLibDirs, ARMLibDirs + llvm::array_lengthof(ARMLibDirs));
     Triples.append(ARMTriples, ARMTriples + llvm::array_lengthof(ARMTriples));
   } else if (HostArch == llvm::Triple::x86_64) {
index bd3d638afd5bc9ee22fd35bfa7b81a88e2e22869..a241712da96b07a60c701c7c72e40cb507b809d7 100644 (file)
@@ -517,6 +517,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
   } else {
     // Select the default based on the platform.
     switch(Triple.getEnvironment()) {
+    case llvm::Triple::ANDROIDEABI:
     case llvm::Triple::GNUEABI:
       ABIName = "aapcs-linux";
       break;
@@ -589,6 +590,15 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
         // EABI is always AAPCS, and if it was not marked 'hard', it's softfp
         FloatABI = "softfp";
         break;
+      case llvm::Triple::ANDROIDEABI: {
+        StringRef ArchName =
+          getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
+        if (ArchName.startswith("v7"))
+          FloatABI = "softfp";
+        else
+          FloatABI = "soft";
+        break;
+      }
       default:
         // Assume "soft", but warn the user we are guessing.
         FloatABI = "soft";