Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2012 21:41:40 +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: r244640 - in head/contrib/llvm/tools/clang/lib: Basic Driver
Message-ID:  <201212232141.qBNLfeNM072760@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sun Dec 23 21:41:39 2012
New Revision: 244640
URL: http://svnweb.freebsd.org/changeset/base/244640

Log:
  Pull in r170096 from upstream clang trunk:
  
    Initial support for FreeBSD on ARM.

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

Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Sun Dec 23 20:39:03 2012	(r244639)
+++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp	Sun Dec 23 21:41:39 2012	(r244640)
@@ -3078,7 +3078,9 @@ public:
     // name.
     if (Name == "apcs-gnu") {
       DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 32;
-      SizeType = UnsignedLong;
+      // size_t is unsigned int on FreeBSD.
+      if (getTriple().getOS() != llvm::Triple::FreeBSD)
+        SizeType = UnsignedLong;
 
       // Revert to using SignedInt on apcs-gnu to comply with existing behaviour.
       WCharType = SignedInt;

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sun Dec 23 20:39:03 2012	(r244639)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sun Dec 23 21:41:39 2012	(r244640)
@@ -1667,6 +1667,19 @@ Tool &FreeBSD::SelectTool(const Compilat
   return *T;
 }
 
+bool FreeBSD::UseSjLjExceptions() const {
+  // FreeBSD uses SjLj exceptions on ARM oabi.
+  switch (getTriple().getEnvironment()) {
+  case llvm::Triple::GNUEABI:
+  case llvm::Triple::EABI:
+    return false;
+
+  default:
+    return (getTriple().getArch() == llvm::Triple::arm ||
+            getTriple().getArch() == llvm::Triple::thumb);
+  }
+}
+
 /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
 
 NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, const ArgList &Args)

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h	Sun Dec 23 20:39:03 2012	(r244639)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h	Sun Dec 23 21:41:39 2012	(r244640)
@@ -468,6 +468,7 @@ public:
 
   virtual Tool &SelectTool(const Compilation &C, const JobAction &JA,
                            const ActionList &Inputs) const;
+  virtual bool UseSjLjExceptions() const;
 };
 
 class LLVM_LIBRARY_VISIBILITY NetBSD : public Generic_ELF {

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sun Dec 23 20:39:03 2012	(r244639)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sun Dec 23 21:41:39 2012	(r244640)
@@ -665,6 +665,11 @@ static StringRef getARMFloatABI(const Dr
       break;
     }
 
+    case llvm::Triple::FreeBSD:
+      // FreeBSD defaults to soft float
+      FloatABI = "soft";
+      break;
+
     default:
       switch(Triple.getEnvironment()) {
       case llvm::Triple::GNUEABIHF:
@@ -5422,6 +5427,17 @@ void freebsd::Assemble::ConstructJob(Com
          LastPICArg->getOption().matches(options::OPT_fpie))) {
       CmdArgs.push_back("-KPIC");
     }
+  } else if (getToolChain().getArch() == llvm::Triple::arm ||
+             getToolChain().getArch() == llvm::Triple::thumb) {
+    CmdArgs.push_back("-mfpu=softvfp");
+    switch(getToolChain().getTriple().getEnvironment()) {
+    case llvm::Triple::GNUEABI:
+    case llvm::Triple::EABI:
+      break;
+
+    default:
+      CmdArgs.push_back("-matpcs");
+    }
   }
 
   Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,



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