[clang] [clang] Match -isysroot behaviour with system compiler on Darwin (PR #80524)

Daniel Rodríguez Troitiño via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 5 11:11:50 PST 2024


drodriguez wrote:

> I need to take a closer look, since at first reading I can't evaluate the consequences, especially if this does change the behaviour when -isysroot is **not** provided.

Small detail that I think you are aware: the `-isysroot` can be provided, but it needs to have the `include/c++/v1` directory to be considered.

> And I do not know exactly the use case you are considering. My use case was relatively straightforward, multiple versions of the toolchain are installed in versioned custom folders in user home, and different projects requiring different toolchain versions have symbolic links from the project folder to one of the clang executable.
> 
> If your change does not affect the above use case and also adds more consistency with Apple clang, it should be fine.

I hope my modifications have not changed the behaviour of those versioned custom folders and symlinked `clang`. The tests were modified in a couple of places to remove a sysroot containing C++ headers in those checks. Before it did not matter which sysroot was being used, since it was the last to be chosen, but it was now interfering with what the test seemed to try to test.

https://github.com/llvm/llvm-project/pull/80524


More information about the cfe-commits mailing list