Summary: | dev-vcs/git-1.8.2.1[subversion] undefined reference to `pthread_setspecific' while linking svn-fe | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mike Gilbert <floppym> |
Component: | [OLD] Unspecified | Assignee: | Robin Johnson <robbat2> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | atrigent, bertrand, candrews, dark.knight.ita, gem, grubba, jlec, jlee, junghans, Martin.Jansa, Martin.vGagern, Tanktalus |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=450088 https://bugs.gentoo.org/show_bug.cgi?id=516168 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 372079 | ||
Attachments: |
Build log
build.log with USE="-subversion" |
Description
Mike Gilbert
2013-04-17 01:48:46 UTC
I was able to repoduce this issue: ../../libgit.a(run-command.o): In function `run_thread': run-command.c:(.text+0x11e): undefined reference to `pthread_setspecific' ../../libgit.a(run-command.o): In function `die_async': run-command.c:(.text+0x166): undefined reference to `pthread_getspecific' ../../libgit.a(run-command.o): In function `start_async': run-command.c:(.text+0x10f4): undefined reference to `pthread_create' run-command.c:(.text+0x115e): undefined reference to `pthread_key_create' ../../libgit.a(run-command.o): In function `finish_async': run-command.c:(.text+0x12b7): undefined reference to `pthread_join' [ebuild U ~] dev-vcs/git-1.8.2.1 [1.8.1.5] USE="blksha1 curl cvs gnome-keyring gpg gtk iconv nls pcre perl python subversion threads tk webdav -cgi -doc -emacs -highlight (-ppcsha1) {-test} -xinetd" 0 kB Cheers :) It also seems to disrespect $CC INCVS This is not fixed. The actual problem is that the thing with setting EXTLIBS for svn-fe in the 1.8.2.1 ebuild is a hack and there's no way you can ever completely fix this without properly integrating these contrib projects into git's actual build system. I realize that this isn't gentoo's responsibility, of course. This specific problem could be fixed by adding -lpthread to EXTLIBS. By the way, THREADED_DELTA_SEARCH no longer exists (and hasn't since 1.7.0), and the only control you have with regards to threads is with NO_PTHREADS. So in the ebuild's current state, git will be built with threads whether you like it or not. At this point I'm not sure there's any point in having a threads USE flag at all. I've been trying to figure out why the build is suddenly failing when it was succeeding with 1.8.1.5. I suspect that some code paths changed in libgit.a such that the functions being used by svn-fe now wind up requiring the ones that use threading (as well as pcre, zlib, and xdiff - it look like ssl is not actually required). However, I have not been able to prove this. *** Bug 466326 has been marked as a duplicate of this bug. *** should be all set now in the tree; thanks for the report! Commit message: Add missing pthreads linkage for svn-fe http://sources.gentoo.org/dev-vcs/git/git-1.8.2.1.ebuild?r1=1.2&r2=1.3 Thanks for the fix, but there are still some problems here. First of all, as I noted in comment #5, the threads USE flag _does_not_actually_impact_the_enabledness_of_threads_. Therefore, in the ebuild's current state, building with USE="subversion -threads" will _fail_, because svn-fe _still_requires_pthread_. Please just remove the threads USE flag - there is no point to its existence at this point. Also, I don't think this is related at all to "underlinking" issue. This is really an issue related very specifically to git's build system. How are you thinking that the linker's specific behavior could ever cause svn-fe to be linked with pthread if it is not being linked with it explicitly? (In reply to comment #8) > How are you thinking that the linker's specific behavior could ever cause > svn-fe to be linked with pthread if it is not being linked with it explicitly? At least on my system, libpcre depends on libpthread, so git with USE=pcre will link all right as long as the linker uses --copy-dt-needed-entries. This explains why the linker error message I quoted in bug #466326 comment #0 already suggests what library should be added to the invocation. (In reply to comment #9) > At least on my system, libpcre depends on libpthread, so git with USE=pcre > will link all right as long as the linker uses --copy-dt-needed-entries. > This explains why the linker error message I quoted in bug #466326 comment > #0 already suggests what library should be added to the invocation. Hmm, interesting. My copy of libpcre is not linked with libpthread, but it looks like it maybe should be. There is definitely some threading stuff in there, and the whole thing builds because stubs for most of the basic thread things are in libc, but using the stubs would make those functions not actually do anything. There was a commit: http://vcs.pcre.org/viewvc?view=revision&revision=1019 which makes libpcre's build system aware of the pthread requirement. I could be wrong, but it seems that before this commit libpcre might not have actually been thread safe. Oops! My version of libpcre is 8.30, which does NOT include the above mentioned commit. That's probably why it doesn't link with pthread. Which version do you have? It looks like 8.32 includes that commit. In any case, even if your pcre links with pthread, USE="subversion -threads -pcre" will still fail. The problem here is that when one is mixing static and dynamic libraries (as any program that uses static libraries, such as git with libgit.a, must do on a modern system), one has to keep track of the dynamic libraries that static libraries use - they can not do this themselves. git's build system knows what dynamic libraries libgit.a needs (including libpthread), but svn-fe's does not. That is the problem here. So again, this has nothing to do with underlinking. Mike, could you re-open this? It needs more attention. Created attachment 370256 [details]
build.log with USE="-subversion"
I'm getting this problem even with USE="-subversion"... even though this bug is specifically about USE="subversion" I thought it would be interesting to report this problem here.
[ebuild U ] dev-vcs/git-1.8.5.4 [1.8.5.2] USE="blksha1 curl gpg gtk highlight iconv nls pcre perl python threads webdav -cgi -cvs -doc -emacs -gnome-keyring -mediawiki% (-ppcsha1) -subversion {-test} -tk -xinetd" PYTHON_SINGLE_TARGET="python2_7 -python2_6" PYTHON_TARGETS="python2_7 -python2_6" 0 kB
That is definitely not the same issue. My advice would be that you ask about it on IRC or on the forums or something. I'm sure it's just happening because you're using a non-stable gcc version or have -flto in your CFLAGS or something like that. I think that upstream commit https://github.com/git/git/commit/da011cb0e77a6d2f7c424c5b7dbf482df4723a11 likely fixes this. *** Bug 574196 has been marked as a duplicate of this bug. *** I believe this ticket is obsolete, if the problem persists, please reopen |