Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Mar 2014 00:25:28 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263891 - head/contrib/llvm/tools/clang/lib/Driver
Message-ID:  <201403290025.s2T0PSgd060326@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Mar 29 00:25:27 2014
New Revision: 263891
URL: http://svnweb.freebsd.org/changeset/base/263891

Log:
  Make clang default to DWARF2 debug info format for FreeBSD 10.x and
  earlier.  For head, this commit does not change anything, but it is
  purely meant to be MFC'd.
  
  MFC after:	3 days

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

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Fri Mar 28 23:20:56 2014	(r263890)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sat Mar 29 00:25:27 2014	(r263891)
@@ -2635,8 +2635,10 @@ void Clang::ConstructJob(Compilation &C,
       CmdArgs.push_back("-gdwarf-4");
     else if (!A->getOption().matches(options::OPT_g0) &&
              !A->getOption().matches(options::OPT_ggdb0)) {
-      // Default is dwarf-2 for darwin.
-      if (getToolChain().getTriple().isOSDarwin())
+      // Default is dwarf-2 for darwin and FreeBSD <= 10.
+      const llvm::Triple &Triple = getToolChain().getTriple();
+      if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD &&
+          Triple.getOSMajorVersion() <= 10))
         CmdArgs.push_back("-gdwarf-2");
       else
         CmdArgs.push_back("-g");



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