Hi joerg,

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".

http://reviews.llvm.org/D5100

Files:
  lib/Driver/Tools.cpp
  test/Driver/arm-abi.c
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -745,6 +745,11 @@
   } else if (Triple.isOSWindows()) {
     // FIXME: this is invalid for WindowsCE
     ABIName = "aapcs";
+  } else if (Triple.getOS() == llvm::Triple::NetBSD) {
+    if (Triple.getEnvironment() == llvm::Triple::EABI)
+      ABIName = "aapcs";
+    else
+      ABIName = "apcs-gnu";
   } else {
     // Select the default based on the platform.
     switch(Triple.getEnvironment()) {
Index: test/Driver/arm-abi.c
===================================================================
--- test/Driver/arm-abi.c
+++ test/Driver/arm-abi.c
@@ -20,6 +20,12 @@
 // 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
+
 // 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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to