Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 524776 - sys-devel/sparse-0.5.0 link errors: undefined reference to `pthread_create'
Summary: sys-devel/sparse-0.5.0 link errors: undefined reference to `pthread_create'
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-08 17:26 UTC by Sebastian Pipping
Modified: 2019-12-31 18:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (sys-devel:sparse-0.5.0:20141008-172133.log,15.63 KB, text/octet-stream)
2014-10-08 17:26 UTC, Sebastian Pipping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2014-10-08 17:26:31 UTC
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.
Comment 2 SpanKY gentoo-dev 2014-10-16 19:26:13 UTC
seems like a bug in llvm to me.  sparse uses `llvm-config --libs` to link, and that includes static libs and no -lpthread linkage.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-10-16 19:37:04 UTC
I'm not an expert in linking to LLVM but...

$ llvm-config --system-libs
-lz -lpthread -lffi -ledit -lcurses -ldl -lm
Comment 4 SpanKY gentoo-dev 2014-10-18 22:22:30 UTC
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 ...
Comment 5 Alexander Stein 2014-10-29 21:09:06 UTC
--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.
Comment 6 Sebastian Pipping gentoo-dev 2019-12-31 18:29:59 UTC
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!