During it's configure phase, musl's configure script checks if compiler_rt exists by checking if the library libcompiler_rt.a exists, which it doesn't.
The compiler_rt package installs only these packages:
partridge / # equery f compiler-rt
* Searching for compiler-rt ...
* Contents of sys-libs/compiler-rt-5.0.1:
I fixed the issue creating a symlink from /usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-x86_64.a to /usr/lib/libcompiler_rt.a
I propose that the compiler-rt ebuild should do this automatically.
Created attachment 513562 [details]
beginning of configure
Created attachment 513564 [details]
Created attachment 513566 [details]
Steps to Reproduce:
1. Uninstall gcc on musl
2. Install clang
3. Try to compile musl
I am doing this with the compiler as clang, and gcc is uninstalled. /usr/bin/cc is a symlink to clang.
This error does not occur under gcc, as musl links against libgcc_s if gcc is installed, alleviating the problem.
Seems this was discussed on llvm mailing list?
I think this was fixed a while back: https://git.musl-libc.org/cgit/musl/commit/?id=fcf24b9f388d650a92375079461198f5db3ed88a.