Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Mar 2014 09:23:13 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263619 - head/contrib/llvm/tools/clang/lib/Driver
Message-ID:  <201403220923.s2M9NDs8022432@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Mar 22 09:23:13 2014
New Revision: 263619
URL: http://svnweb.freebsd.org/changeset/base/263619

Log:
  Pull in r201662 from upstream clang trunk:
  
    Add FreeBSD ARM EABI hard-float support
  
    Patch by Andrew Turner.

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sat Mar 22 03:36:07 2014	(r263618)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sat Mar 22 09:23:13 2014	(r263619)
@@ -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;

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sat Mar 22 03:36:07 2014	(r263618)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sat Mar 22 09:23:13 2014	(r263619)
@@ -737,8 +737,15 @@ static StringRef getARMFloatABI(const Dr
     }
 
     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(Com
     }
   } 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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403220923.s2M9NDs8022432>