svn commit: r357999 - projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains

Dimitry Andric dim at FreeBSD.org
Sun Feb 16 13:22:37 UTC 2020


Author: dim
Date: Sun Feb 16 13:22:36 2020
New Revision: 357999
URL: https://svnweb.freebsd.org/changeset/base/357999

Log:
  Merge commit 62654cab7 from llvm git (by me):
  
    Restore functionality of --sysroot on FreeBSD after b18cb9c47
  
    After b18cb9c47, clang would sometimes prefer the host C++ includes
    (e.g. in /usr/include/c++/v1) before those specified via --sysroot.
    While this behavior may be desirable on Linux, it is not so on
    FreeBSD, where we make extensive use of --sysroot during the build of
    the base system.  In that case, clang must *not* search outside the
    sysroot, except for its own internal headers.
  
    Add an override addLibCxxIncludePaths() to restore the old behavior,
    which is to simply append /usr/include/c++/v1 to the specified
    sysroot.  While here, apply clang-format to the FreeBSD specific
    toolchain files.
  
    Fixes PR44923.

Modified:
  projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
  projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h

Modified: projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
==============================================================================
--- projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp	Sun Feb 16 13:16:40 2020	(r357998)
+++ projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp	Sun Feb 16 13:22:36 2020	(r357999)
@@ -99,7 +99,8 @@ void freebsd::Assembler::ConstructJob(Compilation &C, 
   case llvm::Triple::sparcel:
   case llvm::Triple::sparcv9: {
     std::string CPU = getCPUName(Args, getToolChain().getTriple());
-    CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
+    CmdArgs.push_back(
+        sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
     AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
     break;
   }
@@ -386,6 +387,12 @@ unsigned FreeBSD::GetDefaultDwarfVersion() const {
   if (getTriple().getOSMajorVersion() < 12)
     return 2;
   return 4;
+}
+
+void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+                                    llvm::opt::ArgStringList &CC1Args) const {
+  addSystemInclude(DriverArgs, CC1Args,
+                   getDriver().SysRoot + "/usr/include/c++/v1");
 }
 
 void FreeBSD::addLibStdCxxIncludePaths(

Modified: projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
==============================================================================
--- projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h	Sun Feb 16 13:16:40 2020	(r357998)
+++ projects/clang1000-import/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h	Sun Feb 16 13:22:36 2020	(r357999)
@@ -59,16 +59,18 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic
   bool IsObjCNonFragileABIDefault() const override { return true; }
 
   CXXStdlibType GetDefaultCXXStdlibType() const override;
-  void addLibStdCxxIncludePaths(
-      const llvm::opt::ArgList &DriverArgs,
-      llvm::opt::ArgStringList &CC1Args) const override;
+  void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+                             llvm::opt::ArgStringList &CC1Args) const override;
+  void
+  addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
+                           llvm::opt::ArgStringList &CC1Args) const override;
   void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
                            llvm::opt::ArgStringList &CmdArgs) const override;
   void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
                           llvm::opt::ArgStringList &CC1Args) const override;
 
-  llvm::ExceptionHandling GetExceptionModel(
-      const llvm::opt::ArgList &Args) const override;
+  llvm::ExceptionHandling
+  GetExceptionModel(const llvm::opt::ArgList &Args) const override;
   bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
   bool isPIEDefault() const override;
   SanitizerMask getSupportedSanitizers() const override;


More information about the svn-src-projects mailing list