diff options
author | andrew <andrew@FreeBSD.org> | 2014-03-22 09:23:13 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2014-03-22 09:23:13 +0000 |
commit | e97a0e252b398acead00694bf1d357d9089128ad (patch) | |
tree | 41ad66b8fc304358dce832d2147d36084c20997f /contrib/llvm | |
parent | 35c60983b519a0a4c8d62215977c3aa419c44744 (diff) | |
download | FreeBSD-src-e97a0e252b398acead00694bf1d357d9089128ad.zip FreeBSD-src-e97a0e252b398acead00694bf1d357d9089128ad.tar.gz |
Pull in r201662 from upstream clang trunk:
Add FreeBSD ARM EABI hard-float support
Patch by Andrew Turner.
Diffstat (limited to 'contrib/llvm')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp | 1 | ||||
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/Tools.cpp | 23 |
2 files changed, 21 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp index f5dc3dfb..d98c654 100644 --- a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp @@ -2034,6 +2034,7 @@ Tool *FreeBSD::buildLinker() const { 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; diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp index b37b31c..423c245 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -737,8 +737,15 @@ static StringRef getARMFloatABI(const Driver &D, } 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 @@ void freebsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA, } } 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"); |