[clang] [Darwin][Driver][clang] Prioritise `-isysroot` over `--sysroot` consistently (PR #115993)
Steven Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 4 12:53:02 PST 2024
cachemeifyoucan wrote:
Ah, I see. I think `--sysroot` is not even involved when you use `DEFAULT_SYSROOT`, it is injected here:
https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/Driver.cpp#L205
Maybe instead of, the logic in the patch should be setting `-syslibroot` for linker in following order:
* `--sysroot`
* `-isysroot`
* `C.getSysRoot()`, which is basically DEFAULT_SYSROOT as other cases is handled in `--sysroot`
I don't think DEFAULT_SYSROOT is a common setting, and if it is set, users are probably expect to overwrite using `-isysroot` or `--sysroot`.
https://github.com/llvm/llvm-project/pull/115993
More information about the cfe-commits
mailing list