Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 643742

Summary: sys-libs/musl-1.1.18 doesn't build, configure does not detect compiler-rt correctly, requires /usr/lib/libcompiler_rt.a to be present
Product: Gentoo Linux Reporter: Bjorn Pagen <bjornpagen>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED FIXED    
Severity: normal CC: herrtimson, jstein, lu_zero, musl, sam, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: beginning of configure
emerge --info
full build.log

Description Bjorn Pagen 2018-01-06 22:23:02 UTC
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:
/usr
/usr/lib
/usr/lib/clang
/usr/lib/clang/5.0.1
/usr/lib/clang/5.0.1/lib
/usr/lib/clang/5.0.1/lib/linux
/usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-x86_64.a
/usr/share
/usr/share/doc
/usr/share/doc/compiler-rt-5.0.1
/usr/share/doc/compiler-rt-5.0.1/README.txt.bz2
###

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.
Comment 1 Bjorn Pagen 2018-01-06 22:25:50 UTC
Created attachment 513562 [details]
beginning of configure
Comment 2 Bjorn Pagen 2018-01-06 22:29:25 UTC
Created attachment 513564 [details]
emerge --info
Comment 3 Bjorn Pagen 2018-01-06 22:32:14 UTC
Created attachment 513566 [details]
full build.log
Comment 4 Bjorn Pagen 2018-01-07 15:09:07 UTC
Steps to Reproduce:
1. Uninstall gcc on musl
2. Install clang
3. Try to compile musl
Comment 5 Bjorn Pagen 2018-01-09 02:37:50 UTC
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.
Comment 6 tt_1 2019-03-04 20:35:09 UTC
Seems this was discussed on llvm mailing list? 

http://lists.llvm.org/pipermail/llvm-dev/2016-December/108348.html
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-23 04:34:36 UTC
I think this was fixed a while back: https://git.musl-libc.org/cgit/musl/commit/?id=fcf24b9f388d650a92375079461198f5db3ed88a.