Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 524430 - dev-vcs/git - build failure with USE=-threads
Summary: dev-vcs/git - build failure with USE=-threads
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-04 09:17 UTC by Andrew Church
Modified: 2022-09-04 04:16 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Church 2014-10-04 09:17:34 UTC
Building dev-vcs/git-2.1.2 with USE=-threads results in the following failure:

x86_64-pc-linux-gnu-gcc  -O2 -march=x86-64 -mtune=core-avx-i -mmmx -msse -msse2 -pipe -fno-strict-aliasing -Wall -I. -DHAVE_ALLOCA_H -DNO_GETTEXT -DNO_PTHREADS -DHAVE_PATHS_H -DHAVE_DEV_TTY -DXDL_FAST_HASH -DHAVE_CLOCK_GETTIME -DSHA1_HEADER='"block-sha1/sha1.h"'  -DNO_STRLCPY -DNO_MKSTEMPS -DSHELL_PATH='"/bin/sh"' -o test-line-buffer -Wl,-O1 -Wl,--as-needed  test-line-buffer.o libgit.a xdiff/lib.a vcs-svn/lib.a libgit.a xdiff/lib.a  -lz -lrt
builtin/index-pack.o: In function `find_unresolved_deltas':
index-pack.c:(.text+0x158b): undefined reference to `type_cas_lock'
index-pack.c:(.text+0x159c): undefined reference to `type_cas_unlock'
index-pack.c:(.text+0x16cf): undefined reference to `type_cas_unlock'
collect2: error: ld returned 1 exit status

The compile command for the relevant source file has these warnings:

x86_64-pc-linux-gnu-gcc -o builtin/index-pack.o -c -MF builtin/.depend/index-pack.o.d -MQ builtin/index-pack.o -MMD -MP  -O2 -march=x86-64 -mtune=core-avx-i -mmmx -msse -msse2 -pipe -fno-strict-aliasing -Wall -I. -DHAVE_ALLOCA_H -DNO_GETTEXT -DNO_PTHREADS -DHAVE_PATHS_H -DHAVE_DEV_TTY -DXDL_FAST_HASH -DHAVE_CLOCK_GETTIME -DSHA1_HEADER='"block-sha1/sha1.h"'  -DNO_STRLCPY -DNO_MKSTEMPS -DSHELL_PATH='"/bin/sh"'  builtin/index-pack.c
builtin/index-pack.c: In function 'compare_and_swap_type':
builtin/index-pack.c:907:2: warning: implicit declaration of function 'type_cas_lock' [-Wimplicit-function-declaration]
builtin/index-pack.c:911:2: warning: implicit declaration of function 'type_cas_unlock' [-Wimplicit-function-declaration]

It looks like upstream forgot to protect type_cas_[un]lock() calls with #ifndef NO_PTHREADS.
Comment 1 Ulenrich 2014-10-05 18:27:41 UTC
Confirm, couldnt build with -threads having the same type_cas_ lines
But turning on threds builds.
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-04-20 15:03:40 UTC
Is this still an issue with recent git versions? I cannot reproduce this on my dev machine...
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-04-20 15:12:04 UTC
Ignore my previous comment. It still fails. I could reproduce it.
Comment 4 Larry the Git Cow gentoo-dev 2020-04-15 16:06:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0958dd0bca87b69933521acb8a28b44b2cb3b41d

commit 0958dd0bca87b69933521acb8a28b44b2cb3b41d
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2020-04-15 16:03:41 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2020-04-15 16:06:43 +0000

    dev-vcs/git: Fixed build with USE="-threads"
    
    Closes: https://bugs.gentoo.org/524430
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 dev-vcs/git/git-2.23.1-r1.ebuild | 2 +-
 dev-vcs/git/git-2.23.2.ebuild    | 2 +-
 dev-vcs/git/git-2.24.1.ebuild    | 2 +-
 dev-vcs/git/git-2.24.2.ebuild    | 2 +-
 dev-vcs/git/git-2.25.1.ebuild    | 2 +-
 dev-vcs/git/git-2.25.2.ebuild    | 2 +-
 dev-vcs/git/git-2.25.3.ebuild    | 2 +-
 dev-vcs/git/git-2.26.0.ebuild    | 2 +-
 dev-vcs/git/git-2.26.1.ebuild    | 2 +-
 dev-vcs/git/git-9999-r1.ebuild   | 2 +-
 dev-vcs/git/git-9999-r2.ebuild   | 2 +-
 dev-vcs/git/git-9999-r3.ebuild   | 2 +-
 dev-vcs/git/git-9999.ebuild      | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)