[clang] [Driver] Ensure ToolChain::LibraryPaths is not empty for non-Darwin (PR #87866)

YunQiang Su via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 00:56:21 PDT 2024


wzssyqa wrote:

> > @aeubanks The problem is that in your configure, the libclang_rt is placed in `<builddir>/lib/clang/19/lib/linux/libclang_rt.builtins-arm-android.a`, instead of `<buildir>/lib/clang/19/lib/arm-unknown-linux-android/libclang_rt.builtins.a`.
> 
> The point is that both locations were supposed to be accepted, as they were before - this PR was not supposed to be a policy change that affects that.

Yes. After the patch, both locations are accepted. This patch doesn't break it.
The current problem is that in some test cases, `-resource-dir` option are missing.

For details:
1. with `--sysroot` option, clang will try to find libclang_rt there. In the failure case, it fails to find.
2. then, clang try to look for libclang_rt from `lib/clang/19/lib/arm-unknown-android/libclang_rt.builtin.a`, and failed.
3. clang try to look for libclang_rt from `lib/clang/19/lib/linux/libclang_rt.builtin-arm-android.a`, and success.
     Thus the file name of libclang_rt is different with the one in test cases.
4. If 3) failed, clang will fallback to  `lib/clang/19/lib/arm-unknown-android/libclang_rt.builtin.a`, then test case success.

So, we can add `-resource-dir` to skip 3 for test case.

   

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


More information about the cfe-commits mailing list