Commit c82a481e authored by Brad Smith's avatar Brad Smith
Browse files

Merging r296430:

------------------------------------------------------------------------
r296430 | brad | 2017-02-27 22:20:26 -0500 (Mon, 27 Feb 2017) | 2 lines

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@301086 91177308-0d34-0410-b5e6-96231b3b80d8
parent 86a3750c
......@@ -5146,6 +5146,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;
......
......@@ -962,6 +962,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:
......@@ -1251,6 +1255,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;
......
......@@ -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
......
......@@ -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"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment