[clang] [llvm] Look for compiler-rt from subdir given by --target (PR #88334)

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


wzssyqa wrote:

Configure cmd
```
cmake ../llvm -G Ninja -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-gnu -DLLVM_USE_LINKER=lld -DLLVM_ENABLE_RUNTIMES="compiler-rt;libunwind" -DLLVM_ENABLE_PROJECTS="mlir;clang;clang-tools-extra;lld" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo
```

Note, in `-DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-gnu`,  there is no `unknown` aka vendor section.


With this configure, `libclang_rt.builtin.a` is present in 
    ```
./lib/clang/19/lib/aarch64-linux-gnu/
    ```

While clang expects it in
       ```
./lib/clang/19/lib/aarch64-unknown-linux-gnu/   #### Note "unknown"
    ```

The reason is that in `computeTargetTriple`, the line
```
llvm::Triple Target(llvm::Triple::normalize(TargetTriple));
```
convert the triple to normalize.

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


More information about the cfe-commits mailing list