Skip to content

Faulty CMake option related to llvm_runtime  #123164

Open
@AugustineYang

Description

@AugustineYang

I have encountered an issue related to llvm_runtime component compiler-rt. When linking a riscv32 assembly code with ld.lld, I got an error saying ld.lld: error: cannot open ....../libclang_rt.builtins.a: No such file or directory. After searching for previous issues like #87150, #72862, How to build libclang_rt.builtins.a?, it seems that the issue happens because of the lack of building "compiler-rt".

After digging into the Clang Doc and the CMakeLists file, it turns out that CMake option -DLLVM_ENABLE_RUNTIMES=all will only build default runtimes "libcxx;libcxxabi;libunwind" rather than all supported runtimes "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload". This can result in the possible omission of building the compiler-rt.

Since many people have encountered the issue due to this confusing "all" option, maybe we should add a "default" option for building "default runtimes", and use "all" option to build "all supported runtimes".

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particular

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions