Skip to content

clang C runtime files missing in elf-llvm toolchains #1774

@gilbsgilbs

Description

@gilbsgilbs

I maintain the AUR packages for most toolchains provided in this repo. Since 2025.09.16, my CI caught that clang supplied in the riscv32 and riscv64 elf-llvm toolchains fails to link simple C programs because the Clang runtime files are missing:

$ cat main.c
#include <stdio.h>
int main() { printf("ok\n"); return 0; }

$ riscv64-unknown-elf-clang main.c
/opt/riscv64-gnu-toolchain-elf-llvm-bin/bin/riscv64-unknown-elf-ld: cannot find /opt/riscv64-gnu-toolchain-elf-llvm-bin/lib/clang/21/lib/riscv64-unknown-unknown-elf/clang_rt.crtbegin.o: No such file or directory
/opt/riscv64-gnu-toolchain-elf-llvm-bin/bin/riscv64-unknown-elf-ld: cannot find /opt/riscv64-gnu-toolchain-elf-llvm-bin/lib/clang/21/lib/riscv64-unknown-unknown-elf/libclang_rt.builtins.a: No such file or directory
riscv64-unknown-elf-clang: error: linker command failed with exit code 1 (use -v to see invocation)

This also seems to reproduce in an Ubuntu 24.04 docker container, so it does not seem related to the way I build the package for Archlinux. I can confirm that both clang_rt.crtbegin.o and libclang_rt.builtins.a are completely missing from the release, therefore I don't think I can do anything from packaging side.

I can provide any additional logs or debugging information if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions