r217141 - ARM: Default to apcs-gnu ABI for NetBSD

Oliver Stannard oliver.stannard at arm.com
Thu Sep 4 03:38:53 PDT 2014


Author: olista01
Date: Thu Sep  4 05:38:53 2014
New Revision: 217141

URL: http://llvm.org/viewvc/llvm-project?rev=217141&view=rev
Log:
ARM: Default to apcs-gnu ABI for NetBSD

r216662 changed the default ABI for 32-bit ARM targets to be "aapcs"
when no environment is given in the triple, however NetBSD requires it
to be "apcs-gnu".


Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/arm-abi.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=217141&r1=217140&r2=217141&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Sep  4 05:38:53 2014
@@ -755,9 +755,14 @@ void Clang::AddARMTargetArgs(const ArgLi
       break;
     case llvm::Triple::EABIHF:
     case llvm::Triple::EABI:
-    default:
       ABIName = "aapcs";
       break;
+    default:
+      if (Triple.getOS() == llvm::Triple::NetBSD)
+        ABIName = "apcs-gnu";
+      else
+        ABIName = "aapcs";
+      break;
     }
   }
   CmdArgs.push_back("-target-abi");

Modified: cfe/trunk/test/Driver/arm-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-abi.c?rev=217141&r1=217140&r2=217141&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arm-abi.c (original)
+++ cfe/trunk/test/Driver/arm-abi.c Thu Sep  4 05:38:53 2014
@@ -20,6 +20,14 @@
 // RUN: %clang -target arm--windows-gnueabi %s -### -o %t.o 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-AAPCS %s
 
+// NetBSD defaults to apcs-gnu, but can also use aapcs
+// RUN: %clang -target arm--netbsd- %s -### -o %t.o 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-APCS-GNU %s
+// RUN: %clang -target arm--netbsd-eabi %s -### -o %t.o 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-AAPCS %s
+// RUN: %clang -target arm--netbsd-eabihf %s -### -o %t.o 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK-AAPCS %s
+
 // Otherwise, ABI is celected based on environment
 // RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s





More information about the cfe-commits mailing list