[PATCH] D77776: [Driver] Default to libc++ on FreeBSD
Jan Beich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 14 10:44:07 PDT 2020
jbeich updated this revision to Diff 257403.
jbeich retitled this revision from "[Driver] Drop support for FreeBSD < 10" to "[Driver] Default to libc++ on FreeBSD".
jbeich added a comment.
- Limit the scope to `-stdlib`
In D77776#1972543 <https://reviews.llvm.org/D77776#1972543>, @dim wrote:
> the lowest supported version, which is currently 10
Where is this defined? Does someone build LLVM master on FreeBSD < 11.3?
ports/ (for dependencies) quickly cut off EOL support to avoid bitrot due to lack of QA.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77776/new/
https://reviews.llvm.org/D77776
Files:
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/test/Driver/freebsd.cpp
Index: clang/test/Driver/freebsd.cpp
===================================================================
--- clang/test/Driver/freebsd.cpp
+++ clang/test/Driver/freebsd.cpp
@@ -1,13 +1,19 @@
+// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd -stdlib=platform 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TEN %s
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NINE %s
+// CHECK-DEFAULT: "-lc++" "-lm"
// CHECK-TEN: "-lc++" "-lm"
// CHECK-NINE: "-lstdc++" "-lm"
+// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd -stdlib=platform 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-PG-DEFAULT %s
// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 -stdlib=platform 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s
// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 -stdlib=platform 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s
+// CHECK-PG-DEFAULT: "-lc++_p" "-lm_p"
// CHECK-PG-TEN: "-lc++_p" "-lm_p"
// CHECK-PG-NINE: "-lstdc++_p" "-lm_p"
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===================================================================
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -378,7 +378,8 @@
}
ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibType() const {
- if (getTriple().getOSMajorVersion() >= 10)
+ unsigned Major = getTriple().getOSMajorVersion();
+ if (Major >= 10 || Major == 0)
return ToolChain::CST_Libcxx;
return ToolChain::CST_Libstdcxx;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77776.257403.patch
Type: text/x-patch
Size: 1787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200414/67083ae5/attachment-0001.bin>
More information about the cfe-commits
mailing list