llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Rainer Orth (rorth)

<details>
<summary>Changes</summary>

`clang++` defaults to `-stdlib=libc++` on FreeBSD.  When building with both 
`clang` and `libcxx` included, the freshly built `clang++` uses the system 
version of the `libc++` headers.  However, this is from the bundled `libc++` 
19.1.7, thus inconsistent with the `libc++` being built.

Similarly to the NetBSD case, FreeBSD has its own version of 
`addLibCxxIncludePaths` which just includes `/usr/include/c++/v1`.

Rather than replicating the generic version in `Gnu.cpp`, this patch just calls 
`Generic_GCC::addLibCxxIncludePaths`.

Tested on `amd64-pc-freebsd15.1`.

This breaks the `Driver/freebsd.cpp` and `Driver/freebsd-include-paths.c` 
testcases.  Once it can be confirmed the approach is sound, I'll  update them 
accordingly.

---
Full diff: https://github.com/llvm/llvm-project/pull/212725.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChains/FreeBSD.cpp (+2-2) 


``````````diff
diff --git a/clang/lib/Driver/ToolChains/FreeBSD.cpp 
b/clang/lib/Driver/ToolChains/FreeBSD.cpp
index 724ccbefd790f..519999a9a5bcf 100644
--- a/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -10,6 +10,7 @@
 #include "Arch/ARM.h"
 #include "Arch/Mips.h"
 #include "Arch/Sparc.h"
+#include "Gnu.h"
 #include "clang/Config/config.h"
 #include "clang/Driver/CommonArgs.h"
 #include "clang/Driver/Compilation.h"
@@ -434,8 +435,7 @@ void FreeBSD::AddClangSystemIncludeArgs(
 
 void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
                                     llvm::opt::ArgStringList &CC1Args) const {
-  addSystemInclude(DriverArgs, CC1Args,
-                   concat(getDriver().SysRoot, "/usr/include/c++/v1"));
+  Generic_GCC::addLibCxxIncludePaths(DriverArgs, CC1Args);
 }
 
 void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,

``````````

</details>


https://github.com/llvm/llvm-project/pull/212725
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to