Set ABIs correctly for OpenBSD/arm; soft float and aapcs-linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brad Smith 2017-02-28 03:20:26 +00:00
parent 55aef8b0cd
commit b144ec9ca3
5 changed files with 17 additions and 0 deletions

View File

@ -5166,6 +5166,8 @@ public:
default:
if (Triple.getOS() == llvm::Triple::NetBSD)
setABI("apcs-gnu");
else if (Triple.getOS() == llvm::Triple::OpenBSD)
setABI("aapcs-linux");
else
setABI("aapcs");
break;

View File

@ -191,6 +191,10 @@ arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
}
break;
case llvm::Triple::OpenBSD:
ABI = FloatABI::Soft;
break;
default:
switch (Triple.getEnvironment()) {
case llvm::Triple::GNUEABIHF:

View File

@ -787,6 +787,8 @@ void Clang::AddARMTargetArgs(const llvm::Triple &Triple, const ArgList &Args,
default:
if (Triple.getOS() == llvm::Triple::NetBSD)
ABIName = "apcs-gnu";
else if (Triple.getOS() == llvm::Triple::OpenBSD)
ABIName = "aapcs-linux";
else
ABIName = "aapcs";
break;

View File

@ -28,6 +28,10 @@
// RUN: %clang -target arm--netbsd-eabihf %s -### -o %t.o 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
// OpenBSD defaults to aapcs-linux
// RUN: %clang -target arm--openbsd- %s -### -o %t.o 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
// Otherwise, ABI is selected based on environment
// RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s

View File

@ -96,3 +96,8 @@
// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"
// CHECK-STATIC-PIE-NOT: "-nopie"
// CHECK-NOPIE: "-nopie" "{{.*}}crt0.o"
// Check ARM float ABI
// RUN: %clang -target arm-unknown-openbsd -### -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ARM-FLOAT-ABI %s
// CHECK-ARM-FLOAT-ABI: "-mfloat-abi" "soft"