r330310 - OpenBSD add C++ runtime in a driver's standpoint

Dean Michael Berris via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 18 23:55:30 PDT 2018


Author: dberris
Date: Wed Apr 18 23:55:30 2018
New Revision: 330310

URL: http://llvm.org/viewvc/llvm-project?rev=330310&view=rev
Log:
OpenBSD add C++ runtime in a driver's standpoint

Summary: - Since 6.2 release, on supporters platforms clang is shipped with both libcxx and libcxxabi.

Reviewers: dberris, alekseyshl, EricWF

Reviewed By: dberris

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45662

Modified:
    cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
    cfe/trunk/lib/Driver/ToolChains/OpenBSD.h

Modified: cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp?rev=330310&r1=330309&r2=330310&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp Wed Apr 18 23:55:30 2018
@@ -259,6 +259,14 @@ OpenBSD::OpenBSD(const Driver &D, const
   getFilePaths().push_back("/usr/lib");
 }
 
+void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+                                  ArgStringList &CmdArgs) const {
+  bool Profiling = Args.hasArg(options::OPT_pg);
+
+  CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
+  CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
+}
+
 Tool *OpenBSD::buildAssembler() const {
   return new tools::openbsd::Assembler(*this);
 }

Modified: cfe/trunk/lib/Driver/ToolChains/OpenBSD.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/OpenBSD.h?rev=330310&r1=330309&r2=330310&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/OpenBSD.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/OpenBSD.h Wed Apr 18 23:55:30 2018
@@ -58,6 +58,8 @@ public:
   bool IsMathErrnoDefault() const override { return false; }
   bool IsObjCNonFragileABIDefault() const override { return true; }
   bool isPIEDefault() const override { return true; }
+  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
+                           llvm::opt::ArgStringList &CmdArgs) const override;
 
   unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
     return 2;




More information about the cfe-commits mailing list