diff options
author | andrew <andrew@FreeBSD.org> | 2014-03-23 14:06:09 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2014-03-23 14:06:09 +0000 |
commit | 5875d91c71a5fe9fbad03aaebf2f6459aebd8466 (patch) | |
tree | 502c5944e51d008c2ed9c43b5b25be0d6a5eac83 | |
parent | 8842d57879afa74f815933cf0c1499bf300ae162 (diff) | |
download | FreeBSD-src-5875d91c71a5fe9fbad03aaebf2f6459aebd8466.zip FreeBSD-src-5875d91c71a5fe9fbad03aaebf2f6459aebd8466.tar.gz |
Add the llvm/clang patch for r263619.
-rw-r--r-- | contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff b/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff new file mode 100644 index 0000000..d13648e --- /dev/null +++ b/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff @@ -0,0 +1,81 @@ +Index: tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- tools/clang/lib/Driver/ToolChains.cpp ++++ tools/clang/lib/Driver/ToolChains.cpp +@@ -2034,6 +2034,7 @@ + bool FreeBSD::UseSjLjExceptions() const { + // FreeBSD uses SjLj exceptions on ARM oabi. + switch (getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + return false; +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -737,8 +737,15 @@ + } + + case llvm::Triple::FreeBSD: +- // FreeBSD defaults to soft float +- FloatABI = "soft"; ++ switch(Triple.getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: ++ FloatABI = "hard"; ++ break; ++ default: ++ // FreeBSD defaults to soft float ++ FloatABI = "soft"; ++ break; ++ } + break; + + default: +@@ -5776,8 +5783,18 @@ + } + } else if (getToolChain().getArch() == llvm::Triple::arm || + getToolChain().getArch() == llvm::Triple::thumb) { +- CmdArgs.push_back("-mfpu=softvfp"); ++ const Driver &D = getToolChain().getDriver(); ++ llvm::Triple Triple = getToolChain().getTriple(); ++ StringRef FloatABI = getARMFloatABI(D, Args, Triple); ++ ++ if (FloatABI == "hard") { ++ CmdArgs.push_back("-mfpu=vfp"); ++ } else { ++ CmdArgs.push_back("-mfpu=softvfp"); ++ } ++ + switch(getToolChain().getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + CmdArgs.push_back("-meabi=5"); +Index: tools/clang/test/Driver/freebsd.c +=================================================================== +--- tools/clang/test/Driver/freebsd.c ++++ tools/clang/test/Driver/freebsd.c +@@ -101,13 +101,22 @@ + // RUN: | FileCheck --check-prefix=CHECK-ARM %s + // CHECK-ARM: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + + // RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s + // CHECK-ARM-EABI-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + // CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs" + ++// RUN: %clang %s -### -o %t.o -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \ ++// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s ++// CHECK-ARM-EABIHF-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" ++// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs" ++ + // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto -o %t.o 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-LTO %s + // CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so |