Created attachment 386248 [details] Build log I get these link errros: /usr/lib64/libLLVMSupport.a(Threading.o): In function `llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)': Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x3a): undefined reference to `pthread_create' Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x4a): undefined reference to `pthread_join' Threading.cpp:(.text._ZN4llvm22llvm_execute_on_threadEPFvPvES0_j+0x68): undefined reference to `pthread_attr_setstacksize' collect2: error: ld returned 1 exit status Full log attached.
Commit message: Backport USE=llvm support from live ebuild http://sources.gentoo.org/sys-devel/sparse/metadata.xml?r1=1.7&r2=1.8 http://sources.gentoo.org/sys-devel/sparse/sparse-0.5.0.ebuild?r1=1.1&r2=1.2 http://sources.gentoo.org/sys-devel/sparse/sparse-9999.ebuild?r1=1.13&r2=1.14
seems like a bug in llvm to me. sparse uses `llvm-config --libs` to link, and that includes static libs and no -lpthread linkage.
I'm not an expert in linking to LLVM but... $ llvm-config --system-libs -lz -lpthread -lffi -ledit -lcurses -ldl -lm
llvm-config's man page: --libs Print all the libraries needed to link against the specified LLVM components, including any dependencies. although it doesn't mention --system-libs at all ...
--system-libs was added in llvm-3.5. There is a fix upstream https://git.kernel.org/cgit/devel/sparse/sparse.git/commit/?id=d92353b4eacbac54d693edd62fb565f071e3ba86 fixing this problem.
There is no more 0.5.0 in Gentoo and the 0.5.1 we have seems to compile fine. I'll close this as obsolete but please feel free to re-open. Thanks!