[PATCH] D16264: For FreeBSD, use _p variants of libraries for linking C++ programs
Dimitry Andric via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 14 14:19:25 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260851: As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD, (authored by dim).
Changed prior to commit:
http://reviews.llvm.org/D16264?vs=47913&id=47930#toc
Repository:
rL LLVM
http://reviews.llvm.org/D16264
Files:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/test/Driver/freebsd.cpp
Index: cfe/trunk/test/Driver/freebsd.cpp
===================================================================
--- cfe/trunk/test/Driver/freebsd.cpp
+++ cfe/trunk/test/Driver/freebsd.cpp
@@ -2,5 +2,12 @@
// RUN: | FileCheck --check-prefix=CHECK-TEN %s
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NINE %s
-// CHECK-TEN: -lc++
-// CHECK-NINE: -lstdc++
+// CHECK-TEN: "-lc++" "-lm"
+// CHECK-NINE: "-lstdc++" "-lm"
+
+// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s
+// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s
+// CHECK-PG-TEN: "-lc++_p" "-lm_p"
+// CHECK-PG-NINE: "-lstdc++_p" "-lm_p"
Index: cfe/trunk/lib/Driver/ToolChains.h
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.h
+++ cfe/trunk/lib/Driver/ToolChains.h
@@ -728,6 +728,8 @@
void AddClangCXXStdlibIncludeArgs(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;
+ void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs) const override;
bool UseSjLjExceptions(const llvm::opt::ArgList &Args) const override;
bool isPIEDefault() const override;
Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -3128,6 +3128,22 @@
}
}
+void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
+ ArgStringList &CmdArgs) const {
+ CXXStdlibType Type = GetCXXStdlibType(Args);
+ bool Profiling = Args.hasArg(options::OPT_pg);
+
+ switch (Type) {
+ case ToolChain::CST_Libcxx:
+ CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
+ break;
+
+ case ToolChain::CST_Libstdcxx:
+ CmdArgs.push_back(Profiling ? "-lstdc++_p" : "-lstdc++");
+ break;
+ }
+}
+
Tool *FreeBSD::buildAssembler() const {
return new tools::freebsd::Assembler(*this);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16264.47930.patch
Type: text/x-patch
Size: 2210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160214/65487321/attachment.bin>
More information about the cfe-commits
mailing list